/*
 * PAIRWIT BRAND — LOCKED
 * Do not restyle without an explicit brand decision.
 * Matches kimicode-light TUI: cream canvas, ink text, Trello-blue accent.
 * Fonts: Sora (brand) · IBM Plex Sans (body) · IBM Plex Mono (code)
 */
:root {
  --cream: #fdfcf5; /* canvas */
  --cream-deep: #f5f4f1; /* alt surface / code chip */
  --surface: #ffffff;
  --border: #e8e4d9;
  --text: #3d3929;
  --muted: #8a8580;
  --blue: #0079bf; /* accent — locked */
  --blue-deep: #026aa7;
  --green: #6baa84;
  --orange: #d4a574;
  --font-brand: "Sora", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--blue-deep);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--cream-deep);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 0.85rem;
}

/* ── Nav ───────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-left: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-left));
  padding-right: max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-right));
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  padding: 0.15rem 1.25rem 0.1rem 0;
  overflow: visible;
}

.nav-mascot {
  width: 3.75rem;
  height: 3.75rem;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  border-radius: 8px;
}

.nav-beta-ribbon {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  z-index: 1;
  transform: rotate(26deg);
  transform-origin: center;
  padding: 0.12rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--blue);
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(61, 57, 41, 0.12);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--blue);
  color: var(--blue);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.92rem;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--blue);
}

/* ── Hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 4vw, 2.5rem)
    clamp(3rem, 6vh, 4rem);
  overflow: hidden;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 78% 42%, rgba(0, 121, 191, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 12% 80%, rgba(107, 170, 132, 0.1), transparent 55%),
    linear-gradient(165deg, #fdfcf5 0%, #f7f5ec 48%, #eef6fb 100%);
  z-index: 0;
}

.hero-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M0 60h120M60 0v120' stroke='%23E8E4D9' stroke-width='1'/%3E%3C/svg%3E");
  mask-image: linear-gradient(to bottom, black 20%, transparent 90%);
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-60px, -40px, 0);
  }
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(3.2rem, 9vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--text);
  animation: rise 0.9s var(--ease) both;
}

.hero h1,
.hero-title {
  margin: 0 0 1rem;
  max-width: 22ch;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.65rem, 3.6vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  animation: rise 0.9s var(--ease) 0.08s both;
}

/* Action beats — fire accents cycle one after another */
.hero-act {
  display: inline;
  color: var(--text);
  transition: color 0.55s var(--ease);
}

.hero-act.is-hot[data-act="0"] {
  color: #c45c26;
}

.hero-act.is-hot[data-act="1"] {
  color: #c97b7b;
}

.hero-act.is-hot[data-act="2"] {
  color: #b85c38;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-act.is-hot[data-act="0"] {
    color: transparent;
    background-image: linear-gradient(105deg, #e8a87c 0%, #d4a574 45%, #c45c26 100%);
    background-size: 160% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: fire-shift 2.2s var(--ease) infinite alternate;
  }

  .hero-act.is-hot[data-act="1"] {
    color: transparent;
    background-image: linear-gradient(105deg, #e07a5f 0%, #c97b7b 50%, #b85c38 100%);
    background-size: 160% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: fire-shift 2.2s var(--ease) infinite alternate;
  }

  .hero-act.is-hot[data-act="2"] {
    color: transparent;
    background-image: linear-gradient(105deg, #d4a574 0%, #c45c26 40%, #c97b7b 100%);
    background-size: 160% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: fire-shift 2.2s var(--ease) infinite alternate;
  }
}

@keyframes fire-shift {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-act.is-hot {
    animation: none !important;
    background-image: none !important;
    color: #c45c26 !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
  }
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.05rem;
  animation: rise 0.9s var(--ease) 0.14s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  animation: rise 0.9s var(--ease) 0.2s both;
}

.install-shell {
  display: flex;
  align-items: stretch;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(61, 57, 41, 0.04);
}

.install-shell code {
  display: block;
  padding: 0.85rem 1rem;
  background: transparent;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow-x: auto;
}

.copy-btn {
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--blue);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0 1.15rem;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.copy-btn:hover {
  background: var(--blue-deep);
}

.copy-btn.copied {
  background: var(--green);
}

.text-link {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* TUI mock */

.hero-visual {
  display: flex;
  justify-content: flex-end;
  animation: rise 1s var(--ease) 0.18s both;
}

.tui-mock {
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(61, 57, 41, 0.08),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
}

.tui-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.tui-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.tui-dot:nth-child(1) {
  background: #c97b7b;
}
.tui-dot:nth-child(2) {
  background: var(--orange);
}
.tui-dot:nth-child(3) {
  background: var(--green);
}

.tui-title {
  margin-left: 0.5rem;
}

.tui-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  min-height: 280px;
}

.tui-files {
  padding: 0.75rem 0.65rem;
  border-right: 1px solid var(--border);
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
}

.tui-files-h {
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.tui-line.dim,
.tui-line.muted {
  color: var(--muted);
}
.tui-line.accent {
  color: var(--blue);
  font-weight: 500;
}

.tui-chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem;
  background: var(--cream);
}

.tui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  font-size: 0.84rem;
}

.tui-card p {
  margin: 0.2rem 0 0;
}

.tui-card-h {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tui-card.pairwit {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--border));
}

