/* Landing page.
 *
 * What an anonymous visitor to "/" sees on a deployment with accounts, before
 * the workbench: what the tool is, how a run goes, what a finished report
 * looks like, who pays, and the two buttons that lead in. It is a page, not
 * an overlay — the sign-in card (workbench.css, .gate) opens over it when a
 * button is pressed, exactly as it used to open over the empty workbench.
 *
 * The same tokens as the workbench, so both themes come for free; the brand
 * mark and the language select reuse the workbench rules, which are loaded
 * with this sheet. One column below 860px, where the composer also folds.
 */

.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-base);
}

/* ── Header ── */

.landing__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--wide-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.landing .brand { flex: 0 1 auto; }
.landing .brand__name { font-size: var(--text-md); }

.landing__nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.landing__nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.landing__nav > a:hover { color: var(--accent); }
.landing__nav .btn { min-height: 44px; }

/* ── Body ── */

.landing__main {
  flex: 1;
  width: 100%;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-16);
}

.landing__hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-16) 0 var(--space-12);
}

.landing__eyebrow {
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.landing__pitch h1 {
  max-width: 14em;
  font-size: clamp(32px, 4.4vw, 54px);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.landing__lede {
  max-width: 36em;
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.landing__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.landing__actions .btn {
  min-height: 44px;
  padding-inline: var(--space-5);
  font-size: var(--text-md);
}
.landing__sample-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.landing__sample-link:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Three points under the buttons. The column used to end at the buttons
   while the card beside it ran on for another 360 px. A rule in the accent
   down the side of each, as the sample list beside them has. */
.landing__points {
  display: grid;
  gap: var(--space-5);
  max-width: 36em;
  margin-top: var(--space-10);
  list-style: none;
}
.landing__points li {
  display: grid;
  gap: var(--space-1);
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent-border);
}
.landing__points strong {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.landing__points span {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* A sheet laid on the page, like a report card in the workbench. */
.landing__card {
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}
.landing__card h2 { font-size: var(--text-xl); }
.landing__card > p {
  margin-top: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* The scorecard crop across the top of the card, bleeding to its edges. It is
   a dark interface capture; on paper it reads as the screenshot it is. */
.landing__figure {
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}
/* One sample's scorecard, drawn by the page (app.js paintLandingPreview):
   the verdict and five bars at this card's size. It was a 900 px picture,
   unreadable at a phone's width and dark in the light theme.
   The frame keeps its height while the scores are on their way, so the card
   under it does not jump when they arrive; where they cannot be read the
   frame goes and one line stands in for it. */
.landing__preview {
  min-height: 275px;   /* the drawn card, measured at 1440 px */
  padding: var(--space-6) var(--space-6) var(--space-4);
}
/* Where the verdict's words wrap under its figure, the card is a line taller. */
@media (max-width: 440px) {
  .landing__preview { min-height: 329px; }   /* measured at 375 px */
}
.landing__preview[data-state="missing"] { display: none; }
.landing__preview .scorecard__head {
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
}
.landing__preview .scorecard__value { font-size: 48px; }
.landing__preview .dims { gap: var(--space-3); }
/* Three columns at every width: the card is narrow on a desk too, and the
   label, bar and figure of a row fit it down to a 320 px screen. The bar's
   placement is reset because the report's own phone rule moves it to a row
   of its own (result.css). */
.landing__preview .dim {
  grid-template-columns: minmax(0, 10.5em) minmax(2.5rem, 1fr) auto;
  gap: var(--space-3);
}
.landing__preview .dim__bar { grid-column: auto; grid-row: auto; }
.landing__preview .dim__label { font-size: var(--text-sm); }
.landing__preview-note {
  padding: var(--space-6) var(--space-6) var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.landing__figure figcaption {
  padding: var(--space-2) var(--space-6);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-normal);
}

/* Finished reports, listed from /api/samples so the titles are the real ones. */
.landing__sample-list {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-4);
  list-style: none;
}
.landing__sample-list a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--accent-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-primary);
  font-weight: 500;
  line-height: var(--leading-normal);
}
.landing__sample-list a:hover { background: var(--bg-hover); color: var(--accent); }
/* The verdict, readiness level and language of each, as on the reader's cards. */
.landing__sample-facts {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.landing__sample .btn { margin-top: var(--space-4); min-height: 44px; }

/* ── What a finished assessment looks like ──
   A screenshot of one sample's decision brief and scorecard, in the theme,
   at the width and in the language the visitor reads in (app.js
   paintLandingShot names the file). It is framed as what it is, a capture of
   another page, and it opens that page. The width and height on the picture
   keep its place before it loads. */
/* No wider than the capture is: 872 px of the sample page, at twice the
   pixels. Wider, its text would stand larger than the page's own. */
.landing__shot-figure { max-width: 872px; margin: var(--space-4) auto 0; }
.landing__shot-link {
  display: block;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-base);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease);
}
.landing__shot-link:hover { border-color: var(--accent-border); }
.landing__shot-link img {
  display: block;
  width: 100%;
  height: auto;
}
.landing__shot-figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-tertiary);
}

