/* yeti website. Values come from frost.css; layout on a 4px grid. */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--yt-window);
  color: var(--yt-fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--yt-accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: 0.88em; font-weight: 400; }

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

.wrap { width: 100%; max-width: calc(var(--container-content) + 48px); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-control);
  background: var(--yt-primary); color: var(--yt-on-primary); font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ── Wordmark & brand ─────────────────────────────── */

.wordmark { font-family: var(--font-wordmark); font-weight: 400; font-size: 28px; line-height: 1; letter-spacing: 0; color: var(--yt-fg); }
.wordmark-sm { font-size: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; }

/* ── Header ───────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--yt-window) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
}
.page-docs .site-header, .page-download .site-header, .page-notfound .site-header { border-bottom-color: var(--yt-line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: var(--radius-control);
  color: var(--yt-muted); font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background-color 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.nav-link:hover { background: var(--yt-hover); color: var(--yt-fg); }
.nav-link[aria-current="page"] { background: var(--yt-selected); color: var(--yt-fg); }
.site-nav .btn { margin-left: 6px; }

/* ── Buttons ──────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius-control);
  font: inherit; font-size: 14px; font-weight: 800; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-soft), transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: var(--radius-box); }
.btn-primary { background: var(--yt-primary); color: var(--yt-on-primary); }
.btn-primary:hover { background: var(--yt-primary-hover); }
.btn-quiet { background: var(--yt-tint); color: var(--yt-accent); }
.btn-quiet:hover { background: var(--yt-tint-strong); }
.btn-snow { background: var(--brand-snow); color: var(--on-stage-accent); box-shadow: 0 8px 22px rgba(6, 18, 31, 0.22); }
.btn-snow:hover { background: var(--brand-blue-50); }
.btn-glass {
  background: var(--stage-glass); color: var(--on-stage);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25);
}
.btn-glass:hover { background: var(--stage-glass-hover); }
.stage :focus-visible { outline-color: var(--on-stage); }

/* ── Status: always a dot and a word ──────────────── */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-live { background: var(--yt-status-live); }
.dot-soon { background: var(--yt-status-idle); animation: yt-pulse 1.8s ease-in-out infinite; }
.dot-snow { background: var(--on-stage); animation: yt-pulse 1.8s ease-in-out infinite; }
@keyframes yt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--yt-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
}
.badge-off { background: var(--yt-tone-off-bg); color: var(--yt-tone-off-fg); }
.badge-live { background: var(--yt-tone-live-bg); color: var(--yt-tone-live-fg); }

/* ── The stage (hero) ─────────────────────────────── */

.stage {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 8px; border-radius: var(--radius-stage);
  background: radial-gradient(120% 95% at 30% 45%, var(--brand-stage) 0%, var(--brand-blue-600) 30%, var(--brand-blue-700) 62%, var(--brand-blue-800) 100%);
  color: var(--on-stage);
}

.stage-frost {
  position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 70px rgba(234, 244, 254, 0.32), inset 0 0 10px rgba(255, 255, 255, 0.45);
  background: radial-gradient(60% 50% at 0% 0%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 70%),
    radial-gradient(50% 45% at 100% 100%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 70%);
}

.stage-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); align-items: center; gap: 48px;
  min-height: 600px; padding: 64px 64px 64px 72px;
}
.stage-copy { display: flex; flex-direction: column; gap: 22px; }
.stage-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border-radius: var(--radius-pill);
  background: var(--stage-glass); font-size: 13px; font-weight: 800;
}
.stage-pill-deep { background: var(--stage-deep); font-weight: 700; }
.stage h1 {
  font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; font-weight: 800; letter-spacing: -0.025em;
  text-wrap: balance; text-shadow: 0 2px 24px rgba(6, 18, 31, 0.18);
}
.stage-tagline { font-size: clamp(19px, 2vw, 23px); line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; margin-top: -8px; }
.stage-lead { max-width: 34em; font-size: 18px; line-height: 1.55; font-weight: 600; color: var(--on-stage-muted); }
.stage-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.stage-fact code { font-size: 13px; color: var(--stage-mono); letter-spacing: 0.02em; }


/* ── ASCII hero: a yeti on its floe, ASCII sea behind ── */

.stage-ascii { --water-bottom: 150px; }
.ascii-sea { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-ascii .stage-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; min-height: 680px; padding-top: 64px; }
.stage-ascii h1 { font-size: clamp(40px, 5.6vw, 68px); }

.ascii-scene {
  position: absolute; z-index: 1; top: 0; bottom: 0; left: 52%; width: 42%; max-width: 480px;
  pointer-events: none; transform: translateY(calc(var(--scroll, 0) * 70px));
}
.scene-bob { position: absolute; inset: 0; animation: yt-floe-bob 5s ease-in-out infinite; }
.scene-above { position: absolute; left: 0; width: 100%; bottom: var(--water-bottom); aspect-ratio: 589 / 370; }
.scene-above img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 24px rgba(6, 18, 31, 0.25)); }
.scene-under { position: absolute; left: 0; width: 100%; height: auto; top: calc(100% - var(--water-bottom)); opacity: 0.6; }
.scene-wave { opacity: 0; animation: yt-wave 5s steps(1) infinite; }
@keyframes yt-floe-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* Two-frame wave: three quick waves, then a rest. */
@keyframes yt-wave { 0% { opacity: 0; } 6% { opacity: 1; } 12% { opacity: 0; } 18% { opacity: 1; } 24% { opacity: 0; } 30% { opacity: 1; } 36%, 100% { opacity: 0; } }

