/* ============================================================
   Kip — liquid glass on white, AI-focus-companion startup site.
   Screen stylesheet. Print rules live in print.css, loaded with
   media="print" — see PROJECT_1.md hard rule #2 for why they must
   never be merged back into this file.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* ---------- Tokens ----------
   Light is the default here, and the dark theme below is authored
   separately rather than being an inversion of it. */
:root {
  --ground: #f1f3f7;
  --ground-2: #e8ebf2;
  --surface-1: hsla(240, 6%, 10%, 0.03);
  --surface-2: hsla(240, 6%, 10%, 0.05);
  --surface-3: hsla(240, 6%, 10%, 0.08);
  --ink: #1d1d1f;
  --ink-muted: #4b4b52;
  --ink-dim: #6b6b73;
  --hairline: hsla(240, 6%, 10%, 0.12);
  --hairline-bright: hsla(0, 0%, 100%, 0.9);
  /* The interactive colour is the ink itself. Blue is reserved for
     links and focus so the page stays essentially monochrome. */
  --accent: #1d1d1f;
  --accent-hover: #000000;
  --accent-ink: #ffffff;
  --accent-soft: hsla(240, 6%, 10%, 0.06);
  --link: #0057d9;
  --success: #146b38;

  /* liquid glass — frosted white over a light ground, the way Apple
     uses it. Deeper tier = more blur + more fill + brighter edge, so
     bigger surfaces read as physically thicker glass. */
  --glass-1-fill: hsla(0, 0%, 100%, 0.50);
  --glass-1-blur: 18px;
  --glass-2-fill: hsla(0, 0%, 100%, 0.62);
  --glass-2-blur: 24px;
  --glass-3-fill: hsla(0, 0%, 100%, 0.72);
  --glass-3-blur: 32px;
  --glass-4-fill: hsla(0, 0%, 100%, 0.80);
  --glass-4-blur: 40px;

  /* the lit top edge and the faint inner floor are what make a frosted
     panel read as a physical slab rather than a pale rectangle */
  --glass-edge: inset 0 1px 0 hsla(0, 0%, 100%, 0.95),
                inset 0 -1px 0 hsla(240, 10%, 40%, 0.06);

  /* Layered, tight-then-wide: a glass panel needs a contact shadow AND a
     soft ambient one, or it reads as a flat rectangle drawn on the page. */
  --shadow-sm: 0 1px 2px hsla(240, 8%, 10%, 0.05), 0 3px 10px -3px hsla(240, 8%, 10%, 0.07);
  --shadow-md: 0 1px 2px hsla(240, 8%, 10%, 0.05), 0 14px 32px -10px hsla(240, 8%, 10%, 0.16);
  --shadow-lg: 0 2px 4px hsla(240, 8%, 10%, 0.06), 0 30px 60px -18px hsla(240, 8%, 10%, 0.22);

  --font-display: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Albert Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-section: clamp(4.5rem, 9vw, 7.5rem);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #000000;
  --ground-2: #101012;
  --surface-1: hsla(0, 0%, 100%, 0.05);
  --surface-2: hsla(0, 0%, 100%, 0.08);
  --surface-3: hsla(0, 0%, 100%, 0.12);
  --ink: #f5f5f7;
  --ink-muted: #c4c4c8;
  --ink-dim: #86868b;
  --hairline: hsla(0, 0%, 100%, 0.14);
  --hairline-bright: hsla(0, 0%, 100%, 0.26);
  --accent: #f5f5f7;
  --accent-hover: #ffffff;
  --accent-ink: #0a0a0b;
  --accent-soft: hsla(0, 0%, 100%, 0.10);
  --link: #4d9bff;
  --success: #3ddc84;

  --glass-1-fill: hsla(0, 0%, 100%, 0.05);
  --glass-2-fill: hsla(0, 0%, 100%, 0.08);
  --glass-3-fill: hsla(0, 0%, 100%, 0.12);
  --glass-4-fill: hsla(0, 0%, 100%, 0.16);

  --glass-edge: inset 0 1px 0 hsla(0, 0%, 100%, 0.16),
                inset 0 -1px 0 hsla(0, 0%, 0%, 0.35);
  --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.5), 0 3px 12px -3px hsla(0, 0%, 0%, 0.6);
  --shadow-md: 0 1px 2px hsla(0, 0%, 0%, 0.5), 0 16px 36px -10px hsla(0, 0%, 0%, 0.72);
  --shadow-lg: 0 2px 6px hsla(0, 0%, 0%, 0.55), 0 34px 64px -18px hsla(0, 0%, 0%, 0.8);

  color-scheme: dark;
}

