/* Landing page. Colors and type come from the tokens in styles.css. */
body.landing { display: block; overflow-x: clip; }
.landing main { max-width: none; padding: 0; view-transition-name: none; }
.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.landing section { scroll-margin-top: 72px; }

.l-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.l-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.l-actions { display: flex; align-items: center; gap: 4px; }
.l-actions .primary { min-height: 40px; padding: 0 16px; font-size: .9rem; white-space: nowrap; }

.eyebrow { font-size: .88rem; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.l-h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.22; letter-spacing: -.01em; font-weight: 600; text-wrap: balance; }
.l-h2 { font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.5rem); line-height: 1.28; font-weight: 600; text-wrap: balance; }
.lead { font-size: clamp(1.02rem, .96rem + .35vw, 1.2rem); color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
.band { padding-block: clamp(64px, 10vw, 128px); }
.band-sunken { background: var(--sunken); }
.band-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.band-head .lead { margin-top: 12px; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 112px); }
.hero-grid { display: grid; gap: clamp(36px, 6vw, 72px); align-items: center; }
.hero .lead { margin-top: 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.secondary-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); text-decoration: none; font-weight: 500; transition: background-color 120ms; }
.hero-note { margin-top: 18px; font-size: .86rem; color: var(--ink-2); }

/* Product preview */
.mock {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 50px rgb(16 24 32 / .1);
  padding: clamp(16px, 2.4vw, 24px);
}
.mock-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock-label { display: block; font-size: .76rem; color: var(--ink-2); margin-bottom: 4px; }
.mock-input { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: .9rem; overflow-wrap: anywhere; }
.mock-result { margin-top: 12px; border-radius: 12px; padding: 16px; }
.mock-result.stop { background: var(--stop-bg); }
.mock-result.ok { background: var(--ok-bg); }
.mock-result.warn { background: var(--warn-bg); }
.mock-title { font-size: 1.28rem; font-weight: 600; line-height: 1.3; }
.mock-en { font-size: .78rem; font-weight: 500; }
.mock-pair { font-size: .86rem; font-weight: 500; margin-top: 8px; }
.mock-text { font-size: .86rem; margin-top: 4px; }
.mock-rule { margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); font-size: .84rem; }
.mock-rule strong { display: block; font-weight: 600; font-size: .78rem; }
.mock-list { display: grid; gap: 8px; margin-top: 12px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.mock-source { margin-top: 12px; font-size: .78rem; color: var(--ink-2); }
.mock-choices { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mock-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: .86rem; }
.mock-choice + .mock-choice { border-top: 1px solid var(--line); }
.mock-choice.on { background: var(--sunken); }

/* Y-line story */
.story { position: relative; height: 240vh; background: var(--sunken); }
.story-stick { position: sticky; top: 60px; min-height: calc(100dvh - 60px); display: grid; align-items: center; }
.story-grid { display: grid; gap: 20px; align-items: center; padding-block: 28px; }
.story-copy .lead { margin-top: 12px; }
.story-captions { position: relative; min-height: 8.5em; margin-top: 20px; }
.story-caption {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity 260ms, transform 260ms;
}
.story-caption.on { opacity: 1; transform: none; }
.story-caption strong { display: block; font-size: 1.08rem; font-weight: 600; }
.story-caption span { color: var(--ink-2); }
.yline { width: min(100%, 400px, 44dvh); margin-inline: auto; display: block; overflow: visible; }
.yline .track { fill: none; stroke: var(--line-strong); stroke-width: 10; stroke-linecap: round; opacity: .35; }
.yline .flow { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.yline .flow-a { stroke: var(--accent); stroke-dashoffset: calc(1 - var(--a, 0)); }
.yline .flow-b { stroke: var(--dot-purple); stroke-dashoffset: calc(1 - var(--b, 0)); }
.yline .flow-c { stroke: var(--stop); stroke-dashoffset: calc(1 - var(--c, 0)); }
.yline text { font-family: var(--font); font-size: 15px; font-weight: 500; fill: var(--ink); }
.yline .joint { fill: var(--surface); stroke: var(--ink-2); stroke-width: 3; }
.yline .mark { opacity: var(--m, 0); transition: opacity 200ms; }
.yline .mark circle { fill: var(--stop); opacity: .9; }

/* Reasons */
.cards { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card h3 { margin: 0 0 6px; font-size: 1.06rem; font-weight: 600; line-height: 1.4; }
.card p { color: var(--ink-2); font-size: .95rem; }
.card-num { display: block; font-size: .82rem; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

/* How it works */
.steps-grid { display: grid; gap: 40px; }
.step { padding-block: 8px; }
.step h3 { margin: 0 0 8px; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.55rem); font-weight: 600; line-height: 1.35; }
.step p { color: var(--ink-2); }
.step .mock { margin-top: 20px; }
.stage { display: none; }

/* Numbers */
.stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.stat-num { display: block; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { display: block; color: var(--ink-2); font-size: .94rem; margin-top: 6px; }

/* Rules and sources */
.rules { display: grid; gap: 0; border-top: 1px solid var(--line); }
.rule { display: grid; gap: 4px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.rule h3 { margin: 0; font-size: 1.04rem; font-weight: 600; }
.rule p { color: var(--ink-2); font-size: .95rem; }
.src-list { display: grid; gap: 10px; margin-top: 24px; }
.src-list li { padding-left: 16px; position: relative; font-size: .95rem; }
.src-list li::before { content: ''; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Closing */
.closing { padding-block: clamp(64px, 10vw, 120px); }
.closing-box { background: var(--accent); color: var(--accent-ink); border-radius: 22px; padding: clamp(28px, 6vw, 64px); }
.closing-box .lead { color: inherit; opacity: .92; margin-top: 12px; }
.closing-box .primary { background: var(--accent-ink); color: var(--accent); margin-top: 24px; }
.notice-box { margin-top: 20px; font-size: .9rem; color: var(--ink-2); max-width: 60em; }
.l-foot { border-top: 1px solid var(--line); padding-block: 24px 32px; font-size: .84rem; color: var(--ink-2); }
.l-foot a { color: inherit; text-underline-offset: 3px; }
.l-foot p + p { margin-top: 2px; }

/* Scroll reveal only hides content when the script is there to show it again */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 620ms cubic-bezier(.2, .8, .2, 1), transform 620ms cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.js .reveal.seen { opacity: 1; transform: none; }

@media (hover: hover) {
  .secondary-link:hover { background: var(--sunken); }
  .card { transition: transform 180ms, box-shadow 180ms; }
  .card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgb(16 24 32 / .08); }
}
@media (max-width: 640px) {
  .landing .foot { padding-bottom: 16px; }
  .mock-fields { grid-template-columns: 1fr; }
  .story { height: 220vh; }
  .story-stick { top: 60px; }
  .story-captions { min-height: 9.5em; }
  .yline { width: min(100%, 34dvh); }
  .l-actions .primary { padding: 0 12px; }
  .brand span { font-size: .94rem; }
}
@media (max-width: 360px) {
  .brand span { display: none; }
}
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rule { grid-template-columns: minmax(200px, 1fr) 2fr; gap: 24px; }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .story-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
  .yline { width: min(100%, 400px, 62dvh); }
  .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 72px; }
  .js .step .mock { display: none; }
  .js .step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .36; transition: opacity 240ms; }
  .js .step.on { opacity: 1; }
  .js .stage { display: block; position: sticky; top: 112px; align-self: start; height: 520px; }
  .stage .mock { position: absolute; inset: 0 0 auto; opacity: 0; transform: translateY(14px) scale(.985); transition: opacity 320ms, transform 320ms; }
  .stage .mock.on { opacity: 1; transform: none; }
}
/* Short screens, such as a phone held sideways, read as a normal page instead of pinning */
@media (max-height: 520px) {
  .story { height: auto; }
  .story-stick { position: static; min-height: 0; }
  .story-captions { min-height: 0; }
  .story-caption { position: static; opacity: 1; transform: none; margin-bottom: 12px; }
  .yline { --a: 1; --b: 1; --c: 1; --m: 1; width: min(100%, 300px); }
  .l-top { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; }
  .story-caption { transform: none; }
  .js .stage .mock { transform: none; }
  .card:hover { transform: none !important; }
}

.landing .brand span { white-space: nowrap; }
@media (max-width: 400px) {
  .landing .brand span { font-size: .88rem; }
  .l-actions .theme-btn { width: 40px; }
}

/* Project name sits at the very top of the Y-site section */
.story-stick { align-items: start; }
.story-inner { padding-block: clamp(20px, 3.5dvh, 40px) 20px; }
.story-head .eyebrow { margin: 4px 0 0; }
.story-grid { padding-block: clamp(10px, 2dvh, 24px) 0; align-items: start; }
.story-captions { margin-top: 0; }
.yline { width: min(100%, 400px, 52dvh); }
@media (max-width: 899px) {
  .story-captions { min-height: 7.5em; }
  .yline { width: min(100%, 300px, 36dvh); }
}
@media (min-width: 900px) {
  .story-grid { align-items: center; }
}
/* When a screen cannot fit the whole section, it scrolls as a normal page with the drawing complete */
.story.is-static { height: auto; }
.story.is-static .story-stick { position: static; min-height: 0; }
.story.is-static .story-captions { min-height: 0; }
.story.is-static .story-caption { position: static; opacity: 1; transform: none; margin-bottom: 12px; }
.story.is-static .yline { --a: 1; --b: 1; --c: 1; --m: 1; width: min(100%, 320px); }

/* Diagram first, then the explanation as a numbered sequence */
.story-head { text-align: center; }
.story-captions { counter-reset: story; margin-top: 16px; }
.story-caption { counter-increment: story; padding-left: 40px; }
.story-caption::before {
  content: counter(story);
  position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: .84rem; font-weight: 600;
}
.story.is-static .story-caption { position: relative; }
@media (min-width: 900px) {
  .story-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); }
  .story-captions { display: grid; gap: clamp(14px, 2.4dvh, 26px); min-height: 0; margin-top: 0; }
  .story-caption { position: relative; inset: auto; opacity: .38; transform: none; }
  .story-caption.on { opacity: 1; }
}

