/*
 * 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: 0.85rem clamp(1rem, 4vw, 2.5rem);
  padding-top: max(0.85rem, 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 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 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: 16ch;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.25;
  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 {
  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-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;
}

/* 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 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  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-actions 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 {
  border-color: var(--blue);
}

.approve-actions 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 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

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

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

.reveal.in {
  opacity: 1;
  transform: 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,
  .guide-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;
  }

  .guide-toc {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.75rem;
    padding-bottom: 0.35rem;
  }

  .guide-toc a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.35rem 0;
  }

  .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 ────────────────────────────────────────── */

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

.guide-hero {
  padding-bottom: 1.5rem;
}

.brand.compact {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.35rem;
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

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

.lede.narrow {
  max-width: 36rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.guide-toc a {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--blue);
}

.guide-section {
  max-width: none;
  margin: 0;
  padding: 2.75rem max(1.5rem, calc((100% - var(--max)) / 2));
}

.guide-section.alt {
  background: var(--cream-deep);
}

.guide-section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.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: 0.85rem 0 0.85rem 2.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

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

.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.95rem;
  color: var(--text);
}

.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(9rem, 14rem) 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.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);
}

.guide-back {
  padding-top: 1rem;
}

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

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