/* ptarmigan-flow — landing page styles
   "Alpine glass" redesign: cool glacier palette, faceted geometry,
   one warm rust accent (the ptarmigan's comb).
   No frameworks, no webfonts, no third-party anything. */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  --snow:          #f4f7fa;   /* page bg */
  --glacier:       #e6edf4;   /* alternating section bg */
  --paper:         #ffffff;   /* cards */
  --ink:           #16222c;
  --slate:         #526475;   /* secondary text */
  --ice:           #c9d7e3;   /* hairline borders */
  --ice-strong:    #9db8cc;
  --alpine:        #44708f;   /* links / secondary accent */
  --comb:          #b5502f;   /* primary accent — rust comb */
  --comb-bright:   #d4633c;
  --tan:           #c9a888;   /* rare tertiary warm accent */
  --comb-soft:     rgba(181, 80, 47, 0.07);
  --card-shadow:   0 1px 2px rgba(22,34,44,0.05), 0 12px 32px -16px rgba(22,34,44,0.12);
  --card-shadow-h: 0 2px 4px rgba(22,34,44,0.06), 0 16px 40px -14px rgba(22,34,44,0.18);
  --header-bg:     rgba(244, 247, 250, 0.78);
  --code-bg:       #101a24;
  --code-fg:       #dce7f0;
  --code-border:   #24384a;
  /* Faceted mountain-ridge fills (hero background SVG) */
  --facet-1:       #dce7f0;
  --facet-2:       #cfdde9;
  --facet-3:       #c0d2e2;
  --facet-4:       #b0c6d9;
  --facet-5:       #a3bccf;
  --facet-snow:    #f0f5f9;
  --font-sans:     -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
                   "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  --font-mono:     ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --snow:          #0b1218;
    --glacier:       #0e1822;
    --paper:         #14202c;
    --ink:           #e9eef4;
    --slate:         #9db0c0;
    --ice:           #223648;
    --ice-strong:    #35506a;
    --alpine:        #7fa8c9;
    --comb:          #d96a45;
    --comb-bright:   #e57d55;
    --tan:           #b09070;
    --comb-soft:     rgba(217, 106, 69, 0.09);
    --card-shadow:   0 1px 3px rgba(0,0,0,0.5), 0 14px 36px -14px rgba(0,0,0,0.55);
    --card-shadow-h: 0 2px 5px rgba(0,0,0,0.55), 0 18px 44px -12px rgba(0,0,0,0.65);
    --header-bg:     rgba(11, 18, 24, 0.78);
    --code-bg:       #101a24;
    --code-fg:       #dce7f0;
    --code-border:   #24384a;
    --facet-1:       #16283a;
    --facet-2:       #1b3145;
    --facet-3:       #21384e;
    --facet-4:       #274058;
    --facet-5:       #2e4a63;
    --facet-snow:    #3a5a78;
  }
}

/* ============================================================
   RESET / BASE
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--alpine);
  text-decoration: underline;
  text-decoration-color: var(--ice-strong);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
a:hover {
  color: var(--comb);
  text-decoration-color: var(--comb);
}

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

code, pre, kbd { font-family: var(--font-mono); }

/* ============================================================
   LAYOUT
   ============================================================ */

.wrap {
  max-width: 66rem;
  margin-inline: auto;
  padding-inline: clamp(1.2rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -200vw;
  top: 0.5rem;
  background: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 200;
}
.skip-link:focus { left: 0.5rem; }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--ice);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 24%;
  box-shadow:
    0 0 0 1px var(--ice),
    0 3px 8px -2px rgba(22, 34, 44, 0.28);
}

.footer-brand .brand-icon {
  width: 26px;
  height: 26px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.2vw, 1.5rem);
  font-size: 0.87rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--slate);
  transition: color 0.15s ease;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--comb);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.lang-switch {
  border: 1px solid var(--ice-strong);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  color: var(--ink) !important;
  background: var(--paper);
  transition: border-color 0.15s ease;
  white-space: nowrap;
}
.lang-switch:hover {
  border-color: var(--comb);
  text-decoration: none !important;
}

