/* ============================================================
   Kvick landing page
   Plain CSS, no build step. Tokens below are lifted from the Figma
   landing frames (node 480:1246, 1728px wide) and from the app's own
   kvick/DesignTokens.swift — NOT from CLAUDE.md, whose panel colour
   value is stale.

   All px values in comments are at the 1728px design width.
   Divide by 17.28 to get vw.
   ============================================================ */

/* ---------- Fonts (self-hosted; zero third-party requests) ---------- */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/InstrumentSerif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/InstrumentSerif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Sans is variable (400-700) — one file covers every weight used here. */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/InstrumentSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/InstrumentSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope 500 is the app's own UI face. Used ONLY inside the panel mock so the
   illustration matches the real product UI. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  /* Colour — the whole page is two colours: black on lavender. */
  --lav: #becfff;              /* page background; bit-identical to the app accent */
  --lav-0: rgba(190, 207, 255, 0);
  --surface: #ccd9fe;          /* raised card tint, ~white 18% over the lavender */
  --ink: #000;
  --white: #fff;

  /* Panel-mock surfaces, mirrored from kvick/DesignTokens.swift */
  --panel-base: #3c3c42;
  --panel-overlay-start: rgba(0, 0, 0, 0.34);
  --panel-overlay-end: rgba(0, 0, 0, 0.26);
  --panel-border: rgba(255, 255, 255, 0.35);
  --panel-divider: rgba(255, 255, 255, 0.18);
  --panel-text: #fff;
  --panel-text-dim: rgba(255, 255, 255, 0.68);
  --panel-chip: rgba(255, 255, 255, 0.12);
  --accent: #becfff;

  /* Type scale — 1728px design values on the right of each clamp. */
  --fs-display: clamp(2.6rem, 8.68vw, 150px);   /* 150 */
  --fs-lead: clamp(1.15rem, 2.31vw, 40px);      /*  40 */
  --fs-h2: clamp(1.6rem, 3.7vw, 64px);          /*  64 */
  --fs-body-lg: clamp(1.05rem, 2.08vw, 36px);   /*  36 */
  --fs-body: clamp(0.95rem, 1.28vw, 22px);      /*  22 */
  --fs-caption: clamp(0.8rem, 0.93vw, 16px);    /*  16 */

  /* Layout */
  --maxw: 1728px;
  --gutter: clamp(20px, 7.23vw, 125px);         /* 125 */
  --section-y: clamp(56px, 9vw, 160px);
  --radius: 16px;                                /* app cornerRadius */
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--lav);
  color: var(--ink);
  font-family: 'Instrument Sans', 'Manrope', -apple-system, BlinkMacSystemFont,
    'Helvetica Neue', Arial, sans-serif;
  font-variation-settings: 'wdth' 100;
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; }
img, video { display: block; height: auto; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  padding: 0.7em 1.2em;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0 0 12px 12px;
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ---------- Shared layout ---------- */

.section {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--section-y);
}

.section__title {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.2;
  max-width: 20ch;          /* Figma block width 800/1728 */
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ============================================================
   Ticker
   Figma: y=40px, 40px Instrument Sans 500, one continuous string
   bleeding off both edges, items separated by four spaces.
   ============================================================ */

.ticker {
  position: relative;
  overflow: hidden;
  padding-block: clamp(18px, 2.3vw, 40px) 0;
  /* the ticker is decorative; keep it out of the tab order entirely */
  user-select: none;
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 58s linear infinite;
}

.ticker__group {
  display: flex;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--fs-lead);
  line-height: 1.2;
}

.ticker__group span { padding-inline-end: 4ch; }  /* the designed four-space separator */

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Designed fade: 143px, #BECFFF 0% -> #BECFFF 28.908% -> transparent 86.364%.
   The rgba() zero-alpha form is required — `transparent` interpolates through
   grey in older Safari/Chrome. */
