/* Frontage - public landing page (/ when signed out, /site when signed in).
 *
 * Loaded AFTER console.css, which owns the palette. Everything here is
 * either an `lp-` class, a reveal helper, or scoped to body.landing, so
 * nothing can leak into the signed-in console.
 *
 * The look, in short, so later edits keep it:
 *   - one typeface (the system face from console.css), two working sizes:
 *     large headings and readable body text, little in between;
 *   - surfaces are separated by a step in background tone (ground,
 *     surface, accent field, ink field), not by borders or shadows;
 *   - no small uppercase labels, pill tags, numbered circles, gradients
 *     or glows; the pictures are real pages of the sample reports;
 *   - generous space between sections, tighter space inside them.
 *
 * Reveal contract, in one place because it is easy to get wrong:
 *   - base CSS never hides anything;
 *   - landing.js adds `js-reveal` to <html> as its first statement, and
 *     only then do `.reveal` / `.stagger` start out hidden;
 *   - so with JavaScript off, or blocked, or broken, the page is just a
 *     normal document.
 * The prefers-reduced-motion block at the bottom unhides everything with
 * !important, as a second belt alongside the check landing.js makes.
 */

:root {
  --lp-ease: cubic-bezier(.22, .61, .36, 1);
  --lp-reveal: 560ms;
  --lp-reveal-item: 480ms;
  --lp-max: 1200px;
  --lp-gutter: 32px;
  --lp-space: 128px;     /* between sections */
}

/* ---------------------------------------------------------- reveal ---- */

html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
}
html.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--lp-reveal) var(--lp-ease),
              transform var(--lp-reveal) var(--lp-ease);
}
html.js-reveal .stagger > * {
  opacity: 0;
  transform: translateY(16px);
}
html.js-reveal .stagger.is-in > * {
  opacity: 1;
  transform: none;
  transition: opacity var(--lp-reveal-item) var(--lp-ease),
              transform var(--lp-reveal-item) var(--lp-ease);
}
html.js-reveal .stagger.is-in > *:nth-child(2) { transition-delay: 80ms; }
html.js-reveal .stagger.is-in > *:nth-child(3) { transition-delay: 160ms; }
html.js-reveal .stagger.is-in > *:nth-child(n + 4) { transition-delay: 240ms; }

/* ------------------------------------------------------------ page ---- */

html { scroll-padding-top: 88px; }

body.landing {
  background: var(--ground);
  background-image: none;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}
body.landing main { display: block; }

.lp-hero,
.lp-sec,
.lp-wrap,
.lp-head-in {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding-left: var(--lp-gutter);
  padding-right: var(--lp-gutter);
}

.lp-sec { padding-top: var(--lp-space); padding-bottom: var(--lp-space); }
.lp-band { background: var(--surface); padding: var(--lp-space) 0; }

/* `:where()` keeps these at element specificity, so a single class below
   can still override them. */
:where(body.landing) h1 {
  font-size: clamp(2.4rem, 1.1rem + 4vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -.012em;
  font-weight: 650;
  margin: 0;
  text-wrap: balance;
}
:where(body.landing) h2 {
  font-size: clamp(1.8rem, 1.15rem + 1.9vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  font-weight: 640;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}
:where(body.landing) h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -.01em;
  font-weight: 620;
  margin: 0 0 8px;
}
:where(body.landing) p { margin: 0 0 16px; }
:where(body.landing main) p { color: var(--ink-soft); }

.lp-lead {
  margin: 28px 0 0;
  font-size: clamp(1.1rem, 1rem + .35vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink) !important;
  max-width: 34em;
}
.lp-statement {
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink) !important;
  max-width: 36em;
}
.lp-small { font-size: 14.5px; }

/* Buttons and links: flat, one fill, no lift. */
body.landing .btn-primary {
  background: var(--accent);
  box-shadow: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background var(--ease);
}
body.landing .btn-primary:hover {
  background: var(--accent-ink);
  filter: none;
  box-shadow: none;
  transform: none;
}
.lp-btn-lg { padding: 15px 26px !important; font-size: 16px !important; }
.lp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin: 40px 0 0;
}
.lp-link {
  color: var(--ink);
  font-weight: 560;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  transition: text-decoration-color var(--ease), color var(--ease);
}
.lp-link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* ---------------------------------------------------------- header ---- */