@media (max-width: 720px) {
  .site-nav .nav-section { display: none; }
}

/* Very narrow screens: compact the header so nothing wraps */
@media (max-width: 480px) {
  .header-inner { gap: 0.6rem; }
  .brand { gap: 0.45rem; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-name { font-size: 0.8rem; }
  .site-nav { gap: 0.7rem; font-size: 0.82rem; }
  .lang-switch { padding: 0.22rem 0.7rem; }
}

/* ============================================================
   SECTION CHROME
   ============================================================ */

.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

/* Alternating section backgrounds (snow / glacier rhythm) */
#demo, #features, #ai-correction, #permissions {
  background: var(--glacier);
}

/* Eyebrow: the mono voice of the app */
.eyebrow {
  display: block;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--alpine);
}

h1 {
  margin: 0 0 1.3rem;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-intro {
  max-width: 44rem;
  margin: 0 0 2.5rem;
  color: var(--slate);
  font-size: 1.05rem;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(4rem, 10vw, 7.5rem) clamp(5rem, 12vw, 9rem);
}

.hero .wrap { position: relative; z-index: 3; }

/* Full-bleed waveform canvas */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Low-poly mountain ridge along the hero's bottom edge */
.hero-ridge {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: clamp(110px, 22vw, 230px);
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Two-column hero: copy left, app icon right */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* Grid children must be allowed to shrink below their content width,
   otherwise the hero column overflows narrow viewports. */
.hero-grid > * { min-width: 0; }

.hero-copy { max-width: 100%; }

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-icon-tile {
  position: relative;
  border-radius: 24%;
}

/* Soft radial ice-blue glow behind the icon */
.hero-icon-tile::before {
  content: "";
  position: absolute;
  inset: -32%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(127, 168, 201, 0.35) 0%,
    rgba(127, 168, 201, 0.12) 45%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-icon {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  border-radius: 24%;
  box-shadow:
    0 24px 60px -20px rgba(22, 34, 44, 0.35),
    0 0 0 1px var(--ice);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-icon-tile {
    animation: icon-float 7s ease-in-out infinite;
  }
}

@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.lede {
  max-width: 40rem;
  margin: 0 0 2.5rem;
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
  color: var(--slate);
  line-height: 1.72;
}

.lede strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   FLOW STRIP
   ============================================================ */

.flow-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.25rem;
  margin: 0 0 3rem;
  padding: 1.3rem 1.6rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  font-family: var(--font-mono);
  max-width: min(38rem, 100%);
}

.keycap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.2rem;
  border: 1px solid var(--ice);
  border-bottom-width: 4px;
  border-radius: 10px;
  background: var(--snow);
  animation: keypress 3.6s ease-in-out infinite;
}

.keycap-glyph { font-size: 1.3rem; line-height: 1.1; }
.keycap-label {
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

@keyframes keypress {
  0%, 12%, 88%, 100% { transform: translateY(0);  border-bottom-width: 4px; }
  20%, 80%           { transform: translateY(2px); border-bottom-width: 2px; }
}

.rec {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--comb);
  font-weight: 600;
}

.rec-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--comb);
  box-shadow: 0 0 7px var(--comb);
  animation: recpulse 1.4s ease-in-out infinite;
}

@keyframes recpulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 7px var(--comb); }
  50%      { opacity: 0.35; transform: scale(0.72); box-shadow: 0 0 2px var(--comb); }
}

.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 1.6rem;
}

.wave i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--alpine);
  height: 30%;
  animation: wavebar 1.1s ease-in-out infinite;
}