/* The Y-site section opens the page */
.story { background: var(--bg); }
.story-stick { align-items: center; position: sticky; }
.story-head { display: grid; justify-items: center; gap: 6px; }
.story-head .l-h1 { font-size: clamp(2rem, 1.1rem + 3.4vw, 3.5rem); line-height: 1.16; }
.story-tag { color: var(--ink-2); font-size: clamp(.96rem, .9rem + .35vw, 1.14rem); text-wrap: balance; }
.story-cta { margin-top: 10px; min-height: 44px; }
.story-inner { padding-block: clamp(12px, 2.4dvh, 32px); }
.story-grid { padding-top: clamp(12px, 3dvh, 36px); align-items: center; }
.yline { width: min(100%, 360px, 44dvh); }
.scroll-cue {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .84rem; color: var(--ink-2);
  transition: opacity 240ms;
  pointer-events: none;
}
.scroll-cue.gone, .story.is-static .scroll-cue { opacity: 0; }
.story.is-static .scroll-cue { display: none; }
.nb { display: inline-block; }
.hero { border-top: 1px solid var(--line); }
@media (max-width: 899px) {
  .yline { width: min(100%, 280px, 30dvh); }
  .story-captions { margin-top: 10px; min-height: 7em; }
}
@media (max-height: 760px) {
  .scroll-cue { display: none; }
  .story-cta { margin-top: 4px; min-height: 40px; }
}
@media (max-width: 420px) {
  .nb { display: inline; }
}

.keep { white-space: nowrap; }
.hero h2.l-h1 { font-size: clamp(1.7rem, 1.1rem + 2.1vw, 2.7rem); line-height: 1.28; }