@media (prefers-contrast: more) {
  .glass, .glass--1, .glass--2, .glass--3, .glass--4, .card, .price-card { outline: 1px solid var(--hairline); outline-offset: -1px; }
  :root { --hairline: hsla(240, 6%, 10%, 0.45); }
  :root[data-theme="dark"] { --hairline: hsla(0, 0%, 100%, 0.5); }
}

html, body { background: var(--ground); color: var(--ink); }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100dvh;
}
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.container {
  width: min(1200px, 100% - 3rem);
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(2.75rem, 3.2rem + 2.5vw, 5.25rem); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 1.6rem + 2vw, 3.25rem); line-height: 1.04; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem); line-height: 1.32; letter-spacing: -0.01em; }
p { color: var(--ink-muted); }
p.lead { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-muted); max-width: 46ch; }

/* ---------- Skip link + scroll progress ---------- */
.skip-link {
  position: absolute; top: -100%; left: var(--space-md);
  background: var(--accent); color: var(--accent-ink);
  padding: 0.75em 1.25em; border-radius: var(--radius-sm);
  z-index: 1000; transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: var(--space-md); }

.scroll-line {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 900; transform-origin: left;
}

/* ---------- Ambient warmth field (CSS only, no JS dependency) ---------- */
/* Stays behind everything through DOM order alone (it's body's first
   child) - a negative z-index here paints below the html/body canvas
   background in this engine instead of above it, hiding it entirely. */
.field { position: fixed; inset: 0; overflow: clip; pointer-events: none; }
.field span {
  position: absolute; border-radius: 50%; filter: blur(90px);
}
/* Barely-there washes. Their only job is to give the frosted surfaces
   something to refract, so they stay neutral and never read as colour. */