.ticker::before,
.ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(48px, 8.3vw, 143px);
  pointer-events: none;
  z-index: 1;
}
.ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--lav) 0%, var(--lav) 28.908%, var(--lav-0) 86.364%);
}
.ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--lav) 0%, var(--lav) 28.908%, var(--lav-0) 86.364%);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  /* Figma: ticker text sits at y=40 (48px line box, so the ticker block ends at 88)
     and the H1 layer top is y=148 — a 60px gap. 60/1728 = 3.47vw. */
  padding-block: clamp(20px, 3.47vw, 60px) clamp(56px, 9vw, 150px);
}

.hero__title {
  font-family: 'Instrument Serif', 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 400;                 /* the family ships Regular + Italic only */
  font-size: var(--fs-display);
  line-height: 1.15;                /* measured advance 174/150 and 143/120 */
  letter-spacing: -0.005em;
  /* Figma block width is 1311px against a 150px face = 8.74em. The headline's line
     breaks are authored with <br>; this cap only stops the block from running wider
     than the design. Because the face scales with the viewport, a line that fits at
     one width fits at all of them until the clamp floor kicks in on phones, where
     re-wrapping is what you want anyway. */
  max-width: 9.6em;
}

/* The wordmark is not a glyph and will not sit on the baseline by itself.
   The slot keeps the rotated art from inflating the line box. */
.wordmark-slot {
  display: inline-block;
  /* Advance the mark takes up in the line. Figma: "Make " ends and "jump" starts
     468px apart against a 150px face = 3.12em. */
  width: 3.05em;
  height: 0.8em;                    /* deliberately shorter than the art so the
                                       rotated mark cannot inflate the line box */
  position: relative;
  vertical-align: baseline;
}

.wordmark {
  position: absolute;
  left: 50%;
  /* Figma puts the art's centre ~0.12em above the baseline, so the mark dips into
     the line below — that overlap is intentional. */
  bottom: -0.3em;
  width: 2.86em;                    /* Figma art 429.3px against a 150px face */
  height: 1.174em;                  /* 176.1px — keeps the 2.437:1 aspect exactly */
  transform: translateX(-50%) rotate(-8.02deg);   /* as drawn in Figma */
  transform-origin: 50% 60%;
  overflow: visible;
}

/* Handwritten draw-on. pathLength="1" normalises every stroke so one rule does all. */
.wordmark path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.wordmark path:nth-child(1) { animation-delay: 0.42s; }
.wordmark path:nth-child(2) { animation-delay: 0.10s; }
.wordmark path:nth-child(3) { animation-delay: 0.58s; }
.wordmark path:nth-child(4) { animation-delay: 0.26s; }
.wordmark path:nth-child(5) { animation-delay: 0.00s; }
.wordmark path:nth-child(6) { animation-delay: 0.50s; }
.wordmark path:nth-child(7) { animation-delay: 0.34s; }
.wordmark__dot {
  opacity: 0;
  animation: dot 0.35s ease forwards 1.25s;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot  { to { opacity: 1; } }

/* Subhead + CTA tuck into the lower right. Figma: column starts at x=1027 (59.4%),
   width 508, top 695 — i.e. flush with the headline block's bottom edge.
   That asymmetry is the composition. Do not centre it. */
.hero__side {
  margin-left: auto;
  margin-top: 4px;                  /* Figma: subhead top 695 == headline bottom 691 */
  width: min(508px, 36%);
}

.hero__lead {
  font-size: var(--fs-lead);
  line-height: 1.25;
  font-weight: 500;
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(12px, 1.2vw, 20px);
  margin-top: clamp(24px, 2.4vw, 41px);
}

.cta-note {
  margin-top: clamp(12px, 1.1vw, 20px);
  font-size: var(--fs-caption);
  font-weight: 400;
  line-height: 1.4;
}

/* ---------- Buttons ---------- */
/* Figma pill: 310x73, radius 100, #000, Apple glyph 36px at x=30, label 24px
   Regular white at x=70. Label is left-set after the glyph with generous trailing
   space — it is not centred. */

.btn {
  display: inline-flex;
  align-items: center;
  /* 30 (lead pad) + 29 (glyph) + 11 (gap) = the designed 70px label origin. */
  gap: clamp(7px, 0.64vw, 11px);
  min-height: clamp(52px, 4.22vw, 73px);
  /* Trailing pad is the slack that lands the pill on the designed 310px. The design
     assumed a 170px label; Instrument Sans 400 at 24px actually measures ~200px, so
     the trailing space absorbs the difference rather than the label being squeezed. */
  padding-inline: clamp(20px, 1.74vw, 30px) clamp(20px, 2.31vw, 40px);
  border-radius: 999px;
  font-size: clamp(15px, 1.39vw, 24px);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--white);
}

