/* Kite web design system: tokens and shared components for the website mockups.
   Spec: docs/design/website/web-design-system.md. Directions add their own layout on top. */

@font-face {
  font-family: "Geist";
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --ground: #060708;
  --band: #0b0c0e;
  --panel: #111215;
  --raised: #17191d;
  --well: #1e2025;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --edge-light: rgba(255, 255, 255, 0.16);
  --shadow-panel: 0 40px 80px -32px rgba(0, 0, 0, 0.8), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
  --glow: rgba(0, 113, 252, 0.16);
  --glow-2: rgba(0, 113, 252, 0.07);

  --accent: #0071fc;
  --accent-hi: #4f9dff;
  --dot-1: #123e9e;
  --dot-2: #2f7bff;
  --dot-3: #a9cdff;
  --ink: #f4f5f7;
  --ink-2: #a1a5ad;
  --ink-3: #6b7079;
  --live: #3dd68c;

  --font-display: "Geist", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --t-display: clamp(44px, 6.2vw, 80px);
  --t-h1: clamp(40px, 5vw, 64px);
  --t-h2: clamp(32px, 3.6vw, 46px);
  --t-h3: clamp(21px, 1.9vw, 24px);
  --t-lede: clamp(17px, 1.5vw, 20px);
  --t-stat: clamp(44px, 5vw, 64px);

  --r-control: 8px;
  --r-small: 12px;
  --r-card: 18px;
  --r-frame: 28px;

  --content: 1200px;
  --measure: 640px;
  --gutter: clamp(24px, 4vw, 40px);
  --section: clamp(96px, 11vw, 144px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --d-press: 140ms;
  --d-ui: 220ms;
  --d-reveal: 700ms;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ground: #f6f6f4;
  --band: #efefec;
  --panel: #ffffff;
  --raised: #ffffff;
  --well: #ececea;
  --line: rgba(10, 12, 16, 0.08);
  --line-strong: rgba(10, 12, 16, 0.12);
  --edge-light: rgba(255, 255, 255, 1);
  --shadow-panel: 0 30px 60px -30px rgba(16, 24, 40, 0.2), 0 8px 16px -8px rgba(16, 24, 40, 0.08);
  --glow: rgba(0, 113, 252, 0.1);
  --glow-2: rgba(0, 113, 252, 0.05);
  --accent-hi: #0062d6;
  --ink: #121316;
  --ink-2: #555a63;
  --ink-3: #868a92;
  --live: #0f8a4f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  overflow-x: clip;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }

/* Static grain over the whole page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="light"] body::after { opacity: 0.05; mix-blend-mode: multiply; }

.wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: var(--section) 0; }
.band { background: var(--band); }
.measure { max-width: var(--measure); }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Type */
.display { font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.04em; }
.h1 { font-size: var(--t-h1); line-height: 1.02; letter-spacing: -0.035em; }
.h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -0.03em; }
.h3 { font-size: var(--t-h3); line-height: 1.2; letter-spacing: -0.015em; }
.lede { font-size: var(--t-lede); line-height: 1.5; letter-spacing: -0.005em; color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.mono { font-family: var(--font-mono); font-size: 13px; line-height: 1.4; letter-spacing: 0.01em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lit {
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 62%, transparent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ink-2 { color: var(--ink-2); }
.stack-s > * + * { margin-top: 12px; }
.stack-m > * + * { margin-top: 20px; }
.stack-l > * + * { margin-top: 32px; }

/* Buttons */
.btn {
  --h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  font: 500 15px/1 var(--font-body);
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  transition-property: background-color, color, box-shadow, transform;
  transition-duration: var(--d-ui), var(--d-ui), var(--d-ui), var(--d-press);
  transition-timing-function: ease, ease, ease, var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-lg { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #1a80ff 0%, #0068e8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px -8px rgba(0, 113, 252, 0.7), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover { background: linear-gradient(180deg, #2b8aff 0%, #0a72f5 100%); }
.btn-ghost {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 1px 0 color-mix(in srgb, var(--edge-light) 50%, transparent);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.link { color: var(--accent-hi); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.link svg { transition: transform var(--d-ui) var(--ease-out); }
.link:hover svg { transform: translateX(3px); }

/* Surfaces */
.panel {
  position: relative;
  background: var(--panel);
  border-radius: var(--r-card);
  box-shadow: inset 0 1px 0 var(--edge-light), inset 0 0 0 1px var(--line-strong), var(--shadow-panel);
}
/* The one light: a soft highlight on the top-left of a panel's edge. */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(60% 40% at 0% 0%, color-mix(in srgb, var(--edge-light) 45%, transparent), transparent 70%);
  opacity: 0.5;
}
:root[data-theme="light"] .panel::before { opacity: 0; }

.frame {
  position: relative;
  border-radius: var(--r-frame);
  padding: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 9%, var(--panel)) 0%, var(--panel) 40%);
  box-shadow: inset 0 1px 0 var(--edge-light), inset 0 0 0 1px var(--line-strong), var(--shadow-panel);
}
.frame > .shot {
  border-radius: calc(var(--r-frame) - 10px);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #0c0c0c;
}
:root[data-theme="light"] .frame > .shot { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }

.glow-tl, .glow-tr, .glow-b, .glow-c {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.glow-tl { inset: -20% 40% 40% -20%; background: radial-gradient(closest-side, var(--glow), transparent); }
.glow-tr { inset: -20% -20% 40% 40%; background: radial-gradient(closest-side, var(--glow), transparent); }
.glow-b { left: 10%; right: 10%; bottom: -30%; height: 70%; background: radial-gradient(closest-side, var(--glow), transparent); }
.glow-c { inset: 10% 15%; background: radial-gradient(closest-side, var(--glow-2), transparent); }
.section > .wrap { position: relative; z-index: 1; }

/* A field of faint dots: the bird's grid as texture. */
.dot-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at center, color-mix(in srgb, var(--dot-2) 55%, transparent) 0.9px, transparent 1.4px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(60% 70% at 50% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 70% at 50% 40%, #000 0%, transparent 75%);
  opacity: 0.35;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  transition: background-color var(--d-ui) ease, box-shadow var(--d-ui) ease;
}
.nav[data-scrolled="true"] {
  background: color-mix(in srgb, var(--ground) 78%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  box-shadow: inset 0 -1px 0 var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav .brand { display: flex; align-items: center; gap: 10px; font: 600 17px/1 var(--font-display); letter-spacing: -0.02em; }
.nav .brand svg { width: 18px; height: 21px; }
.nav .links { display: flex; gap: 4px; margin-left: 12px; }
.nav .links a { padding: 8px 12px; border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: color var(--d-ui) ease, background-color var(--d-ui) ease; }
.nav .links a:hover, .nav .links a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav .right .signin { font-size: 14px; color: var(--ink-2); padding: 8px 12px; }
.nav .btn { --h: 36px; padding: 0 16px; font-size: 14px; }
.nav .menu { display: none; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); }
@media (max-width: 860px) {
  .nav .links, .nav .right .signin { display: none; }
  .nav .menu { display: inline-grid; place-items: center; }
}

/* Stat */
.stat .num { font: 400 var(--t-stat)/1 var(--font-mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat .label { margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.45; max-width: 26ch; }
.ph { color: var(--ink-3); }
.ph-tag { font: 500 11px/1 var(--font-mono); letter-spacing: 0.02em; color: #fbb56a; background: rgba(251, 181, 106, 0.12); padding: 4px 6px; border-radius: 4px; vertical-align: middle; }

/* Segmented control */
.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.seg button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: 500 14px/1 var(--font-body);
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--d-ui) ease;
  white-space: nowrap;
}
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--ink); }
.seg .thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: inset 0 1px 0 var(--edge-light), inset 0 0 0 1px var(--line-strong), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  transition: transform 360ms var(--ease-drawer), width 360ms var(--ease-drawer);
}
:root[data-theme="light"] .seg .thumb { box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px -2px rgba(16, 24, 40, 0.18); }

/* Live chips used over product frames */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font: 500 13px/1 var(--font-body);
  color: var(--ink);
  background: color-mix(in srgb, var(--raised) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--edge-light), inset 0 0 0 1px var(--line-strong), 0 12px 30px -10px rgba(0, 0, 0, 0.7);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }
.chip .t { font-family: var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Footer */
.foot { padding: 72px 0 48px; border-top: 1px solid var(--line); }
.foot .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.foot h4 { margin: 0 0 14px; font: 500 13px/1 var(--font-body); color: var(--ink); }
.foot a { display: block; font-size: 14px; color: var(--ink-2); padding: 5px 0; }
.foot a:hover { color: var(--ink); }
.foot .legal { margin-top: 56px; display: flex; justify-content: space-between; color: var(--ink-3); font-size: 13px; }
@media (max-width: 860px) { .foot .cols { grid-template-columns: 1fr 1fr; } .foot .cols > :first-child { grid-column: 1 / -1; } }

/* Reveal on view: plays once. Without JS everything shows. */
.js [data-reveal] { opacity: 0; transform: translateY(14px); }
.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity var(--d-reveal) var(--ease-out), transform var(--d-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
/* Static renders (screenshots) and reduced motion show the final state. */
.static [data-reveal], .static .js [data-reveal] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The hero's live bird: same markup and fallbacks as apps/web Hero.astro. */
.bird { position: absolute; inset: 0; z-index: 0; }
.bird canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 900ms var(--ease-out); }
[data-live="true"] .bird canvas { opacity: 1; }
.bird video[data-live-src] { position: absolute; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0.01; pointer-events: none; }
.bird video.loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; display: none; }
[data-hero="loop"] .bird video.loop, [data-hero="still"] .bird video.loop { display: block; }