.field .f1 { width: 48vw; height: 48vw; background: #bccbe6; top: -16vw; right: -14vw; opacity: 0.55; }
.field .f2 { width: 38vw; height: 38vw; background: #e9e0d4; bottom: -12vw; left: -12vw; opacity: 0.5; }
.field .f3 { width: 30vw; height: 30vw; max-width: 480px; max-height: 480px; background: #d2dbec; top: 42vh; right: -6vw; opacity: 0.45; }
[data-theme="dark"] .field .f1 { background: #2b3550; opacity: 0.55; }
[data-theme="dark"] .field .f2 { background: #2e2a26; opacity: 0.5; }
[data-theme="dark"] .field .f3 { background: #23293a; opacity: 0.45; }


/* ---------- Glass surfaces ---------- */
.glass {
  position: relative;
  background: var(--glass-2-fill);
  -webkit-backdrop-filter: blur(var(--glass-2-blur)) saturate(112%);
  backdrop-filter: blur(var(--glass-2-blur)) saturate(112%);
  border: 0;
  box-shadow: var(--glass-edge);
}
.glass--1 { background: var(--glass-1-fill); backdrop-filter: blur(var(--glass-1-blur)) saturate(108%); -webkit-backdrop-filter: blur(var(--glass-1-blur)) saturate(108%); box-shadow: var(--glass-edge); }
.glass--2 { background: var(--glass-2-fill); backdrop-filter: blur(var(--glass-2-blur)) saturate(112%); -webkit-backdrop-filter: blur(var(--glass-2-blur)) saturate(112%); border: 0; box-shadow: var(--glass-edge); }
.glass--3 { background: var(--glass-3-fill); backdrop-filter: blur(var(--glass-3-blur)) saturate(115%); -webkit-backdrop-filter: blur(var(--glass-3-blur)) saturate(115%); box-shadow: var(--glass-edge); }
.glass--4 { background: var(--glass-4-fill); backdrop-filter: blur(var(--glass-4-blur)) saturate(118%); -webkit-backdrop-filter: blur(var(--glass-4-blur)) saturate(118%); box-shadow: var(--glass-edge); }

@media (prefers-reduced-transparency: reduce) {
  .glass, .glass--1, .glass--3, .glass--4 {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--ground-2);
  }
}

/* ---------- Nav ---------- */
.nav {
  box-shadow: var(--glass-edge), var(--shadow-md);
  position: fixed; top: var(--space-md); left: 50%; transform: translateX(-50%);
  z-index: 800; display: flex; align-items: center; gap: var(--space-lg);
  padding: 0.6rem 0.6rem 0.6rem 1.1rem; border-radius: var(--radius-pill);
  width: min(920px, calc(100% - 2rem));
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.brand svg { color: var(--accent); }
.nav-links { display: none; gap: var(--space-lg); font-size: 0.9375rem; flex: 1; justify-content: center; }
.nav-links a { color: var(--ink-muted); transition: color 150ms var(--ease-out); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a { position: relative; }
  .nav-links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform 200ms var(--ease-out);
  }
  .nav-links a:hover::after { transform: scaleX(1); }
}
@media (min-width: 860px) { .nav-links { display: flex; } }
.nav-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-muted); transition: transform 120ms var(--ease-out), color 150ms var(--ease-out), background 150ms var(--ease-out);
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); transition-duration: 90ms; }
.icon-btn svg { pointer-events: none; }

/* ---------- Buttons — liquid glass, Apple-press feel ----------
   Feedback fires on pointerdown (apple-design §1), transform/opacity
   only, critically-damped 120ms scale (animate skill: button press
   100-160ms). The specular highlight is a radial-gradient positioned
   by --mx/--my, updated on pointermove in main.js — that is the
   "liquid" reacting to the cursor, and it is the one part of this
   button that is decorative, so it is skipped under reduced motion. */
.btn {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85em 1.5em; border-radius: var(--radius-pill);
  font-size: 0.9375rem; font-weight: 600; white-space: nowrap;
  transition: transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.96); transition-duration: 90ms; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
/* the specular that follows the pointer across the solid pill, so the
   primary action reads as polished glass rather than flat fill */
.btn--primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(120px 120px at var(--mx) var(--my), hsla(0,0%,100%,0.28), transparent 68%);
  transition: opacity 200ms var(--ease-out);
}
[data-theme="dark"] .btn--primary::before { background: radial-gradient(120px 120px at var(--mx) var(--my), hsla(0,0%,0%,0.22), transparent 68%); }
@media (hover: hover) and (pointer: fine) { .btn--primary:hover::before { opacity: 1; } }
.btn--glass { color: var(--ink); background: var(--glass-3-fill); backdrop-filter: blur(var(--glass-3-blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--glass-3-blur)) saturate(160%); border: 0; box-shadow: var(--glass-edge); }
.btn--glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(120px 120px at var(--mx) var(--my), hsla(0,0%,100%,0.35), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn--glass:hover::before { opacity: 1; }
}
.btn--ghost { color: var(--ink-muted); padding-inline: 0.25em; }
.btn--ghost:hover { color: var(--ink); }

/* The flashy one: accent-tinted liquid glass, its own material rather
   than primary+glass stacked (equal-specificity classes fight over
   background — this is the single source of truth for it). */
.btn--liquid {
  color: var(--ink);
  border: 0;
  background: var(--glass-4-fill);
  backdrop-filter: blur(var(--glass-4-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-4-blur)) saturate(180%);
  box-shadow: var(--glass-edge), 0 1px 2px hsla(240, 6%, 10%, 0.06), 0 8px 24px -14px hsla(240, 6%, 10%, 0.4);
}
.btn--liquid::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background: radial-gradient(140px 140px at var(--mx) var(--my), hsla(0,0%,100%,0.95), transparent 70%);
  transition: opacity 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn--liquid:hover::before { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn { transition: opacity 150ms ease; }
  .btn:active, .icon-btn:active { transform: none; }
}

/* ---------- Mobile sheet ---------- */
.sheet {
  box-shadow: var(--glass-edge), var(--shadow-lg);
  position: fixed; inset: 5rem 1rem auto 1rem; z-index: 790;
  border-radius: var(--radius-lg); padding: var(--space-lg);
  transform: translateY(-12px) scale(0.98); opacity: 0; pointer-events: none;
  transition: transform 220ms var(--ease-out), opacity 200ms var(--ease-out);
}
.sheet[data-open] { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.sheet ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.sheet a { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.36; padding-block: 0.3em; }
.sheet span { font-family: var(--font-mono); color: var(--ink-dim); font-size: 0.9rem; align-self: center; }
@media (min-width: 860px) { .menu-btn { display: none; } }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(7rem, 12vw, 9rem);
  padding-bottom: var(--space-section);
  display: grid; gap: var(--space-2xl);
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.05fr minmax(0, 1fr); align-items: center; }
}
.hero-copy { display: flex; flex-direction: column; gap: var(--space-md); align-items: flex-start; }
.hero-copy .lead { margin-top: -0.5rem; }
.hero-actions { display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; margin-top: var(--space-sm); }
.hero-note { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-dim); }