.tui-prompt {
  margin-top: auto;
  padding: 0.55rem 0.7rem;
  background: #deebff;
  color: #172b4d;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-radius: 3px;
}

.tui-prompt span {
  color: var(--blue);
  font-weight: 500;
  margin-right: 0.4rem;
}

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

.section {
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.25rem, 4vw, 2.5rem);
  max-width: calc(var(--max) + 5rem);
  margin: 0 auto;
}

.section.alt {
  background:
    linear-gradient(180deg, transparent, rgba(245, 244, 241, 0.9)),
    var(--cream-deep);
  max-width: none;
  padding-left: max(clamp(1.25rem, 4vw, 2.5rem), calc((100% - var(--max)) / 2));
  padding-right: max(clamp(1.25rem, 4vw, 2.5rem), calc((100% - var(--max)) / 2));
}

.section-head {
  max-width: 36rem;
  margin-bottom: 2.25rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.section-more {
  margin: 1.75rem 0 0;
}

.section-more a {
  font-family: var(--font-brand);
  font-weight: 500;
  text-decoration: none;
}

/* ── How-to interactive walkthrough ────────────────────── */

.howto {
  display: grid;
  gap: 1.25rem;
  max-width: var(--max);
}

.howto-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.howto-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.howto-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--blue) 40%, var(--border));
}

.howto-tab.is-active {
  color: var(--text);
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.howto-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  margin-right: 0.35rem;
}

.howto-stage {
  position: relative;
}

.howto-scene[hidden] {
  display: none;
}

.howto-mock {
  width: 100%;
  max-width: none;
}

.howto-caption {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 42rem;
}

/* Real-TUI frame (matches ref-desk / ref-chat screenshots) */

.pw-frame {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  font-family: var(--font-mono);
}

.pw-chrome {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.pw-chrome-l {
  justify-self: start;
}

.pw-chrome-c {
  justify-self: center;
  color: var(--text);
  font-weight: 500;
}

.pw-chrome-r {
  justify-self: end;
}

.pw-chrome em {
  font-style: normal;
  color: var(--blue);
  font-weight: 500;
}

.pw-menu {
  margin-right: 0.35rem;
  color: var(--muted);
}

.pw-prompt-bar {
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  background: #deebff;
  color: #172b4d;
  font-size: 0.78rem;
  border-top: 1px solid color-mix(in srgb, var(--blue) 35%, var(--border));
}

.pw-prompt-bar span {
  color: var(--blue);
  font-weight: 500;
  margin-right: 0.4rem;
}

.pw-prompt-bar.inset {
  margin: 0.5rem 0.4rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--border));
  border-radius: 2px;
}

.pw-mascot {
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
}

.pw-mascot.compact {
  padding: 0.75rem 0.5rem 0.35rem;
}

.pw-mascot.mini {
  padding: 0.85rem 0.25rem 0.25rem;
  flex: 1;
}

.pw-mascot-img {
  display: block;
  margin: 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  image-rendering: pixelated;
}

.pw-mascot-img.lg {
  width: 6.5rem;
  height: 6.5rem;
}

.pw-mascot.mini .pw-mascot-img {
  width: 2.75rem;
  height: 2.75rem;
}

.pw-mascot.compact .pw-mascot-img {
  width: 3.75rem;
  height: 3.75rem;
}