/* ── Sections ─────────────────────────────────────── */

.section { padding: 112px 0; }
.section-alt { background: var(--yt-sidebar); border-block: 1px solid var(--yt-line); }
.section-page { padding: 72px 0 112px; }

.section-head { display: flex; flex-direction: column; gap: 14px; }
.section-head-center { align-items: center; text-align: center; max-width: 720px; margin: 0 auto 48px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 16px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--yt-eyebrow);
}
.section h2, .section-page h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.lead { font-size: 18px; line-height: 1.55; font-weight: 500; color: var(--yt-muted); text-wrap: pretty; }
.aside { font-size: 15px; color: var(--yt-muted); }
.note { max-width: 640px; margin: 32px auto 0; text-align: center; font-size: 15px; color: var(--yt-muted); }
.section-link { margin-top: 36px; text-align: center; }
.link-arrow { font-weight: 800; text-decoration: none; }
.link-arrow::after { content: " →"; display: inline-block; transition: transform 0.2s var(--ease-spring); }
.link-arrow:hover::after { transform: translateX(3px); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }

.points { list-style: none; display: grid; gap: 14px; margin-top: 10px; }
.points li { position: relative; padding-left: 22px; color: var(--yt-muted); font-weight: 600; }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--yt-accent); }
.points strong { color: var(--yt-fg); font-weight: 800; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Cards (paper below the stage) ─────────────────── */

.card {
  background: var(--yt-surface); border: 1px solid var(--yt-line); border-radius: var(--radius-card);
  box-shadow: var(--yt-shadow-raised);
}
.feature { display: flex; flex-direction: column; gap: 10px; padding: 26px; }
.feature h3 { margin-top: 8px; font-size: 18px; line-height: 1.3; font-weight: 800; letter-spacing: -0.005em; }
.feature p { color: var(--yt-muted); font-size: 15px; line-height: 1.55; font-weight: 600; }
.feature p code { color: var(--yt-mono); }
.feature .fact { margin-top: auto; padding-top: 8px; }
.fact code { font-size: 12.5px; color: var(--yt-mono); }

.icon-chip {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border-radius: var(--radius-box); background: var(--yt-chip); color: var(--yt-accent);
}
.icon { display: inline-flex; }
.icon svg { width: 20px; height: 20px; }

/* Profile card: a yeti's settings, drawn from the app's real options */
.profile { padding: 26px; display: flex; flex-direction: column; gap: 22px; box-shadow: var(--yt-shadow-float); }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .status { margin-left: auto; }
.avatar { width: 52px; height: 52px; border-radius: 14px; }
.profile-name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.profile-role { font-size: 14px; color: var(--yt-muted); }
.profile-group { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--yt-eyebrow); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: var(--radius-pill);
  background: var(--yt-chip); color: var(--yt-muted); font-size: 14px; font-weight: 700;
}
.chip-on { background: var(--yt-primary); color: var(--yt-on-primary); }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-control); background: var(--yt-chip); }
.segmented .segment {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: var(--radius-control-sm);
  color: var(--yt-muted); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.segmented a.segment:hover { color: var(--yt-fg); }
.segmented .segment[aria-selected="true"], .segmented .segment[aria-current="true"] {
  background: var(--yt-surface); color: var(--yt-fg); box-shadow: var(--shadow-segment);
}
.segmented .icon svg { width: 17px; height: 17px; }
.segmented-static .segment { font-size: 13px; padding: 0 8px; }

.checks { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.check {
  position: relative; width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--yt-primary);
}
.check::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px;
  border: solid var(--yt-on-primary); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* Key facts: a key–value table in mono */
.facts { padding: 26px; box-shadow: var(--yt-shadow-float); }
.facts-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.facts-head h3 { font-size: 18px; font-weight: 800; }
.facts dl div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--yt-line); }
.facts dt { font-size: 14px; font-weight: 700; color: var(--yt-muted); }
.facts dd { font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; color: var(--yt-mono); text-align: right; }

/* ── Download ─────────────────────────────────────── */

