/* Showspring Operator Manual — shared stylesheet
   Palette: warm-dark OKLCH, aligned with showspring.com tokens
   Fonts: Funnel Display (display) + Hanken Grotesk (body) + JetBrains Mono (code)
   Layout: reading-width body, left rail nav on desktop, single-column on mobile */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:         oklch(17% 0.004 85);
  --bg-elev:    oklch(22% 0.006 85);
  --bg-card:    oklch(26% 0.008 85);
  --bg-card-hi: oklch(30% 0.010 85);
  --bg-deep:    oklch(8%  0.005 82);
  --border:     oklch(32% 0.010 85);
  --border-hi:  oklch(42% 0.013 85);
  --rule:       oklch(28% 0.009 85);

  --text:       oklch(93% 0.014 85);
  --text-mute:  oklch(64% 0.012 85);
  --text-hint:  oklch(58% 0.010 85);

  --amber:      oklch(80% 0.165 82);
  --amber-dim:  oklch(62% 0.130 82);
  --amber-soft: color-mix(in oklch, var(--amber), transparent 88%);
  --on-amber:   oklch(18% 0.004 85);

  --font-display: 'Funnel Display', system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius:    10px;
  --radius-sm: 6px;
  --max-body:  68ch;
  --rail-w:    220px;
  --top-h:     56px;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }

/* ── Skip link ───────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: var(--amber);
  color: var(--on-amber);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--top-h);
  background: color-mix(in oklch, var(--bg), transparent 12%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-inline: 24px;
  gap: 16px;
}
.topbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-brand img {
  width: 22px;
  height: 22px;
}
.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.topbar-label {
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 500;
  flex-shrink: 0;
}
.topbar-spacer { flex: 1; }
.topbar-app-link {
  font-size: 13px;
  color: var(--amber);
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.topbar-app-link:hover { opacity: 0.75; }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mute);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-toggle svg { width: 16px; height: 16px; }

/* ── Layout shell ────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: calc(100vh - var(--top-h));
}

/* ── Left rail ───────────────────────────────────────────────────── */
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 28px 0 48px;
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  overflow-x: hidden;
}
.rail-section {
  padding: 0 16px;
  margin-bottom: 24px;
}
.rail-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hint);
  padding: 0 8px;
  margin-bottom: 6px;
}
.rail-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-nav a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mute);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.3;
}
.rail-nav a:hover {
  background: var(--bg-card);
  color: var(--text);
}
.rail-nav a.active {
  background: var(--amber-soft);
  color: var(--amber);
}
.rail-nav a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

/* ── Main content ────────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  padding: 48px 40px 80px;
}
.content-inner {
  max-width: var(--max-body);
  margin: 0 auto;
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}
.page-intro {
  font-size: 17px;
  color: var(--text-mute);
  line-height: 1.6;
  max-width: 58ch;
  margin-bottom: 40px;
}
.page-divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

/* ── Section headings ────────────────────────────────────────────── */
.section-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
  margin-top: 48px;
}
.section-heading:first-child { margin-top: 0; }

/* ── Step cards ──────────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}
.step-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 20px 16px;
  transition: border-color 0.15s;
}
.step-card:hover {
  border-color: var(--border-hi);
}
.step-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber-soft);
  border: 1px solid color-mix(in oklch, var(--amber), transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  margin-top: 1px;
}
.step-body { flex: 1; min-width: 0; }
.step-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.2;
}
.step-title code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--amber);
  font-weight: 400;
}
.step-desc {
  font-size: 14px;
  color: var(--text-mute);
  line-height: 1.5;
}
.step-desc code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--amber);
}
.step-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 6px;
}

/* ── Callout blocks ──────────────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.55;
  border-left: 3px solid;
}
.callout strong {
  display: block;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.callout-tip {
  background: color-mix(in oklch, var(--amber), transparent 92%);
  border-color: var(--amber-dim);
  color: var(--text-mute);
}
.callout-tip strong { color: var(--amber); }
.callout-warn {
  background: color-mix(in oklch, oklch(72% 0.15 55), transparent 92%);
  border-color: oklch(65% 0.14 55);
  color: var(--text-mute);
}
.callout-warn strong { color: oklch(72% 0.15 55); }
.callout-info {
  background: color-mix(in oklch, var(--bg-card), transparent 30%);
  border-color: var(--border-hi);
  color: var(--text-mute);
}
.callout-info strong { color: var(--text); }

/* ── Guide link cards (index / "what's next") ────────────────────── */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.guide-card:hover {
  border-color: var(--border-hi);
  background: var(--bg-card-hi);
}
.guide-card:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.guide-card-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.guide-card-label::after {
  content: ' →';
  color: var(--amber-dim);
}
.guide-card-desc {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.45;
}

/* ── Body prose ──────────────────────────────────────────────────── */
.prose p { margin-bottom: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.prose li { margin-bottom: 6px; font-size: 15px; color: var(--text-mute); line-height: 1.5; }
.prose li:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--amber);
}

/* Inline text emphasis */
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }

/* ── Concept model table ─────────────────────────────────────────── */
.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 24px 0;
}
.model-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-hi);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.model-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--text-mute);
  vertical-align: top;
  line-height: 1.45;
}
.model-table td:first-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.model-table tr:last-child td {
  border-bottom: 0;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.manual-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  font-size: 13px;
  color: var(--text-hint);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  text-align: center;
}
.manual-footer a {
  color: var(--text-mute);
  text-decoration: none;
}
.manual-footer a:hover { color: var(--text); }
.manual-footer .footer-sep {
  margin: 0 10px;
  opacity: 0.4;
}

/* ── Focus rings ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .rail {
    position: fixed;
    top: var(--top-h);
    left: 0;
    height: calc(100vh - var(--top-h));
    width: 260px;
    z-index: 40;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .rail.open {
    transform: translateX(0);
  }
  .rail-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--top-h);
    background: rgba(0,0,0,0.5);
    z-index: 39;
  }
  .rail-backdrop.open {
    display: block;
  }

  .content {
    padding: 32px 20px 64px;
  }

  .guide-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .step-card {
    flex-direction: column;
    gap: 10px;
  }
  .step-badge {
    margin-top: 0;
  }
  .model-table {
    font-size: 13px;
  }
}

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