/* Kestrel site. Tokens match the app's Paper and Indigo scheme. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #1B1A1F;
  --muted: #5F5C66;
  --line: #E5E1DA;
  --accent: #4F5BD5;
  --accent-ink: #3A44A8;
  --on-accent: #FFFFFF;
  --tint: #EEF0FC;
  --grid: rgba(79, 91, 213, .035);
  --grain-opacity: .05;
  --shadow: 0 30px 60px -30px rgba(27, 26, 31, .28), 0 12px 24px -12px rgba(27, 26, 31, .10);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141417;
  --surface: #1B1B1F;
  --ink: #F0EFF3;
  --muted: #A9A8AF;
  --line: #303036;
  --accent: #7B86F0;
  --accent-ink: #A3ABF7;
  --on-accent: #0F1030;
  --tint: #22243F;
  --grid: rgba(163, 171, 247, .04);
  --grain-opacity: .07;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(135deg, var(--grid) 0, var(--grid) 1px, transparent 1.6px, transparent 120px);
  color: var(--ink);
  font-family: Figtree, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  transition: background-color .5s cubic-bezier(.16, 1, .3, 1), color .5s cubic-bezier(.16, 1, .3, 1);
}
/* Paper grain over the grid: a tiled noise texture, drawn once, kept faint. */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .3 0 0 0 0 .4 0 0 0 1.2 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(42px, 6.4vw, 76px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; max-width: 13em; margin: 0 auto 24px; }
h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.12; font-weight: 700; margin-bottom: 16px; }
.h2-xl { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.035em; }
h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
a { color: var(--accent-ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
::selection { background: #4F5BD5; color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 10px 16px; background: var(--surface); color: var(--ink); border-radius: 8px; }
.skip:focus { left: 16px; }

/* Layout */
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 28px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding-inline: 28px; }
.section { padding-block: 120px 40px; }
.center { text-align: center; }
.band { margin-top: 120px; }
.band > .wrap { padding-block: 112px; }
.band-tint { background: var(--tint); }
.band-surface { background: var(--surface); border-block: 1px solid var(--line); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); transition: background-color .5s cubic-bezier(.16, 1, .3, 1); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; fill: var(--accent); }
.brand-small { font-size: 16px; font-weight: 600; min-height: 0; }
.brand-small .brand-mark { width: 20px; height: 20px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: 16px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); text-decoration: none; }
.nav-link:hover { color: var(--accent-ink); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s cubic-bezier(.16, 1, .3, 1), background-color .25s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { box-shadow: 0 8px 20px -8px var(--accent); }
.btn-quiet { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn-quiet:hover { background: var(--tint); }
.btn-small { min-height: 44px; padding: 0 20px; }
.btn-static, .btn-static:hover { cursor: default; transform: none; background: var(--surface); color: var(--muted); }

/* Hero */
.hero { position: relative; padding-top: 96px; text-align: center; }
/* Clear the lines behind the headline so the text sits on calm paper. */
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 40%; background: radial-gradient(ellipse 55% 60% at 50% 38%, var(--bg) 35%, transparent 100%); pointer-events: none; }
.badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; padding: 6px 14px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lede { max-width: 34em; margin: 0 auto 36px; color: var(--muted); font-size: 20px; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.fine { margin-top: 18px; color: var(--muted); font-size: 15px; }

/* Screenshots */
.shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.shot-hero { max-width: 1120px; margin: 72px auto 0; border-radius: 16px; animation: shot 1.2s cubic-bezier(.16, 1, .3, 1) .3s both; }
.shot-note { margin: 16px auto 0; color: var(--muted); font-size: 14px; }
.only-dark { display: none; }
[data-theme="dark"] .only-dark { display: block; }
[data-theme="dark"] .only-light { display: none; }
.crop-pipeline { aspect-ratio: 1400 / 760; object-fit: cover; object-position: left top; }
.crop-docs { aspect-ratio: 830 / 950; }
.crop-docs img { width: 241%; max-width: none; margin-left: -38.6%; }

/* Split and feature rows */
.split { display: flex; flex-wrap: wrap; gap: 40px 80px; align-items: flex-start; }
.split > h2 { flex: 1 1 320px; margin: 0; }
.stack { flex: 1.3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.feature { display: flex; flex-wrap: wrap; gap: 48px 72px; align-items: center; }
.feature-flip { flex-direction: row-reverse; }
.feature-text { flex: 1 1 320px; min-width: 0; }
.feature-shot { flex: 1.7 1 520px; min-width: 0; }
.band-surface .feature-shot { background: var(--bg); }

/* Steps */
.steps { margin: 56px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px 48px; }
.steps li { border-top: 2px solid var(--ink); padding-top: 20px; }
.step-num { display: block; margin-bottom: 14px; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--accent); }

/* Lists */
.checks { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.checks li { display: flex; gap: 14px; }
.check { width: 22px; height: 22px; margin-top: 3px; stroke: var(--accent); stroke-width: 2; }
.modes { flex: 1 1 420px; min-width: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.mode { display: flex; gap: 16px; padding: 20px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.mode strong { display: block; font-size: 19px; }
.mode .muted { display: block; }
.radio { flex: none; width: 18px; height: 18px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--line); }
.mode.is-selected { border: 2px solid var(--accent); padding: 19px 21px; }
.mode.is-selected .radio { border: 5px solid var(--accent); }

/* Story */
#story { padding-bottom: 0; }
.note { font-size: 20px; line-height: 1.65; margin: 24px 0 32px; }
.note p { margin-bottom: 20px; }
.signature { font-weight: 600; }

/* Download */
.platforms { margin: 0 0 20px; font-weight: 600; }
.beta-note { max-width: 36em; margin: 0 auto 24px; color: var(--muted); font-size: 15px; }
.policy h1 { text-align: left; margin: 0 0 12px; font-size: clamp(36px, 5vw, 52px); }
.policy h2 { margin-top: 40px; font-size: 24px; }
.policy p, .policy li { color: var(--muted); }
.policy ul { padding-left: 20px; }
.policy li { margin-bottom: 8px; }

/* FAQ */
.faq { margin-top: 32px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font-weight: 600; font-size: 19px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 22px; color: var(--muted); }
.faq details p + p { margin-top: -8px; }
.plus { position: relative; flex: none; width: 18px; height: 18px; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; border-radius: 2px; transform: translate(-50%, -50%); }
.plus::before { width: 14px; height: 2px; }
.plus::after { width: 2px; height: 14px; }
.faq details[open] .plus { transform: rotate(45deg); }
#faq { padding-bottom: 140px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { display: flex; flex-direction: column; gap: 14px; padding-block: 24px 32px; font-size: 15px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.footer-links a { display: inline-block; padding: 12px 0; }
.footer-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 14px; }
.footer-notes li:not(:last-child)::after { content: "·"; margin: 0 10px; }

/* Motion */
.rise { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
.d1 { animation-delay: .08s; }
.d2 { animation-delay: .16s; }
.d3 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shot { from { opacity: 0; transform: translateY(40px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}

/* Small screens */
@media (max-width: 760px) {
  .nav-text { display: none; }
  .wrap { padding-inline: 20px; }
  .header-row { flex-wrap: nowrap; }
  .nav { flex-wrap: nowrap; gap: 10px; }
  .btn-small { padding: 0 16px; }
  .hero { padding-top: 64px; }
  .lede { font-size: 18px; }
  .section { padding-block: 88px 24px; }
  .band { margin-top: 88px; }
  .band > .wrap { padding-block: 80px; }
  .footer-notes { flex-direction: column; }
  .footer-notes li::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .shot-hero, .reveal { animation: none; }
  body, .site-header, .plus, .btn { transition: none; }
  .btn:hover { transform: none; }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