/* No hover state is designed. Kept black, no new colour introduced. */
.btn--primary:hover { transform: translateY(-2px) scale(1.015); }
.btn--primary:active { transform: translateY(0) scale(0.99); }

.btn__glyph {
  /* The Figma glyph is 36px of *ink*, but the Apple path only inks 19.55/24 (81.5%)
     of its square viewBox. Reserving the full 36px pushed the label to x=83 instead of
     the designed x=70. 36 x 0.815 = 29 keeps the mark exactly the size it renders now
     while giving the label its designed origin. */
  width: clamp(18px, 1.68vw, 29px);
  height: auto;
  flex: 0 0 auto;
  /* Do NOT use the U+F8FF text glyph — it renders as tofu off Apple platforms. */
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  padding-inline: clamp(20px, 2vw, 34px);
}
.btn--ghost:hover { background: var(--ink); color: var(--lav); transform: translateY(-2px); }
.btn--ghost:active { transform: translateY(0) scale(0.99); }

/* ============================================================
   Demo
   ============================================================ */

.section--demo { padding-block-start: 0; }

.demo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  /* The eventual asset is a full-screen recording, so the box stays 16:9. Capping the
     width keeps the placeholder from becoming a huge empty field on wide displays —
     the video will letterbox into the same box with no layout shift. */
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 28px);
  padding: clamp(10px, 1.6vw, 28px);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--ink);
  /* dashed edge marks this as a placeholder, not a shipped frame */
  outline: 2px dashed var(--ink);
  outline-offset: 8px;
  overflow: hidden;
}

.demo-frame__todo {
  flex: 0 0 auto;
  padding: 0.45em 1em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: var(--fs-caption);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Describes the asset that replaces this box, so the placeholder is self-documenting. */
.demo-frame__note {
  flex: 0 0 auto;
  max-width: 42ch;
  text-align: center;
  font-size: var(--fs-caption);
  font-weight: 400;
  line-height: 1.45;
}

/* ---------- Static mock of the app panel (illustration, not a screenshot) ---------- */

.panel-mock {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  width: min(400px, 62%);
  padding: 14px 16px;                       /* app: vertical 14, horizontal 16 */
  border-radius: var(--radius);
  background:
    linear-gradient(var(--panel-overlay-start), var(--panel-overlay-end)),
    var(--panel-base);
  box-shadow: inset 0 0 0 1px var(--panel-border), 0 24px 60px rgba(0, 0, 0, 0.28);
  color: var(--panel-text);
  font-size: clamp(9px, 0.87vw, 15px);
  line-height: 1.36;
}

.panel-mock__row { display: flex; align-items: flex-start; gap: 10px; }
.panel-mock__icon { width: 1.9em; height: 1.9em; flex: 0 0 auto; }
.panel-mock__prompt { margin: 0.15em 0 0; }

.panel-mock__caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: var(--accent);
}

.panel-mock__divider {
  height: 1px;
  margin: 0.9em -16px;
  background: var(--panel-divider);
}

.panel-mock__answer { color: var(--panel-text); }

.panel-mock__footer {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin-top: 1.1em;
  color: var(--panel-text-dim);
  font-size: 0.86em;
}
.panel-mock__actions { display: flex; gap: 0.9em; }
.panel-mock__actions span {
  padding: 0.25em 0.6em;
  border-radius: 6px;
  background: var(--panel-chip);
}

/* ============================================================
   Feature tiles
   ============================================================ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(16px, 1.7vw, 30px);
}

.tile {
  padding: clamp(20px, 2.3vw, 40px);
  border-radius: var(--radius);
  background: var(--surface);
}

.tile__word {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 2.9vw, 50px);
  line-height: 1.1;
  margin-bottom: 0.35em;
}

.tile__line {
  font-size: var(--fs-body);
  font-weight: 500;
  text-wrap: pretty;
}

/* ============================================================
   Query examples
   ============================================================ */