.wave i:nth-child(1) { animation-delay: 0s; }
.wave i:nth-child(2) { animation-delay: 0.12s; }
.wave i:nth-child(3) { animation-delay: 0.24s; }
.wave i:nth-child(4) { animation-delay: 0.36s; }
.wave i:nth-child(5) { animation-delay: 0.2s; }
.wave i:nth-child(6) { animation-delay: 0.08s; }
.wave i:nth-child(7) { animation-delay: 0.3s; }

@keyframes wavebar {
  0%, 100% { height: 25%; }
  50%      { height: 95%; }
}

.flow-arrow { color: var(--slate); font-size: 1.1rem; opacity: 0.6; }

.typed {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  max-width: 100%;
  font-size: 0.9rem;
}

.typed-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 40ch;
  animation: typing 7s steps(36, end) infinite;
}

@keyframes typing {
  0%, 8%    { max-width: 0; }
  62%, 100% { max-width: 40ch; }
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--comb);
  transform: translateY(0.15em);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   CTA GRID
   ============================================================ */

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.2rem;
  max-width: 100%;
}

.cta-grid > * { min-width: 0; }

/* In the hero the CTA cards share the left column with the icon beside them,
   so stack them full-width: Download on top, Homebrew below. Long commands
   then wrap cleanly at spaces instead of mid-token. */
.hero .cta-grid {
  grid-template-columns: 1fr;
  max-width: 40rem;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* Primary download card: rust top rail */
.cta-card:first-child {
  position: relative;
  overflow: hidden;
}

.cta-card:first-child::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--comb) 40%, var(--comb-bright) 60%, transparent 100%);
}

@media (hover: hover) {
  .cta-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.cta-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cta-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--slate);
}

.cta-card .cmd { margin: 0; }

/* ============================================================
   BUTTON
   ============================================================ */

.btn {
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.78rem 1.6rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  background: var(--comb);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(22,34,44,0.15), 0 8px 20px -8px rgba(181,80,47,0.45);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--comb-bright);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 3px rgba(22,34,44,0.15), 0 12px 26px -8px rgba(181,80,47,0.55);
}

.btn:focus-visible {
  outline: 2px solid var(--alpine);
  outline-offset: 2px;
}

/* ============================================================
   COMMAND BLOCKS
   ============================================================ */

.cmd {
  position: relative;
  margin: 0 0 1rem;
  border-radius: 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
}

.cmd pre {
  margin: 0;
  /* right padding reserves space for the absolutely-positioned copy button */
  padding: 1rem 5.5rem 1rem 1.25rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.83rem;
  line-height: 1.75;
  color: var(--code-fg);
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--code-border);
  border-radius: 7px;
  background: transparent;
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.copy-btn:hover { border-color: var(--code-fg); }
.copy-btn:focus-visible {
  outline: 2px solid var(--alpine);
  outline-offset: 2px;
}
.copy-btn.copied { color: #7ecfa4; border-color: #7ecfa4; }

/* ============================================================
   DEMO VIDEO — macOS window frame
   ============================================================ */

.demo-window {
  max-width: 54rem;
  border: 1px solid var(--ice);
  border-radius: 14px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--card-shadow);
}

.demo-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--paper);
  border-bottom: 1px solid var(--ice);
}

.demo-chrome .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.demo-chrome .dot-r { background: #ff5f57; }
.demo-chrome .dot-y { background: #febc2e; }
.demo-chrome .dot-g { background: #28c840; }

.demo-filename {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-video {
  display: block;
  width: 100%;
  background: var(--code-bg);
}

/* ============================================================
   STEPS (HOW IT WORKS) — connected track
   ============================================================ */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 980px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  /* horizontal connector line, visible between cards */
  .steps::before {
    content: "";
    position: absolute;
    top: 2.75rem;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: var(--ice-strong);
  }
}

@media (max-width: 599px) {
  /* vertical connector line on mobile */
  .steps::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    left: 2.75rem;
    width: 1px;
    background: var(--ice-strong);
  }
}

.steps li {
  position: relative;
  z-index: 1;
  padding: 1.6rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .steps li:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1rem;
  border: 1px solid var(--ice-strong);
  border-radius: 10px;
  background: var(--glacier);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--alpine);
}

.steps h3 { font-size: 1rem; }
.steps p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--slate);
}