.lp-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ground);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--lp-ease);
}
.lp-head.is-compact { border-bottom-color: var(--line); }
.lp-head-in {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 76px;
  transition: height 180ms var(--lp-ease);
}
.lp-head.is-compact .lp-head-in { height: 62px; }
body.landing .brand-label { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
body.landing .brand .mark { width: 24px; height: 24px; }

.lp-nav { display: flex; gap: 28px; margin-right: auto; }
.lp-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease);
}
.lp-nav a:hover { color: var(--ink); }

.lp-head-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  flex: none;
}
.landing-login {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease);
}
.landing-login:hover { color: var(--ink); }
.lp-signout { margin: 0; display: flex; }
.lp-signout button.landing-login {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
body.landing .lp-head .btn-primary { padding: 10px 18px; font-size: 15px; }

/* ------------------------------------------------------------ hero ---- */

.lp-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 72px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: var(--lp-space);
}
.lp-hero-note { margin: 32px 0 0 !important; font-size: 15px; max-width: 46em; }

/* The report page rises out of a field of tone, cut off at the bottom
   edge, so it reads as a document rather than a screenshot in a frame. */
.lp-hero-media { margin: 0; min-width: 0; }
.lp-hero-media img,
.lp-shot img,
.lp-doc-page img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.lp-hero-media img { border-radius: 4px 4px 0 0; }
.lp-media-field {
  background: var(--surface-2);
  padding: 44px 44px 0;
  border-radius: 8px;
  overflow: hidden;
}
.lp-hero-media figcaption { margin-top: 14px; }
figure figcaption,
.lp-finding-fig figcaption {
  font-size: 14px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------- shared layouts ---- */

/* A heading on the left, its content on the right. */
.lp-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 72px;
  align-items: start;
}
.lp-split > .lp-statement { margin: 6px 0 0; }

.lp-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 72px;
  margin-top: 88px;
}
.lp-columns h3 { font-size: 1.35rem; letter-spacing: -.015em; margin-bottom: 12px; }

.lp-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 56px;
  margin-top: 64px;
}
.lp-three p { margin: 0; }

/* Definition lists carry most of the detail: term in ink, text softer. */
.lp-defs { margin: 32px 0 0; }
.lp-defs dt { font-weight: 620; color: var(--ink); }
.lp-defs dd { margin: 4px 0 22px; color: var(--ink-soft); font-size: 16px; }
.lp-defs dd:last-child { margin-bottom: 0; }
.lp-defs-two { margin: 0; columns: 2; column-gap: 56px; }
.lp-defs-two dt { break-after: avoid; }
.lp-defs-two dd { break-before: avoid; break-inside: avoid; }

.lp-point + .lp-point { margin-top: 44px; }
.lp-point p { margin: 0; }

/* -------------------------------------------- authorisation field ---- */

/* The brand navy in both themes: dark mode's accent is a light blue, which
   is right for links and far too loud as a whole band. */
.lp-field {
  --on-field: #ffffff;
  background: #3a4d8f;
  color: var(--on-field);
  padding: 112px 0;
}
.lp-field-in {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 32px 72px;
  align-items: start;
}
.lp-field h2 { color: var(--on-field); max-width: 16ch; }
.lp-field p {
  color: color-mix(in srgb, var(--on-field) 84%, #3a4d8f) !important;
  font-size: 1.1rem;
}
.lp-field p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------- steps ---- */

.lp-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 48px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
.lp-steps p { margin: 0; font-size: 16px; }

.lp-shot { margin: 88px 0 0; }
.lp-shot > img {
  box-sizing: border-box;
  border-radius: 4px;
}
.lp-shot-wide {
  background: var(--surface-2);
  padding: 48px;
  border-radius: 8px;
}
.lp-shot-wide > img { max-width: 920px; margin: 0 auto; }
.lp-shot-wide figcaption { text-align: center; margin-top: 20px; }

/* --------------------------------------------------- example finding --- */

.lp-finding-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 72px;
  align-items: center;
}
.lp-finding-grid .lp-statement { margin-top: 24px; }
.lp-finding-fig { margin: 0; min-width: 0; }
.lp-finding { font-size: 15px; margin: 0; box-shadow: none; }
.lp-finding dd { overflow-wrap: anywhere; }
.lp-finding-fig figcaption { margin-top: 14px; }