/* Deliberately NOT a panel: no fill, no border, no shadow, no clipping.
   A tinted box behind him never matched the page ground in both themes,
   and `overflow: hidden` sliced his hand off every time he waved. */
.hero-stage {
  position: relative; aspect-ratio: 1 / 1;
  display: grid; place-items: center; overflow: visible;
  background: none; border: 0; box-shadow: none;
}
/* The shot is cropped at the thigh, so the bottom edge is faded rather
   than cut, which reads as a deliberate portrait crop. */
.hero-stage canvas,
.hero-stage .kip-fallback {
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 99%);
}
.hero-stage canvas { width: 100%; height: 100%; touch-action: none; }
.hero-stage .kip-fallback { width: 100%; height: 100%; object-fit: contain; }
.hero-stage[data-kip-ready] .kip-fallback { display: none; }
.hero-stage:not([data-kip-ready]) canvas { display: none; }


/* ---------- Sections ---------- */
section { padding-block: var(--space-section); }
.section-head { display: flex; flex-direction: column; gap: var(--space-sm); max-width: 40rem; margin-bottom: var(--space-xl); }

/* Proof strip — one honest stat, real value in the markup, JS only
   animates the count-up (see main.js): a blocked script never shows 0. */
.proof {
  display: grid; gap: var(--space-lg); text-align: center; padding-block: var(--space-lg);
  border-block: 1px solid var(--hairline);
}
@media (min-width: 700px) { .proof { grid-template-columns: repeat(3, 1fr); } }
.proof-figure { font-family: var(--font-display); font-size: clamp(2rem, 1.6rem + 2vw, 3rem); font-weight: 600; letter-spacing: -0.02em; }
.proof-figure span { color: var(--accent); }
.proof-label { font-size: 0.9rem; color: var(--ink-dim); }

/* Features — nested, weighted bento. Deliberately unequal cells so
   it reads as an authored composition, not a 3-up icon row. */
.bento { display: grid; gap: var(--space-md); }
@media (min-width: 760px) {
  .bento {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(180px, auto);
  }
  .bento .card--lg { grid-column: span 4; grid-row: span 2; }
  .bento .card--sm { grid-column: span 2; }
  .bento .card--wide { grid-column: span 3; }
}
.card {
  box-shadow: var(--glass-edge), var(--shadow-md);
  position: relative; border-radius: var(--radius-lg); padding: var(--space-lg);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.6rem;
  transition: transform 260ms var(--ease-out);
}
.card h3 { font-size: 1.25rem; }
.card p { font-size: 0.95rem; }
.card-icon { color: var(--accent); margin-bottom: auto; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--glass-edge), var(--shadow-lg); }
}
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }

/* How it works — vertical flow, not an equal icon row */
.flow { display: grid; gap: 0; position: relative; max-width: 42rem; }
.flow::before {
  content: ""; position: absolute; left: 19px; top: 12px; bottom: 12px; width: 1px;
  background: linear-gradient(var(--hairline-strong, var(--hairline)), transparent);
}
.flow-step { display: grid; grid-template-columns: 40px 1fr; gap: var(--space-md); padding-block: var(--space-md); }
.flow-num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent);
  background: var(--surface-2); border: 1px solid var(--hairline); z-index: 1;
}