.steps kbd {
  padding: 0.05em 0.42em;
  border: 1px solid var(--ice);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--snow);
  font-size: 0.85em;
  color: var(--ink);
}

/* ============================================================
   FEATURES
   ============================================================ */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.2rem;
}

.feature {
  padding: 1.6rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .feature:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

/* Vertical rust accent bar left of h3 */
.feature h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.feature h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.15em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--comb), var(--comb-bright));
  flex-shrink: 0;
}

.feature p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--slate);
}

/* ============================================================
   INSTALL
   ============================================================ */

.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.2rem;
  align-items: start;
}

.install-card {
  padding: 1.75rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .install-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.install-card h3 { margin-bottom: 0.9rem; }
.install-card p { font-size: 0.91rem; color: var(--slate); }
.install-card .btn { margin-top: 0.5rem; }

.install-card ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  font-size: 0.91rem;
  color: var(--slate);
}
.install-card ol li { margin-bottom: 0.4rem; }

/* ============================================================
   PERMISSIONS
   ============================================================ */

.perm-cmd { max-width: 34rem; }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.perm-card {
  padding: 1.6rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .perm-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.perm-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.18rem 0.6rem;
  border: 1px solid var(--ice-strong);
  border-radius: 6px;
  background: var(--glacier);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--alpine);
}

.perm-card p {
  margin: 0 0 0.9rem;
  font-size: 0.91rem;
  color: var(--slate);
}

.settings-path {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: var(--snow);
  border: 1px solid var(--ice);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.6;
  color: var(--ink);
}

.note {
  max-width: 44rem;
  padding: 1.05rem 1.3rem;
  border-left: 3px solid var(--comb);
  border-radius: 0 12px 12px 0;
  background: var(--comb-soft);
  font-size: 0.91rem;
}
.note p { margin: 0; }
.note + .note { margin-top: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--glacier);
  border-top: 1px solid var(--ice);
  padding-block: 2.5rem 3.5rem;
  font-size: 0.88rem;
  color: var(--slate);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
}

.footer-note {
  width: 100%;
  margin: 0;
  font-size: 0.8rem;
}

/* ============================================================
   SCROLL FADE-IN ANIMATIONS
   ============================================================ */

.anim-target {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.anim-target.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Grid item stagger */
.features .feature:nth-child(2) { transition-delay: 0.07s; }
.features .feature:nth-child(3) { transition-delay: 0.14s; }
.features .feature:nth-child(4) { transition-delay: 0.07s; }
.features .feature:nth-child(5) { transition-delay: 0.14s; }
.features .feature:nth-child(6) { transition-delay: 0.21s; }
.steps li:nth-child(2)           { transition-delay: 0.08s; }
.steps li:nth-child(3)           { transition-delay: 0.16s; }
.steps li:nth-child(4)           { transition-delay: 0.24s; }
.cta-card:nth-child(2)           { transition-delay: 0.09s; }
.install-card:nth-child(2)       { transition-delay: 0.09s; }
.perm-card:nth-child(2)          { transition-delay: 0.08s; }
.perm-card:nth-child(3)          { transition-delay: 0.16s; }

/* ============================================================
   MODEL CARDS
   ============================================================ */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.model-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .model-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.model-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.model-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--glacier);
  border: 1px solid var(--ice-strong);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--alpine);
  flex-shrink: 0;
}

.model-header h3 { margin: 0; }

.model-id {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.65;
}

.model-card > p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--slate);
}

.model-hub-hint {
  margin-top: 0.5rem;
  padding: 1.5rem;
  border: 1px dashed var(--tan);
  border-radius: 14px;
  background: transparent;
}

.model-hub-hint p {
  margin: 0 0 0.9rem;
  font-size: 0.91rem;
  color: var(--slate);
}