/* ----------------------------------------------------- sample reports --- */

.lp-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 48px;
  margin-top: 80px;
}
.lp-doc h3 { margin-top: 28px; font-size: 1.35rem; letter-spacing: -.015em; }
.lp-doc p { max-width: 34em; }
/* The two sample links line up, whichever description is longer. */
.lp-doc { display: flex; flex-direction: column; align-items: flex-start; }
.lp-doc > .lp-doc-page { align-self: stretch; }
.lp-doc > .lp-link { margin-top: auto; }
/* The first page of each sample, cut off by a fixed-height field. */
.lp-doc-page {
  display: block;
  height: 440px;
  overflow: hidden;
  background: var(--surface-2);
  padding: 44px 56px 0;
  border-radius: 8px;
}
.lp-doc-page img {
  border-radius: 3px 3px 0 0;
  transition: transform 420ms var(--lp-ease);
}
.lp-doc:hover .lp-doc-page img { transform: translateY(-10px); }

/* ------------------------------------------------------ why it matters -- */

.lp-close {
  margin: 88px 0 0 !important;
  font-size: clamp(1.4rem, 1.05rem + 1.1vw, 2rem) !important;
  line-height: 1.3 !important;
  letter-spacing: -.01em;
  font-weight: 560;
  max-width: 30ch !important;
}

/* ------------------------------------------------------------ pricing --- */

.lp-price-figure {
  margin: 0 0 8px !important;
  font-size: 1.35rem;
  font-weight: 560;
  color: var(--ink) !important;
  line-height: 1;
}
.lp-price-figure span {
  font-size: clamp(4rem, 2.6rem + 4.4vw, 6.5rem);
  font-weight: 650;
  letter-spacing: -.02em;
  margin-right: 6px;
}
.lp-price h3 { font-size: 1.2rem; margin: 24px 0 14px; }
.lp-price .lp-actions { margin-top: 32px; }
.lp-price .lp-small { margin: 18px 0 0; color: var(--ink-faint) !important; }

/* ------------------------------------------------------- closing CTA --- */

.lp-final { background: var(--ink); padding: var(--lp-space) 0; }
.lp-final h2 { color: var(--ground); max-width: 18ch; }
.lp-final p {
  color: color-mix(in srgb, var(--ground) 78%, var(--ink)) !important;
  max-width: 40em;
  margin-top: 28px;
  font-size: 1.1rem;
}
body.landing .lp-final .btn-primary { background: var(--ground); color: var(--ink); }
body.landing .lp-final .btn-primary:hover { background: var(--surface-2); }
.lp-final .lp-link { color: var(--ground); text-decoration-color: color-mix(in srgb, var(--ground) 40%, transparent); }
.lp-final .lp-link:hover { color: var(--ground); text-decoration-color: currentColor; }
.lp-final .lp-actions { margin-top: 40px; }

:where(body.landing main) h2 + p { margin-top: 24px; }

/* The shared footer, on this page's measure so its left edge lines up. */
body.landing .site-foot { margin-top: 0; font-size: 14.5px; }
body.landing .site-foot-in,
body.landing .site-foot-base {
  max-width: var(--lp-max);
  padding-left: var(--lp-gutter);
  padding-right: var(--lp-gutter);
}
body.landing .site-foot-in { padding-top: 56px; padding-bottom: 32px; }
body.landing .site-foot-base { font-size: 13.5px; padding-bottom: 32px; }

/* ------------------------------------------------- pricing: three plans --- */

