/* Kotea landing page. Values follow brand/tokens/tokens.css and BRAND.md. */
@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0b2233;
  --ink: #061e2f;
  --muted: #42586a;
  --canvas: #f5f8f6;
  --surface: #ffffff;
  --mint: #e7f7ef;
  --line: #d2d8d4;
  --green: #28cc79;
  --green-hover: #20b86b;
  --link: #087b45;
  --focus: #127441;
  --on-navy: #f0f4f7;
  --on-navy-muted: #cdd5dd;
  --shadow: 0 12px 36px #143b2c26;
  --gutter: clamp(16px, 4vw, 56px);
  --header: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.125rem/1.55 "Work Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }
img, canvas { display: block; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--surface); padding: 8px 12px; border-radius: 7px; }
.skip:focus { left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--green); color: var(--navy);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border-radius: 7px; transition: background-color 150ms ease;
}
.btn:hover { background: var(--green-hover); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: .9375rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--header); padding: 0 var(--gutter);
  transition: background-color 180ms ease;
}
.top.is-scrolled { background: color-mix(in srgb, var(--canvas) 94%, transparent); backdrop-filter: blur(8px); }
.top-logo { display: block; }
.top-logo img { height: 32px; width: auto; }
.top-nav { display: flex; align-items: center; gap: 28px; font-size: .9375rem; }
.top-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.top-nav a:not(.btn):hover { color: var(--link); }

/* Hero: the words sit in the photo's sky, the contours are drawn over it as vectors */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh; margin-top: calc(var(--header) * -1);
  padding: calc(var(--header) + clamp(16px, 4vh, 56px)) var(--gutter) 0;
  background: #dad3c1;
}
.hero-photo { position: absolute; inset: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: right bottom; }
.hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--navy); stroke-opacity: .34; stroke-width: .75; }
.hero-lines path { stroke-dasharray: 1; animation: draw 2.2s cubic-bezier(.3,.6,.2,1) both; animation-delay: calc(.25s + var(--i) * .12s); }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(3.25rem, 7.4vw, 9rem);
  font-weight: 600; line-height: 1; letter-spacing: -.045em; color: var(--navy);
}
.hero-lede { max-width: 42em; text-wrap: pretty; margin-top: clamp(12px, 2vh, 24px); font-size: clamp(1.0625rem, 1.3vw, 1.3125rem); line-height: 1.4; color: var(--navy); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: clamp(14px, 2.4vh, 28px); }
.status { color: var(--navy); font-size: .9375rem; }

/* The story: text stays put beside a stage that plays by scroll */
.flow {
  display: grid; grid-template-columns: minmax(320px, 5fr) 8fr;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(56px, 10vh, 120px) var(--gutter) clamp(40px, 8vh, 96px);
  background: var(--surface);
}
.flow h2 { font-size: clamp(2rem, 3.6vw, 3.5rem); font-weight: 600; line-height: 1.06; letter-spacing: -.035em; color: var(--navy); }
.step { min-height: 135vh; }
.step:last-of-type { min-height: 120vh; }
.step-inner { position: sticky; top: 38vh; padding-top: 12vh; opacity: .28; transition: opacity 260ms ease; }
.step.is-active .step-inner { opacity: 1; }
.step-name { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; color: var(--muted); }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--navy); font-size: .875rem; }
.step h3 { margin-top: 14px; font-size: clamp(1.5rem, 2.2vw, 2.125rem); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; color: var(--navy); }
.step-inner > p:last-child { margin-top: 14px; max-width: 30em; }