.model-hub-hint .cmd { margin: 0; }

/* ============================================================
   AI CORRECTION SECTION
   ============================================================ */

.correction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.correction-card {
  padding: 1.75rem;
  border: 1px solid var(--ice);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .correction-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
  }
}

.correction-card h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.correction-card h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.15em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--comb), var(--comb-bright));
  flex-shrink: 0;
}

.correction-card p {
  margin: 0 0 1rem;
  font-size: 0.91rem;
  color: var(--slate);
}

.correction-card .cmd { margin: 0; }

.correction-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--ice-strong);
  border-radius: 14px;
  background: var(--paper);
}

.correction-privacy::before {
  content: "🔒";
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.correction-privacy p { margin: 0; font-size: 0.91rem; color: var(--slate); }
.correction-privacy strong { color: var(--ink); }

/* ============================================================
   DOCS PAGE — COMMAND TABLES
   ============================================================ */

.table-wrap {
  border: 1px solid var(--ice);
  border-radius: 14px;
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 2rem;
  background: var(--paper);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-wrap th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--alpine);
  background: var(--glacier);
  border-bottom: 1px solid var(--ice);
}

.table-wrap td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--ice);
  vertical-align: top;
  color: var(--slate);
  line-height: 1.55;
}

.table-wrap td:first-child {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
}

.table-wrap tr:last-child td { border-bottom: none; }

/* ============================================================
   DOCS PAGE — PAGE LAYOUT
   ============================================================ */

.docs-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.docs-toc a {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--ice-strong);
  border-radius: 999px;
  font-size: 0.83rem;
  text-decoration: none;
  color: var(--slate);
  background: var(--paper);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.docs-toc a:hover {
  border-color: var(--comb);
  color: var(--ink);
}

.docs-section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--ice);
}

.docs-section:first-of-type { border-top: none; }

.docs-section h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.config-key {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--code-border);
}

/* ============================================================
   LICENSE PAGE
   ============================================================ */

.license-content {
  max-width: 52rem;
}

.license-content h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.dep-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.75rem;
}

.dep-list li {
  padding: 0.8rem 1rem;
  border: 1px solid var(--ice);
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.87rem;
}

.dep-list li strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.dep-list li span { color: var(--slate); font-size: 0.82rem; }

/* ============================================================
   HERO ENTRANCE ANIMATIONS (page load, CSS-only)
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 {
    animation: hero-up 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .lede {
    animation: hero-up 0.75s 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .flow-strip {
    animation: hero-up 0.75s 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .hero .cta-grid {
    animation: hero-up 0.75s 0.26s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .hero-visual {
    animation: hero-up 0.75s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
}

@keyframes hero-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — HERO COLLAPSE
   ============================================================ */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  /* icon first, smaller */
  .hero-visual {
    order: -1;
    justify-content: flex-start;
  }
  .hero-icon {
    width: 148px;
  }
}

/* ============================================================
   REDUCED MOTION + SMALL SCREENS
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .keycap, .rec-dot, .wave i, .typed-text, .caret,
  .hero-icon-tile, .anim-target, .hero-visual,
  .hero h1, .lede, .flow-strip, .hero .cta-grid {
    animation: none !important;
    transition: none !important;
  }

  .btn, .feature, .steps li, .cta-card, .install-card,
  .perm-card, .model-card, .correction-card {
    transition: none !important;
  }

  .btn:hover, .feature:hover, .steps li:hover, .cta-card:hover,
  .install-card:hover, .perm-card:hover, .model-card:hover,
  .correction-card:hover { transform: none; }

  .anim-target { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 420px) {
  .flow-strip  { padding: 0.9rem 1rem; gap: 0.7rem; }
  .flow-arrow  { display: none; }
  .cmd pre     { padding-right: 1.1rem; padding-top: 2.5rem; }
  .hero-icon   { width: 120px; }
}