.lp-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 64px;
}
.lp-tier {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 8px;
  padding: 36px 32px 32px;
  min-width: 0;
}
.lp-tier.is-featured { background: var(--accent-soft); }
.lp-tier h3 { font-size: 1.35rem; margin: 0; }
.lp-tier-for { margin: 6px 0 24px !important; color: var(--ink-soft); font-size: 15.5px; }
.lp-tier .lp-price-figure span { font-size: clamp(3rem, 2.2rem + 2.4vw, 4.25rem); }
.lp-tier-list { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 10px; flex: 1; align-content: start; }
.lp-tier-list li { color: var(--ink-soft); font-size: 16px; padding-left: 22px; position: relative; }
.lp-tier-list li::before {
  content: ""; position: absolute; left: 2px; top: .55em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.lp-tier .btn-primary, .lp-tier-btn { align-self: flex-start; padding: 10px 18px; font-size: 15.5px; }
.lp-tier-btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px; text-decoration: none;
  font-weight: 560; font-size: 15.5px; color: var(--accent-ink); background: var(--surface-2);
}
.lp-tier-btn:hover { background: var(--accent-soft); }
.lp-tier-note { margin: 40px 0 0; max-width: 72ch; color: var(--ink-soft); font-size: 15.5px; }

@media (max-width: 1040px) {
  .lp-tiers { grid-template-columns: 1fr; max-width: 560px; }
}

/* -------------------------------------------------------- responsive --- */

@media (max-width: 1040px) {
  :root { --lp-space: 104px; }
  .lp-hero { grid-template-columns: 1fr; gap: 64px; padding-top: 64px; }
  .lp-hero-media { max-width: 600px; }
  .lp-split, .lp-field-in, .lp-finding-grid { grid-template-columns: 1fr; }
  .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :where(body.landing) h2 { max-width: 24ch; }
}

@media (max-width: 860px) {
  .lp-nav { display: none; }
}

@media (max-width: 760px) {
  :root { --lp-gutter: 20px; --lp-space: 80px; }
  body.landing { font-size: 16px; }
  .lp-columns, .lp-three, .lp-docs { grid-template-columns: 1fr; }
  .lp-columns { margin-top: 56px; }
  .lp-defs-two { columns: 1; }
  .lp-field { padding: 80px 0; }
  .lp-shot { margin-top: 56px; }
  .lp-shot-wide { padding: 20px; }
  .lp-doc-page { height: 380px; padding: 32px 36px 0; }
  .lp-close { margin-top: 56px !important; }
}

@media (max-width: 520px) {
  :root { --lp-gutter: 18px; --lp-space: 64px; }
  .lp-steps { grid-template-columns: 1fr; gap: 32px; }
  .lp-hero { padding-top: 40px; gap: 48px; }
  .lp-media-field { padding: 24px 24px 0; }
  .lp-head-in { gap: 12px; height: 64px; }
  .lp-head.is-compact .lp-head-in { height: 56px; }
  .lp-head-cta { gap: 14px; }
  body.landing .lp-head .btn-primary { padding: 8px 13px; font-size: 14px; }
  .landing-login { font-size: 14px; }
  body.landing .brand-label { display: inline; font-size: 16px; }
  .lp-actions { gap: 18px 24px; }
  .lp-doc-page { height: 320px; padding: 24px 28px 0; }
}

@media (max-width: 380px) {
  .lp-btn-lg { width: 100%; text-align: center; }
}

/* --------------------------------------------------- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal,
  html.js-reveal .reveal.is-in,
  html.js-reveal .stagger > *,
  html.js-reveal .stagger.is-in > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .lp-head, .lp-head-in, .lp-doc-page img { transition: none !important; }
  .lp-doc:hover .lp-doc-page img { transform: none; }
}

/* ---- QA fixes: auth-public ---- */
/* The two sample links sit on one line whatever the copy above them runs to. */
.lp-doc { display: flex; flex-direction: column; }
.lp-doc .lp-link { margin-top: auto; padding-top: 16px; align-self: flex-start; }

/* The price, one line under the first button. */
.lp-hero-price { margin: 14px 0 0 !important; font-size: 15px; color: var(--ink-soft); }
/* The portal screenshot is wider than the report pages, and a real screen: no white page edge. */
.lp-shot-portal > img { max-width: 1040px; border-radius: 8px; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(0,0,0,.35); }