.stage {
  position: sticky; top: calc(var(--header) + 16px);
  height: calc(100svh - var(--header) - 32px); min-height: 460px;
  border-radius: 12px; overflow: hidden; isolation: isolate;
  background: var(--canvas); border: 1px solid #e2eae9;
}
.ground { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }
.ground canvas, .ground svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ground canvas { will-change: transform; }
.ground canvas.near { -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 92%); mask-image: radial-gradient(closest-side, #000 72%, transparent 92%); }
/* The coarse map only shows beyond the sharp one, so its thin lines are never enlarged. */
.ground canvas.wide { -webkit-mask-image: radial-gradient(closest-side, transparent 24%, #000 31%); mask-image: radial-gradient(closest-side, transparent 24%, #000 31%); }
.plan { position: absolute; inset: 0; font-family: "Work Sans", system-ui, sans-serif; }
.film { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform-origin: 50% 42%; will-change: transform; }
.stage-doc {
  position: absolute; left: 50%; top: 50%; width: min(84%, 680px); opacity: 0; visibility: hidden;
  display: grid; gap: 10px; padding: clamp(14px, 2.2vw, 28px);
  background: var(--surface); border: 1px solid #e2eae9; border-radius: 12px; box-shadow: var(--shadow);
}
.stage-doc strong { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 600; letter-spacing: -.03em; color: var(--navy); }
.stage-doc img { width: 100%; height: auto; }
.stage-doc dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { padding: 8px 10px; background: var(--canvas); border-radius: 7px; opacity: 0; transform: translateY(8px); transition: opacity 240ms ease, transform 240ms ease; }
.fact.on { opacity: 1; transform: none; }
.fact dt { font-size: .75rem; color: var(--muted); }
.fact dd { font-size: clamp(.875rem, 1.2vw, 1.0625rem); font-weight: 600; color: var(--navy); white-space: nowrap; }

.hud { position: absolute; inset: 0; pointer-events: none; font-size: .875rem; line-height: 1.4; }
.hud-steps {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  display: flex; gap: 2px; padding: 3px;
  background: #ffffffF5; border: 1px solid #e2eae9; border-radius: 7px;
  font-size: .8125rem; white-space: nowrap;
}
.hud-steps li { padding: 5px 11px; border-radius: 5px; color: var(--muted); transition: background-color 180ms ease, color 180ms ease; }
.hud-steps li.on { background: var(--mint); color: var(--navy); font-weight: 600; }

[data-show] { opacity: 0; transform: translateY(6px); transition: opacity 280ms ease, transform 280ms ease; }
.stage[data-active="1"] [data-show="1"], .stage[data-active="2"] [data-show="2"],
.stage[data-active="3"] [data-show="3"], .stage[data-active="4"] [data-show="4"] { opacity: 1; transform: none; }

.hud-card {
  position: absolute; display: grid; gap: 8px; width: 240px; padding: 12px;
  background: #ffffffF5; border: 1px solid #e2eae9; border-radius: 12px; box-shadow: var(--shadow);
}
.hud-search { left: 16px; top: 68px; }
.field { display: flex; align-items: center; gap: 1px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-weight: 500; color: var(--navy); }
.field i { width: 1.5px; height: 18px; background: var(--focus); }
.check { display: flex; align-items: center; gap: 9px; color: var(--muted); padding: 0 2px; }
.check i { flex: none; width: 16px; height: 16px; border-radius: 3px; box-shadow: inset 0 0 0 1px #5d737e; transition: background-color 160ms ease; }
.check.on { color: var(--navy); }
.check.on i { box-shadow: none; background: var(--focus) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.5 5.5 10.5 11.5 3.5'/%3E%3C/svg%3E") center/70% no-repeat; }

.hud-toggle {
  position: absolute; right: 16px; top: 16px; display: flex; gap: 2px; padding: 3px;
  background: #ffffffF5; border: 1px solid #e2eae9; border-radius: 7px; font-size: .8125rem;
  opacity: 0; transition: opacity 240ms ease;
}
.hud-toggle.show { opacity: 1; }
.hud-toggle span { padding: 5px 10px; border-radius: 5px; color: var(--muted); transition: background-color 200ms ease, color 200ms ease; }
.hud-toggle span.on { background: var(--navy); color: var(--on-navy); font-weight: 600; }

.hud-pill {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0; padding: 8px 14px;
  background: var(--navy); color: var(--on-navy); border-radius: 20px; font-size: .8125rem; font-weight: 500; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity 240ms ease, transform 240ms ease;
}
.hud-pill.show { opacity: 1; transform: none; }
.hud-edit .b { display: none; }
.hud-edit.done .a { display: none; }
.hud-edit.done .b { display: inline; }
.hud-note { position: absolute; left: 16px; bottom: 14px; color: var(--muted); font-size: .75rem; }

/* Close */
.close {
  display: grid; justify-items: start; gap: 20px;
  padding: clamp(64px, 12vh, 140px) var(--gutter);
  background: var(--navy); color: var(--on-navy-muted);
}
.close-mark { width: 72px; height: auto; }
.close h2 { max-width: 14ch; font-size: clamp(2.5rem, 6.5vw, 6.5rem); font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--on-navy); }
.close p { max-width: 30em; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.45; }
.close :focus-visible, .foot :focus-visible { outline-color: var(--green); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 20px var(--gutter); background: var(--navy); color: var(--on-navy-muted);
  border-top: 1px solid #ffffff22; font-size: .9375rem;
}
.foot a { color: var(--on-navy); }

/* Phone and small tablet: the stage stays on top while the text scrolls under it */
@media (max-width: 900px) {
  :root { --header: 60px; }
  .top-logo img { height: 28px; }
  .top-nav a:not(.btn) { display: none; }
  .hero { display: flex; flex-direction: column; padding-bottom: 0; background: #dad3c1; }
  .hero h1 { font-size: clamp(3rem, 15vw, 6rem); max-width: 8ch; }
  .hero-photo { position: relative; inset: auto; order: 2; flex: 1 1 auto; min-height: 42svh; margin: 12px calc(var(--gutter) * -1) 0; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%); mask-image: linear-gradient(to bottom, transparent, #000 22%); }
  .hero-photo img { position: absolute; inset: 0; object-position: 72% 100%; }
  .hero-lines { display: none; }
  .flow { position: relative; display: flex; flex-direction: column; padding-top: 48px; padding-bottom: 0; }
  .flow h2 { margin-bottom: 20px; }
  .flow-steps { display: contents; }
  #flow-title { order: 0; }
  .stage { order: 1; top: var(--header); height: 46svh; min-height: 300px; z-index: 5; margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-width: 1px 0; }
  .step { order: 2; min-height: 118svh; }
  .step:last-of-type { min-height: 100svh; }
  .step-inner { top: calc(var(--header) + 46svh + 16px); padding-top: 20px; }
  .hud { font-size: .75rem; }
  .hud-steps { top: 8px; left: 8px; transform: none; font-size: .6875rem; }
  .hud-steps li { padding: 4px 6px; }
  .hud-card { width: 158px; padding: 8px; gap: 5px; border-radius: 10px; }
  .hud-search { left: 8px; top: 44px; }
  .field { min-height: 28px; padding: 0 7px; font-size: .6875rem; }
  .field i { height: 14px; }
  .check i { width: 13px; height: 13px; }
  .hud-toggle { top: 8px; right: 8px; font-size: .6875rem; }
  .hud-toggle span { padding: 4px 7px; }
  .hud-pill { bottom: 8px; padding: 5px 10px; font-size: .6875rem; }
  .hud-note { left: 8px; bottom: 7px; font-size: .625rem; }
  .stage[data-active="2"] .hud-note, .stage[data-active="3"] .hud-note, .stage[data-active="4"] .hud-note { opacity: 0; }
  .stage-doc { top: 54%; width: 78%; padding: 10px; gap: 6px; }
  .stage-doc dl { gap: 4px; }
  .fact { padding: 5px 6px; }
  .fact dt { font-size: .5625rem; }
  .fact dd { font-size: .6875rem; }
}

/* A phone on its side: little height, so the photo goes and the stage takes what there is. */
@media (max-width: 950px) and (max-height: 500px) {
  :root { --header: 52px; }
  .hero { min-height: 0; padding-bottom: 28px; }
  .hero h1 { font-size: 2.5rem; max-width: none; }
  .hero-photo { display: none; }
  .flow { display: flex; flex-direction: column; padding-top: 28px; padding-bottom: 0; }
  .flow-steps { display: contents; }
  .flow h2 { font-size: 1.5rem; margin-bottom: 12px; }
  .stage { order: 1; top: var(--header); height: 62svh; min-height: 0; z-index: 5; margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-width: 1px 0; }
  .step { order: 2; min-height: 110svh; }
  .step-inner { top: calc(var(--header) + 62svh + 4px); padding-top: 6px; }
  .step-name { display: none; }
  .step h3 { margin-top: 0; font-size: 1.0625rem; }
  .step-inner > p:last-child { margin-top: 2px; font-size: .875rem; line-height: 1.3; max-width: none; }
  .hud-search { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