/* Showcase — device-glass frame around an original stylized UI mock */
.showcase-frame {
  box-shadow: var(--glass-edge), var(--shadow-lg);
  border-radius: var(--radius-lg); padding: var(--space-sm);
}
.showcase-frame .chrome { display: flex; gap: 6px; padding: 0.5rem 0.75rem 1rem; }
.showcase-frame .chrome span { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.mock-ui { border-radius: var(--radius-md); background: var(--ground-2); padding: var(--space-lg); display: grid; gap: 0.75rem; }
.mock-row { height: 12px; border-radius: 6px; background: var(--surface-2); }
.mock-row.w-60 { width: 60%; } .mock-row.w-80 { width: 80%; } .mock-row.w-40 { width: 40%; }
.mock-bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 0.5rem; }
.mock-bars span { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent-soft); }
.mock-bars span:nth-child(3n) { background: var(--accent); }

/* Pricing */
.pricing-grid { display: grid; gap: var(--space-md); }
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { box-shadow: var(--glass-edge), var(--shadow-md); border-radius: var(--radius-lg); padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-sm); }
.price-card--featured { box-shadow: var(--glass-edge), var(--shadow-lg); background: var(--glass-3-fill); backdrop-filter: blur(var(--glass-3-blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--glass-3-blur)) saturate(160%); }
.price-figure { font-family: var(--font-display); font-size: 2.75rem; font-weight: 600; letter-spacing: -0.02em; margin-block: 0.25rem; }
.price-figure sup { font-size: 1rem; font-weight: 500; color: var(--ink-dim); }
.price-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: var(--space-sm); }
.price-list li { display: flex; gap: 0.6rem; font-size: 0.9375rem; color: var(--ink-muted); }
.price-list svg { color: var(--success); flex-shrink: 0; margin-top: 0.15em; }

/* Testimonial spotlight — one, not a carousel */
.spotlight { box-shadow: var(--glass-edge), var(--shadow-md); border-radius: var(--radius-lg); padding: var(--space-2xl) var(--space-xl); text-align: center; }
.spotlight blockquote { font-family: var(--font-display); font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; max-width: 42rem; margin-inline: auto; }
.spotlight cite { display: block; margin-top: var(--space-md); font-style: normal; color: var(--ink-dim); font-size: 0.9375rem; }

/* Closing CTA — Kip peeking over the edge */
.cta-band { box-shadow: var(--glass-edge), var(--shadow-lg); position: relative; border-radius: var(--radius-lg); padding: var(--space-2xl) var(--space-xl); text-align: center; overflow: visible; }
.cta-peek { position: absolute; width: 84px; top: -42px; left: 50%; translate: -50% 0; }
@media (min-width: 700px) { .cta-peek { left: auto; right: 8%; translate: 0; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--hairline); padding-block: var(--space-2xl) var(--space-lg); }
.footer-grid { display: grid; gap: var(--space-xl); }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr repeat(3, 1fr); } }
.footer-grid h2 { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.45; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: var(--space-sm); }
.footer-grid ul { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.9375rem; color: var(--ink-muted); }
.footer-grid ul a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: 1px solid var(--hairline); font-size: 0.85rem; color: var(--ink-dim); }
.copy-email { display: inline-flex; align-items: center; gap: 0.4em; }
.copy-email svg { width: 14px; height: 14px; }

/* ---------- Reveal-on-scroll (progressive enhancement) ----------
   Elements start visible; JS adds .reveal only when IntersectionObserver
   exists, so a blocked script never leaves content hidden. */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Utility ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Page-specific components
   ============================================================ */

/* Mirrored hero — stage on the left (features) */
@media (min-width: 960px) {
  .hero--mirror { grid-template-columns: minmax(0, 1fr) 1.05fr; }
  .hero--mirror .hero-stage { order: -1; }
}