.pw-wordmark {
  margin: 0.35rem 0 0;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--blue);
}

.pw-logo {
  margin: 0 auto;
  display: inline-block;
  text-align: left;
  font-size: 0.62rem;
  line-height: 1.15;
  color: var(--blue);
  font-weight: 500;
  white-space: pre;
}

.pw-mascot.mini .pw-logo {
  font-size: 0.55rem;
}

.pw-online {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.pw-hints {
  margin: 0.35rem auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: italic;
  line-height: 1.45;
}

.scene-chat {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem 0.75rem;
  min-height: 320px;
  background: var(--cream);
}

.pw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.55rem 0.7rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text);
  font-family: var(--font-mono);
}

.pw-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
}

.pw-copy {
  color: var(--blue);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  cursor: default;
}

.pw-card p {
  margin: 0;
  line-height: 1.5;
}

.pw-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.pw-card li {
  margin: 0.15rem 0;
}

.pw-card.pairwit {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--border));
}

.pw-stats {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Scene: terminal / launch */

.scene-term {
  padding: 1rem 1.15rem 0.5rem;
  min-height: 220px;
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
}

.scene-term > p {
  margin: 0;
}

.term-prompt {
  color: var(--blue);
  font-weight: 500;
  margin-right: 0.35rem;
}

.term-out {
  color: var(--muted);
}

.term-out.accent {
  color: var(--text);
  font-weight: 500;
}

.term-out .term-tag {
  color: var(--blue);
  font-weight: 500;
}

/* Scene: desk with grips */

.scene-desk {
  display: flex;
  min-height: 300px;
  background: var(--cream);
  user-select: none;
}

.desk-files,
.desk-editor,
.desk-chat {
  flex: 0 0 auto;
  min-width: 64px;
  overflow: hidden;
  background: var(--cream);
}

.desk-files {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
  padding: 0.55rem 0.45rem;
  border-right: 0;
}

.desk-files .tui-line.sel {
  background: var(--cream-deep);
  color: var(--text);
  margin: 0 -0.45rem;
  padding: 0 0.45rem;
}

.desk-chat {
  display: flex;
  flex-direction: column;
  min-width: 100px;
  max-width: 40%;
}

.desk-editor {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 140px;
  border-left: 0;
}

.editor-path {
  padding: 0.35rem 0.55rem;
  font-size: 0.7rem;
  color: var(--blue);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.editor-body {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  flex: 1;
  min-height: 0;
  background: var(--surface);
}

.editor-gutter {
  padding: 0.45rem 0.25rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
  border-right: 1px solid var(--border);
  background: var(--cream);
  user-select: none;
}

.editor-code {
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
  overflow: hidden;
}

.c-kw {
  color: var(--orange);
}
.c-fn {
  color: var(--text);
  font-weight: 500;
}
.c-type {
  color: #5b8a8a;
}
.c-str {
  color: var(--green);
}

.desk-grip {
  flex: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--muted);
  font-size: 0.65rem;
  cursor: col-resize;
  touch-action: none;
  z-index: 1;
}

.desk-grip:hover,
.desk-grip.is-dragging {
  background: color-mix(in srgb, var(--blue) 25%, var(--border));
  color: var(--blue);
}

/* Scene: approval */

.scene-approve {
  padding: 1.15rem 1.2rem 1.3rem;
  min-height: 260px;
  background: var(--cream);
  font-family: var(--font-body);
}

.approve-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--blue);
}

.approve-title {
  margin: 0.35rem 0 0.85rem;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.approve-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.9rem;
}

.approve-box p {
  margin: 0.2rem 0 0;
}

.approve-verb {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}

.approve-target {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue);
}

.approve-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.approve-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.approve-path {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.approve-ask {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  color: var(--text);
}

.approve-actions button,
.approve-row button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
}

.approve-actions button:hover,
.approve-row button:hover {
  border-color: var(--blue);
}

.approve-actions button.is-picked,
.approve-row button.is-picked {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue);
  font-weight: 500;
}