.examples {
  margin-top: clamp(28px, 3vw, 56px);
  columns: 2;
  column-gap: clamp(24px, 4vw, 80px);
  font-size: var(--fs-body-lg);
  line-height: 1.333;                 /* the one explicit leading in the file: 48/36 */
}

.examples li {
  break-inside: avoid;
  padding-block: 0.18em;
}

@media (max-width: 700px) {
  .examples { columns: 1; }
}

/* ============================================================
   How it works
   ============================================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(24px, 3vw, 56px);
  margin-top: clamp(28px, 3vw, 56px);
}

.step { border-top: 2px solid var(--ink); padding-top: clamp(14px, 1.2vw, 22px); }

.step__num {
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.5rem, 2.2vw, 38px);
  line-height: 1;
  margin-bottom: 0.4em;
}

.step__title {
  font-size: clamp(1.15rem, 1.85vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.45em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3em;
}

kbd {
  font: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  padding: 0.18em 0.45em;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.step__line { font-size: var(--fs-body); text-wrap: pretty; }

/* ============================================================
   Honesty block
   ============================================================ */

.req {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(20px, 2.2vw, 40px);
  margin-top: clamp(28px, 3vw, 56px);
}

.req__item {
  padding: clamp(18px, 2vw, 34px);
  border-radius: var(--radius);
  background: var(--surface);
}

.req__title {
  font-size: clamp(1.05rem, 1.5vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5em;
}

.req__item p { font-size: var(--fs-body); text-wrap: pretty; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 2px solid var(--ink);
}

.footer__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--section-y);
}

.footer__title { max-width: 24ch; }

.footer__lead {
  margin-top: 0.5em;
  font-size: var(--fs-lead);
  line-height: 1.25;
  max-width: 28ch;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2vw, 36px);
  margin-top: clamp(32px, 3.5vw, 64px);
  font-size: var(--fs-body);
}
.footer__links a { text-underline-offset: 4px; }

.footer__fine {
  margin-top: clamp(16px, 1.6vw, 28px);
  max-width: 70ch;
  font-size: var(--fs-caption);
  font-weight: 400;
  line-height: 1.5;
}
.footer__fine code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
}

/* Placeholder CTAs. These are deliberately NOT links — the destination does not exist
   yet, and a dead <a href="#"> is focusable, reachable by keyboard and screen reader,
   and silently does nothing. They are inert <span>s carrying a visible TODO, dashed so
   a stale one cannot survive a review. Restore the real <a href="..."> per TODO. */
.is-todo {
  border: 2px dashed currentColor;
  box-shadow: none;
  opacity: 0.85;
  cursor: not-allowed;
}
.is-todo:hover, .is-todo:active { transform: none; background: transparent; color: inherit; }
.btn--primary.is-todo { background: var(--ink); color: var(--white); }

/* ============================================================
   Narrow screens
   ============================================================ */

/* Below ~560px the 16:9 box is shorter than the placeholder content inside it, and
   `overflow: hidden` shears the TODO pill off the top. Release the ratio and let the
   box grow. Re-check this once the real <video> replaces the placeholder — the pill
   and the note go away then, and the ratio can be restored unconditionally. */
@media (max-width: 560px) {
  .demo-frame { aspect-ratio: auto; }
}

@media (max-width: 900px) {
  .hero__side {
    width: 100%;
    margin-left: 0;
    margin-top: clamp(24px, 5vw, 40px);
  }
  .hero__title { max-width: none; }
  .btn { padding-inline: 22px 28px; }
}

@media (max-width: 420px) {
  .cta-row { display: grid; grid-template-columns: 1fr; }
  .btn { justify-content: center; padding-inline: 20px; }
  .panel-mock { width: 88%; }
}

/* ============================================================
   Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker__track { animation: none; }
  .wordmark path { animation: none; stroke-dashoffset: 0; }
  .wordmark__dot { animation: none; opacity: 1; }
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  .ticker, .demo-frame { display: none; }
  body { background: #fff; }
}