/* Centred hero with the stage above the copy (pricing) */
.hero--centred { text-align: center; justify-items: center; }
.hero--centred .hero-copy { align-items: center; }
.hero--centred .lead { margin-inline: auto; }
.hero--centred .hero-stage { width: min(360px, 70vw); aspect-ratio: 1 / 1; justify-self: center !important; margin-inline: auto; }
@media (min-width: 960px) { .hero--centred { grid-template-columns: 1fr; } }

/* Alternating detail rows (features) */
.row { display: grid; gap: var(--space-xl); align-items: center; padding-block: var(--space-xl); }
@media (min-width: 860px) {
  .row { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
  .row:nth-child(even) .row-media { order: -1; }
}
.row-copy { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
.row-media { box-shadow: var(--glass-edge), var(--shadow-md); border-radius: var(--radius-lg); padding: var(--space-lg); min-height: 260px; display: grid; align-content: center; gap: 0.6rem; }
.row-tag { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }

/* Spec table */
.spec-wrap { box-shadow: var(--glass-edge), var(--shadow-md); overflow-x: auto; border-radius: var(--radius-lg); padding: var(--space-sm); }
table.spec { width: 100%; border-collapse: collapse; font-size: 0.9375rem; min-width: 520px; }
table.spec caption { text-align: left; padding: var(--space-md) var(--space-md) var(--space-sm); color: var(--ink-dim); font-size: 0.875rem; }
table.spec th, table.spec td { text-align: left; padding: 0.85rem var(--space-md); border-bottom: 1px solid var(--hairline); }
table.spec thead th { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); font-weight: 400; }
table.spec tbody th { font-weight: 500; color: var(--ink); }
table.spec td { color: var(--ink-muted); }
table.spec tbody tr:last-child th, table.spec tbody tr:last-child td { border-bottom: 0; }
.tick { color: var(--success); }
.dash { color: var(--ink-dim); }

/* Billing toggle (pricing) */
.billing { box-shadow: var(--shadow-sm); display: inline-flex; gap: 0.25rem; padding: 0.3rem; border-radius: var(--radius-pill); margin-inline: auto; }
.billing button {
  padding: 0.5em 1.1em; border-radius: var(--radius-pill); font-size: 0.875rem; font-weight: 500;
  color: var(--ink-dim); transition: color 150ms var(--ease-out), background 200ms var(--ease-out);
}
.billing button[aria-pressed="true"] { background: var(--ground); color: var(--ink); box-shadow: 0 1px 3px hsla(240,6%,10%,0.12); }
[data-theme="dark"] .billing button[aria-pressed="true"] { background: var(--surface-3); }
.save-note { font-size: 0.8125rem; color: var(--success); margin-top: var(--space-xs); }

/* Timeline (about) */
.timeline { display: grid; gap: 0; max-width: 46rem; }
.timeline-row { display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--space-md); padding: var(--space-lg) var(--space-sm); border-top: 1px solid var(--hairline); }
.timeline-row:last-child { border-bottom: 1px solid var(--hairline); }
.timeline-year { font-family: var(--font-mono); font-size: 0.875rem; color: var(--ink-dim); padding-top: 0.2rem; }

/* Team (about) */
.team { display: grid; gap: var(--space-md); }
@media (min-width: 700px) { .team { grid-template-columns: repeat(3, 1fr); } }
.member { box-shadow: var(--glass-edge), var(--shadow-md); border-radius: var(--radius-lg); padding: var(--space-lg); display: flex; flex-direction: column; gap: 0.4rem; }
.monogram {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem;
  background: var(--surface-3); color: var(--ink); margin-bottom: var(--space-sm);
}
.member-role { font-size: 0.875rem; color: var(--ink-dim); }