.approve-actions button.deny.is-picked {
  border-color: #c97b7b;
  background: color-mix(in srgb, #c97b7b 12%, var(--surface));
  color: #9a4f4f;
}

.approve-feedback {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.4em;
}

@media (max-width: 700px) {
  .desk-chat,
  .desk-grip {
    display: none;
  }

  .scene-desk {
    flex-direction: column;
    min-height: 0;
  }

  .desk-files {
    width: 100% !important;
    max-width: none;
    max-height: 7.5rem;
    overflow: auto;
    border-bottom: 1px solid var(--border);
  }

  .desk-editor {
    width: 100% !important;
    min-height: 11rem;
  }

  .howto-tab {
    flex: 1 1 calc(50% - 0.4rem);
    min-height: 44px;
  }

  .approve-actions button {
    min-height: 44px;
    flex: 1 1 calc(50% - 0.45rem);
  }

  .pw-chrome {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .pw-chrome-c,
  .pw-chrome-r {
    justify-self: start;
  }

  .pw-logo {
    font-size: 0.5rem;
  }

  .scene-chat {
    min-height: 0;
    padding: 0.35rem 0.65rem 0.65rem;
  }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.is-label,
.isnt-label {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.is-label {
  color: var(--green);
}

.isnt-label {
  color: var(--orange);
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.split > div:last-child .plain-list li::before {
  background: var(--orange);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 1.1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--blue);
  padding-top: 0.15rem;
}

.steps .step-body {
  min-width: 0;
}

.steps strong {
  display: block;
  font-family: var(--font-brand);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.steps .step-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.steps code {
  font-size: 0.88em;
  padding: 0.08em 0.28em;
}

.use-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
}

.use-grid h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.use-grid p {
  margin: 0;
  color: var(--muted);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 1.75rem 1.4rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
}

.timeline .when {
  display: block;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.philo {
  display: grid;
  gap: 1.35rem;
  max-width: 44rem;
}

.philo p {
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
}

.philo strong {
  font-family: var(--font-brand);
  font-weight: 600;
  color: var(--text);
}

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

.site-footer {
  display: grid;
  gap: 1rem;
  padding: 2.5rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
  border-top: 1px solid var(--border);
  background: var(--cream-deep);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-mascot {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.footer-links a {
  text-decoration: none;
  font-weight: 500;
}

/* Professional multi-column footer */

.site-footer-pro {
  display: block;
  padding: 3.5rem clamp(1.25rem, 4vw, 2.5rem) 2rem;
  background: var(--cream);
  border-top: 1px solid var(--border);
}

.footer-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 2rem 2.5rem;
}

.footer-brand-block .muted {
  margin: 0.5rem 0 0;
  max-width: 18rem;
  font-size: 0.95rem;
}

.footer-badge {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--border));
  border-radius: 3px;
}

.footer-col-h {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--blue);
}

.footer-bar {
  max-width: 1120px;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.footer-bar p {
  margin: 0;
}

.nav-cta {
  margin-left: 0.35rem;
  padding: 0.35rem 0.75rem !important;
  border-radius: 4px;
  background: var(--text);
  color: var(--cream) !important;
  text-decoration: none !important;
  font-weight: 500;
}

.nav-cta:hover {
  background: var(--blue);
  color: var(--cream) !important;
}

/* Unified terminal shell — same chrome language everywhere */

.tui-shell {
  margin: 0;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 16px 40px rgba(61, 57, 41, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.tui-shell .pw-frame,
.tui-shell .tui-mock,
.howto-mock.pw-frame {
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--cream);
}

.howto-mock.pw-frame {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 16px 40px rgba(61, 57, 41, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.hero-desk {
  min-height: 280px;
}

.feature-desk {
  min-height: 200px;
}

.feature-chat {
  min-height: 0;
  padding-top: 0.75rem;
}

/* Legacy shot-frame (kept for optional PNG embeds) */

.shot-frame {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 16px 40px rgba(61, 57, 41, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.shot-chrome {
  display: none;
}

.shot-cap {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--cream);
}

.hero-revamp {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 2rem 2.5rem;
  padding-bottom: 3.5rem;
  max-width: 1120px;
  margin-inline: auto;
  min-height: auto;
}

.hero-revamp .hero-copy {
  max-width: 34rem;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.hero-mascot {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.hero-brand-row .hero-eyebrow {
  margin: 0;
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.hero-shot {
  width: 100%;
  max-width: none;
  animation: rise 1s var(--ease) 0.12s both;
}

.hero-live {
  min-height: 26rem;
  display: flex;
  flex-direction: column;
}

.hero-live-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem 0.5rem;
}

.hero-gate {
  margin-top: 0.25rem;
  min-height: 0;
  padding: 0.75rem 0.85rem;
  opacity: 0;
  transform: translateY(0.45rem);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.hero-gate .approve-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.hero-live.is-alive .hero-gate {
  animation: hero-gate-in 0.55s var(--ease) 0.45s forwards;
}

.hero-choice {
  display: inline-block;
  padding: 0.28rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.hero-choice.is-focus {
  color: var(--cream);
  background: var(--blue);
  border-color: var(--blue);
}

.hero-diff {
  margin-top: 0.15rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(0.35rem);
}

.hero-live.is-alive .hero-diff {
  animation: hero-gate-in 0.5s var(--ease) 0.95s forwards;
}

.hero-diff-meta {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-diff-body {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

.hero-diff-body .diff-add {
  color: #2d6a4f;
}

.hero-diff-body .diff-del {
  color: #9a4f4f;
}

.pw-prompt-bar.has-caret::after {
  content: "";
  display: inline-block;
  width: 0.45ch;
  height: 1em;
  margin-left: 0.15rem;
  vertical-align: -0.12em;
  background: var(--blue);
  animation: caret-blink 1.05s steps(1, end) infinite;
}

@keyframes caret-blink {
  0%,
  45% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes hero-gate-in {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-gate,
  .hero-diff {
    opacity: 1;
    transform: none;
  }

  .hero-live.is-alive .hero-gate,
  .hero-live.is-alive .hero-diff {
    animation: none;
  }

  .pw-prompt-bar.has-caret::after {
    animation: none;
    opacity: 1;
  }
}

.hero-revamp .hero-visual {
  display: none;
}

.ship-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2rem 2.5rem;
  align-items: start;
}

.schedule-shot {
  margin: 0;
}

.schedule-desk {
  min-height: 14rem;
  border: 0;
  border-radius: 0;
}

.schedule-desk-body {
  display: grid;
  grid-template-columns: minmax(12rem, 0.95fr) minmax(0, 1.05fr);
  min-height: 12rem;
  flex: 1;
}

.schedule-desk-simple {
  min-height: 11rem;
}

.sch-pane {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
}

.sch-title {
  padding: 0.35rem 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.sch-tabs {
  padding: 0 0.65rem 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sch-tabs .is-on {
  color: var(--text);
  font-weight: 500;
}

.sch-list {
  border-top: 1px solid var(--border);
  flex: 1;
}

.sch-item {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}

.sch-item.is-hi {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.sch-item.is-due .sch-due {
  color: var(--orange);
}

.sch-due {
  margin-top: 0.15rem;
  padding-left: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.sch-detail,
.sch-hint {
  padding: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.sch-detail {
  border-top: 1px solid var(--border);
  background: var(--cream-deep);
}

.sch-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--cream);
}

.provider-desk {
  min-height: 12rem;
}

.provider-term {
  padding: 0.85rem 1rem 0.5rem;
  min-height: 8.5rem;
}

.term-tag {
  color: var(--blue);
  font-weight: 500;
  font-size: 0.72rem;
}

.term-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.feature-row {
  max-width: 1120px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem 2.5rem;
  align-items: center;
}

.feature-row.reverse {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.feature-row.reverse .feature-copy {
  order: 2;
}

.feature-row.reverse .feature-shot,
.feature-row.reverse .feature-aside {
  order: 1;
}

.feature-copy h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.feature-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}

.feature-copy .plain-list {
  margin: 0 0 1rem;
}

.feature-copy .plain-list.tight.is-list li,
.feature-copy .plain-list.tight.isnt-list li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  column-gap: 0.55rem;
  align-items: baseline;
  padding: 0.5rem 0;
  padding-left: 0;
}

.feature-copy .plain-list.tight.is-list li::before,
.feature-copy .plain-list.tight.isnt-list li::before {
  position: static !important;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: transparent !important;
  line-height: inherit;
  text-align: center;
}

.feature-copy .plain-list.tight.is-list li::before {
  content: "✓";
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 600;
}

.feature-copy .plain-list.tight.isnt-list li {
  color: var(--muted);
}

.feature-copy .plain-list.tight.isnt-list li::before {
  content: "✕";
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 600;
}

.muted-list li {
  color: var(--muted);
}

.feature-shot {
  margin: 0;
}

.prefooter {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.5rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.prefooter-mascot {
  display: block;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1rem;
  object-fit: contain;
  image-rendering: pixelated;
}

.prefooter h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prefooter p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.prefooter .cta-row {
  justify-content: center;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand-block {
    grid-column: 1 / -1;
  }

  .hero-revamp,
  .ship-layout,
  .feature-row,
  .feature-row.reverse,
  .schedule-desk-body {
    grid-template-columns: 1fr;
  }

  .hero-revamp .hero-copy {
    order: 1;
  }

  .hero-revamp .hero-shot {
    order: 2;
  }

  .feature-row.reverse .feature-copy,
  .feature-row.reverse .feature-shot,
  .feature-row.reverse .feature-aside {
    order: initial;
  }

  .sch-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sch-chat {
    min-height: 8rem;
  }

  .hero-live {
    min-height: 0;
  }

  .hero-diff-body {
    font-size: 0.68rem;
  }

  .nav-cta {
    margin-left: 0;
    display: inline-block;
    width: fit-content;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: none;
    font-size: clamp(1.45rem, 7vw, 1.85rem);
  }

  .lede {
    max-width: none;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .install-shell {
    width: 100%;
  }

  .install-shell code {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  .pw-chrome-r {
    display: none;
  }

  .schedule-desk-simple .sch-chat {
    display: none;
  }

  .feature-desk .desk-files {
    width: 100% !important;
    max-height: 6.5rem;
  }

  .hero-choice {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
  }
}

/* ── Reveal ────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Shipping spotlight — /schedule */

.ship-spotlight {
  border-block: 1px solid var(--border);
  background:
    linear-gradient(
      105deg,
      color-mix(in srgb, var(--blue) 8%, var(--cream)) 0%,
      var(--cream) 42%,
      var(--cream) 100%
    );
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
}

.ship-kicker {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  animation: ship-pulse 2.8s var(--ease) infinite;
}

@keyframes ship-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.ship-spotlight h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  letter-spacing: -0.02em;
  max-width: 28ch;
}

.ship-spotlight h2 code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92em;
  color: var(--blue);
}

.ship-lede {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.ship-points {
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  max-width: 40rem;
}

.ship-points li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text);
  line-height: 1.45;
}

.ship-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 1px;
  background: var(--blue);
}

.ship-more {
  margin: 0;
}

.ship-more a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .ship-kicker {
    animation: none;
  }
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2.25rem;
    padding-bottom: 2.5rem;
    gap: 2rem;
  }

  .hero-visual {
    justify-content: stretch;
    order: 2;
  }

  .hero-copy {
    order: 1;
  }

  .brand {
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .hero-title {
    max-width: none;
  }

  .lede {
    max-width: none;
  }

  .tui-mock {
    width: 100%;
  }

  .split,
  .use-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .site-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .site-nav {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem 0 0.15rem;
    border-top: 1px solid var(--border);
  }

  .site-nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 0.15rem;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }

  .nav-links a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }

  .hero {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .tui-body {
    grid-template-columns: 1fr;
  }

  .tui-files {
    display: none;
  }

  .install-shell {
    flex-direction: column;
    width: 100%;
  }

  .install-shell code {
    white-space: normal;
    word-break: break-word;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .copy-btn {
    border-left: 0;
    border-top: 1px solid var(--border);
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .text-link {
    text-align: center;
    padding: 0.5rem;
  }

  .howto-tab {
    flex: 1 1 100%;
    text-align: left;
  }

  .pw-card {
    font-size: 0.78rem;
  }

  .pw-stats {
    font-size: 0.65rem;
    overflow-wrap: anywhere;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── Guide page ────────────────────────────────────────── */

.page-guide {
  scroll-padding-top: 5.5rem;
}

.guide-main {
  padding-bottom: 3rem;
}

.guide-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem) 1.75rem;
  padding-left: max(clamp(1.25rem, 4vw, 2.5rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 4vw, 2.5rem), env(safe-area-inset-right));
  border-bottom: 1px solid var(--border);
}

.guide-eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.guide-hero .guide-eyebrow {
  margin-bottom: 0.75rem;
}

.guide-hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
}

.guide-hero-meta {
  margin: 1.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.guide-hero-meta a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.guide-hero-meta a:hover {
  text-decoration: underline;
}

.lede.narrow {
  max-width: 38rem;
  color: var(--muted);
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
}

.lede.narrow code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--blue-deep);
  background: color-mix(in srgb, var(--blue) 8%, var(--cream));
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.guide-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(12.5rem, 15.5rem) minmax(0, 1fr);
  gap: 0 2.5rem;
  align-items: start;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  padding-left: max(clamp(1.25rem, 4vw, 2.5rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 4vw, 2.5rem), env(safe-area-inset-right));
}

.guide-sidebar {
  position: sticky;
  top: 4.25rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 1.75rem 0 2rem;
  scrollbar-width: thin;
}

.guide-side-label {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.guide-side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
}

.guide-side-list a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem 0.42rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
  transition:
    color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.guide-side-list a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--blue) 5%, transparent);
}

.guide-side-list a.is-active {
  color: var(--blue-deep);
  border-left-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 7%, transparent);
  font-weight: 500;
}

.guide-side-list a.is-featured {
  color: var(--text);
}

.guide-new {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--cream));
  padding: 0.12em 0.4em;
  border-radius: 2px;
  line-height: 1.2;
}

.guide-mobile-toc {
  display: none;
}

.guide-body {
  min-width: 0;
  padding: 0.5rem 0 2rem;
}

.guide-section {
  max-width: 42rem;
  margin: 0;
  padding: 2rem 0 2.15rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5.25rem;
}

.guide-section:last-of-type {
  border-bottom: 0;
}

.guide-section.is-featured-section {
  background: linear-gradient(
    105deg,
    color-mix(in srgb, var(--blue) 7%, var(--cream)) 0%,
    var(--cream) 55%
  );
  margin-inline: -1rem;
  padding-inline: 1rem;
  border-radius: 6px;
  border-bottom-color: transparent;
}

.guide-section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.guide-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: 0.02em;
}

.guide-lead {
  margin: 0 0 1.25rem;
  max-width: 40rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.guide-follow {
  margin: 1.15rem 0 0;
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.guide-defs {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  max-width: 42rem;
}

.guide-defs > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7.5rem) minmax(0, 1fr);
  gap: 0.65rem 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.guide-defs dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.guide-defs dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted);
}

.guide-defs dd code,
.guide-lead code,
.guide-follow code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--blue-deep);
}

.guide-section > p {
  margin: 0 0 1rem;
  max-width: 40rem;
  color: var(--muted);
}

.guide-list {
  max-width: 42rem;
}

.guide-list strong {
  color: var(--text);
  font-weight: 600;
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: gstep;
  max-width: 42rem;
}

.guide-steps li {
  counter-increment: gstep;
  position: relative;
  padding: 1.15rem 0 1.15rem 2.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.guide-steps li:last-child {
  border-bottom: 1px solid var(--border);
}

.guide-steps li::before {
  content: counter(gstep, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--blue);
}

.guide-step-title {
  display: block;
  margin: 0 0 0.45rem;
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.guide-steps li > p {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  line-height: 1.55;
}

.guide-section .guide-eyebrow {
  margin-bottom: 0.5rem;
}

.shell {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
}

.shell code {
  background: transparent;
  padding: 0;
  font-size: 0.9rem;
}

.note {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 40rem;
}

.guide-callout {
  margin: 1.25rem 0 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--blue);
  background: var(--surface);
  max-width: 40rem;
}

.callout-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.guide-callout p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.kbd-table {
  display: grid;
  gap: 0;
  max-width: 40rem;
  border-top: 1px solid var(--border);
}

.kbd-row {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.kbd-row.head {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.35rem;
}

.kbd-row span:last-child {
  color: var(--muted);
}

.kbd-row.head span:last-child {
  color: var(--muted);
}

.guide-back {
  margin: 2rem 0 0;
  padding: 0;
}

.guide-back a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .guide-sidebar {
    display: none;
  }

  .guide-mobile-toc {
    display: block;
    position: sticky;
    top: 3.6rem;
    z-index: 15;
    margin: 0 -0.15rem 0.5rem;
    padding: 0.75rem 0;
    background: color-mix(in srgb, var(--cream) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }

  .guide-mobile-label {
    display: block;
    margin: 0 0 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .guide-mobile-toc select {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
  }

  .guide-section.is-featured-section {
    margin-inline: 0;
    padding-inline: 0.85rem;
  }

  .guide-defs > div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 640px) {
  .kbd-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