.download-box {
  max-width: 640px; margin: 0 auto; padding: 10px;
  background: var(--yt-surface); border: 1px solid var(--yt-line); border-radius: var(--radius-card);
  box-shadow: var(--yt-shadow-float);
}
.download-panel { padding: 26px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.download-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.download-head h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.download-files { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.file-chip {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--radius-field);
  border: 1.5px dashed var(--yt-line-strong); color: var(--yt-muted);
  font-family: var(--font-mono); font-size: 13px; font-weight: 400;
}
.download-req { font-size: 14px; color: var(--yt-muted); }
.htmx-request.download-box, .htmx-request .download-panel { opacity: 0.6; transition: opacity 0.2s; }

/* ── Docs ─────────────────────────────────────────── */

.docs { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 112px; }
.docs-menu { display: none; }
.docs-sidebar nav { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 10px; }
.docs-sidebar .label { padding: 0 12px; }
.docs-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius-field);
  color: var(--yt-muted); font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background-color 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}
.docs-nav a:hover { background: var(--yt-hover); color: var(--yt-fg); }
.docs-nav a[aria-current="page"] { background: var(--yt-selected); color: var(--yt-fg); }

.docs-main { max-width: var(--container-prose); min-width: 0; }
.docs-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--yt-line); }
.docs-head h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }

.prose { font-size: 16.5px; line-height: 1.7; font-weight: 500; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2.2em; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.prose h3 { margin-top: 1.8em; font-size: 19px; line-height: 1.3; font-weight: 800; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--yt-accent); }
.prose :not(pre) > code {
  padding: 0.1em 0.3em; border-radius: var(--radius-tile-sm);
  background: var(--yt-chip); color: var(--yt-mono); overflow-wrap: anywhere;
}
.prose pre {
  overflow-x: auto; padding: 16px 18px; border-radius: var(--radius-row);
  background: var(--yt-inset); border: 1px solid var(--yt-line);
  font-size: 13.5px; line-height: 1.6;
}
.prose pre code { font-size: inherit; color: var(--yt-fg); }
.prose blockquote { margin: 1.4em 0 0; padding: 14px 18px; border-radius: var(--radius-row); background: var(--yt-tint-strong); color: var(--yt-fg); }
.prose blockquote > * + * { margin-top: 0.6em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--yt-line); text-align: left; vertical-align: top; }
.prose th {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--yt-eyebrow); white-space: nowrap;
}
.prose hr { border: 0; border-top: 1px solid var(--yt-line); margin: 2.4em 0; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.pager { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; text-decoration: none; color: var(--yt-fg); transition: border-color 0.2s var(--ease-soft), transform 0.2s var(--ease-spring); }
.pager:hover { border-color: var(--yt-line-strong); transform: translateY(-2px); }
.pager-next { grid-column: 2; text-align: right; }
.pager-title { font-size: 17px; font-weight: 800; color: var(--yt-accent); }

/* ── 404 ──────────────────────────────────────────── */

.notfound .wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding-top: 24px; }
.notfound-mark {
  display: flex; align-items: center; justify-content: center; width: 168px; height: 168px; margin-bottom: 8px;
  border-radius: 44px; background: radial-gradient(120% 95% at 30% 35%, var(--brand-stage) 0%, var(--brand-blue-600) 45%, var(--brand-blue-700) 100%);
  box-shadow: var(--yt-shadow-float);
}
.notfound .lead { max-width: 30em; }
.notfound-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* ── Footer ───────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--yt-line); padding: 40px 0 48px; }
.site-footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 32px; align-items: center; }
.footer-brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.footer-brand p { color: var(--yt-muted); font-size: 15px; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { color: var(--yt-muted); font-size: 15px; font-weight: 700; text-decoration: none; }
.footer-nav a:hover { color: var(--yt-fg); }
.footer-fine { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; color: var(--yt-eyebrow); }

/* ── Small screens ────────────────────────────────── */

@media (max-width: 960px) {
  .stage-inner { grid-template-columns: 1fr; gap: 36px; min-height: 0; padding: 48px 40px; }
  .stage-ascii { --water-bottom: 110px; }
  .stage-ascii .stage-inner { grid-template-columns: 1fr; min-height: 0; padding-bottom: calc(var(--water-bottom) + 50vw + 24px); }
  .ascii-scene { left: 50%; width: 82%; max-width: 440px; translate: -50% 0; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .docs { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .docs-sidebar { display: none; }
  .docs-menu {
    display: block; border: 1px solid var(--yt-line); border-radius: var(--radius-panel); background: var(--yt-surface);
  }
  .docs-menu summary { padding: 12px 16px; font-weight: 800; cursor: pointer; }
  .docs-menu nav { padding: 0 8px 8px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-header-inner { height: 64px; }
  .nav-features { display: none; }
  .stage { border-radius: 24px; }
  .stage-inner { padding: 32px 22px 36px; gap: 28px; }
  .stage-lead { font-size: 16.5px; }
  .stage-actions .btn { flex: 1 1 auto; }
  .section { padding: 72px 0; }
  .section-head-center { margin-bottom: 32px; }
  .grid-3 { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .segmented-static .segment { font-size: 12px; padding: 0 4px; }
  .segmented .segment { padding: 0 8px; }
  .download-panel { padding: 22px 12px 14px; }
  .docs-pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .site-footer-inner { grid-template-columns: 1fr; }
}

/* ── Reduced motion: everything stops ─────────────── */

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