/* Form (contact) */
.form-grid { display: grid; gap: var(--space-md); }
.field-row { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row label { font-size: 0.875rem; font-weight: 500; }
.field-row input, .field-row textarea, .field-row select {
  width: 100%; padding: 0.8em 1em; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--ground);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.field-row textarea { min-height: 130px; resize: vertical; }
.field-row input:focus-visible, .field-row textarea:focus-visible, .field-row select:focus-visible {
  outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent);
}
.field-row[data-invalid] input, .field-row[data-invalid] textarea { border-color: #c0392b; }
.field-error { font-size: 0.8125rem; color: #c0392b; min-height: 1.1em; }
.form-note { font-size: 0.8125rem; color: var(--ink-dim); }
.form-success {
  display: none; gap: 0.6rem; align-items: flex-start;
  padding: var(--space-md); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}
.form-success[data-shown] { display: flex; }
.btn[data-loading] { pointer-events: none; opacity: 0.75; }
.btn[data-loading] .btn-label::after {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em; margin-left: 0.5em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 700ms linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[data-loading] .btn-label::after { animation-duration: 2s; } }

/* Contact split */
.contact-split { display: grid; gap: var(--space-2xl); }
@media (min-width: 900px) { .contact-split { grid-template-columns: 1.1fr 0.9fr; } }
.contact-aside { display: flex; flex-direction: column; gap: var(--space-lg); }
.contact-aside dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.3rem; }
.contact-aside dd { margin: 0; color: var(--ink-muted); }

/* FAQ */
.faq { max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--hairline); padding: var(--space-md) var(--space-sm) calc(var(--space-md) + 0.25rem); }
.faq summary { padding-block: 0.15rem 0.35rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; list-style: none; display: flex; justify-content: space-between; gap: var(--space-md); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-dim); font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq p { margin-top: var(--space-sm); padding-bottom: 0.35rem; }


/* Per-page stage scale. Kip should not be the same size on every page. */
.hero-stage--sm { max-width: 300px; justify-self: end; }
.hero-stage--md { max-width: 460px; justify-self: end; }
.hero-stage--wide { aspect-ratio: 16 / 10; }
@media (max-width: 959px) { .hero-stage--sm, .hero-stage--md { justify-self: center; } }

/* ============================================================
   Liquid: the surfaces move, and light travels across them.
   Frosted panels alone read as static glass — what makes it feel
   fluid is (a) the wash behind drifting slowly so the blur is never
   the same twice, and (b) a specular that follows the pointer.
   ============================================================ */

/* (a) the wash drifts, so what you see through the glass keeps moving */
.field span { will-change: transform; }
.field .f1 { animation: drift-a 34s ease-in-out infinite alternate; }
.field .f2 { animation: drift-b 42s ease-in-out infinite alternate; }
.field .f3 { animation: drift-c 38s ease-in-out infinite alternate; }

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-9vw, 7vh, 0) scale(1.16); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.1); }
  100% { transform: translate3d(11vw, -6vh, 0) scale(0.94); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(0.96); }
  100% { transform: translate3d(-7vw, -9vh, 0) scale(1.2); }
}

/* (b) specular that tracks the pointer across each panel */
.liquid { position: relative; isolation: isolate; overflow: hidden; }
/* On a light ground a white glow is invisible — and physically wrong.
   Thick glass over a pale surface reads as a faint DARK lens where the
   material is deepest, with the bright specular confined to the rim.
   So light mode gets a travelling shadow, dark mode gets the glow. */
.liquid::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; opacity: 0;
  background:
    radial-gradient(300px 240px at var(--lx, 50%) var(--ly, 0%),
      hsla(232, 30%, 26%, 0.13), hsla(232, 26%, 32%, 0.06) 45%, transparent 72%);
  transition: opacity 420ms var(--ease-out);
}
.liquid[data-lit]::after { opacity: 1; }
[data-theme="dark"] .liquid::after {
  background:
    radial-gradient(260px 200px at var(--lx, 50%) var(--ly, 0%),
      hsla(0, 0%, 100%, 0.16), hsla(0, 0%, 100%, 0.05) 42%, transparent 68%);
}

/* the rim catches that light too, which is what sells it as a thick edge */
.liquid::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; border-radius: inherit;
  padding: 1px;
  background: radial-gradient(220px 180px at var(--lx, 50%) var(--ly, 0%),
    hsla(0, 0%, 100%, 1), hsla(214, 60%, 92%, 0.55) 45%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}
.liquid[data-lit]::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .field span { animation: none; }
  .liquid::after, .liquid::before { transition: none; }
}

/* Shown only when the template is opened from disk (see main.js). */
.file-note {
  grid-column: 1 / -1;
  margin-top: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--ground-2);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
}
.file-note strong { color: var(--ink); }
.file-note code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  color: var(--ink);
}