/* ── How a run goes: three numbered cards ── */

.landing__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
  list-style: none;
  counter-reset: step;
}
.landing__steps li {
  counter-increment: step;
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}
.landing__steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 600;
}
.landing__steps h2 { font-size: var(--text-lg); }
.landing__steps p {
  margin-top: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* Where the evidence comes from, by name, under the step that gathers it. */
.landing__sources {
  margin-top: var(--space-4);
  padding: 0 var(--space-6);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.landing__pay { margin-top: var(--space-4); }
/* What an assessment cost, a row for each measured model. Four sums, four
   model names and two months stood in one sentence. */
.landing__costs {
  width: 100%;
  max-width: 46em;
  margin-top: var(--space-4);
  border-collapse: collapse;
  font-size: var(--text-base);
}
.landing__costs th,
.landing__costs td {
  padding: var(--space-2) var(--space-4) var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 400;
  text-align: left;
  vertical-align: baseline;
}
.landing__costs thead th {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.landing__costs tbody th { font-weight: 600; }
.landing__cost-model { font-family: var(--font-mono); font-size: var(--text-sm); }
.landing__cost-sum,
.landing__cost-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.landing__costs .landing__cost-date { color: var(--text-secondary); }
.landing__pay > p { max-width: 60em; }
.landing__pay > p + p { margin-top: var(--space-3); }
.landing__pay .key-guide { max-width: 60em; margin-top: var(--space-4); }
.landing__retention:empty { display: none; }

/* ── Common questions ── Closed until asked: a question is one press away
   and the page stays a page. The whole line is the control, 48 px tall. */
.landing__faq { margin-top: var(--space-12); }
.landing__faq h2 { margin-bottom: var(--space-3); font-size: var(--text-xl); }
.landing__question { border-top: 1px solid var(--border-default); }
.landing__question:last-of-type { border-bottom: 1px solid var(--border-default); }
.landing__question > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 48px;
  padding: var(--space-3) 0;
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.landing__question > summary::-webkit-details-marker { display: none; }
.landing__question > summary::after {
  content: "+";
  flex: none;
  color: var(--text-tertiary);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1;
}
.landing__question[open] > summary::after { content: "−"; }
.landing__question > summary:hover { color: var(--accent); }
.landing__answer {
  max-width: 60em;
  padding-bottom: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
.landing__answer p + p { margin-top: var(--space-2); }

/* ── Footer ── */

.landing__foot { border-top: 1px solid var(--border-subtle); }
/* The same box as .landing__main, so the links line up with the text above. */
.landing__foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-5);
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom));
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.landing__foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
}
.landing__foot a:hover { color: var(--accent); }
.landing__disclaimer {
  width: 100%;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Phones ── One column, 16px gutters, nothing wider than the screen. */
@media (max-width: 860px) {
  .landing__head,
  .landing__main,
  .landing__foot-inner { padding-inline: var(--space-4); }
  /* The hero has its own link to the samples; the header keeps to sign-in and language. */
  .landing__nav > a { display: none; }
  .landing__hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
    padding: var(--space-10) 0 var(--space-8);
  }
  .landing__pitch h1 { max-width: none; }
  .landing__steps { grid-template-columns: minmax(0, 1fr); }
  .landing__sample-link { margin-left: 0; }
  .landing__points { margin-top: var(--space-8); }
  .landing__sources { padding: 0; }
}
/* On a phone the capture is the phone's own, and four screens tall. Its
   first screen is shown and fades out: the sample it opens is the same thing
   as a page, which reads better than a picture of one. */
@media (max-width: 640px) {
  .landing__shot-link { position: relative; max-height: 34rem; }
  .landing__shot-link::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 6rem;
    background: linear-gradient(to bottom, transparent, var(--bg-raised));
    pointer-events: none;
  }
}
/* A phone has no room for four columns. Each measured model is two lines:
   who and how much, then which model and when. The headings stay for a
   screen reader and leave the screen. */
@media (max-width: 640px) {
  .landing__costs thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .landing__costs tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .landing__costs tbody th,
  .landing__costs tbody td { padding: 0; border-bottom: 0; }
  .landing__costs .landing__cost-sum { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  .landing__costs .landing__cost-model { grid-column: 1; grid-row: 2; overflow-wrap: anywhere; }
  .landing__costs .landing__cost-date { grid-column: 2; grid-row: 2; text-align: right; }
}
