/*
 * claude-guide.sauer.com.au — stylesheet
 * Design spec: /tmp/claude-guide-design-spec.md (2026-05-17)
 * Theme: dark-primary, full light-mode via prefers-color-scheme: light
 * Fonts: Inter (body + display), JetBrains Mono (labels/code/nav)
 * Self-hosted woff2 in /opt/data/claude-guide/fonts/
 */

/* =====================================================================
   COLOUR TOKENS — dark canonical
   ===================================================================== */
:root {
  /* Backgrounds */
  --bg:        #0e0f12;
  --bg-elev:   #16181d;
  --bg-sunk:   #0a0b0e;

  /* Foregrounds */
  --fg:        #e8e6df;
  --fg-strong: #f5f3ec;
  --muted:     #8b8a83;

  /* Rules / borders */
  --rule:       #23252c;
  --rule-strong: #34373f;

  /* Accent — Anthropic warm-orange */
  --accent:     #d97757;
  --accent-dim: #8a4a37;

  /* Secondary */
  --cool: #5c89e0;
  --ok:   #5fa872;
  --warn: #d4a854;

  /* Optional faux-syntax */
  --code-key: #c8a36b;
  --code-str: #97b87a;

  /* Spacing scale (rem) */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4rem;
  --s9: 6rem;

  /* Radii */
  --r-sm: 4px;
  --r:    6px;
  --r-lg: 12px;

  /* Reading widths */
  --max:      38rem;
  --max-wide: 56rem;
}

/* =====================================================================
   LIGHT MODE OVERRIDE
   ===================================================================== */
@media (prefers-color-scheme: light) {
  :root {
    --bg:        #faf8f4;
    --bg-elev:   #ffffff;
    --bg-sunk:   #f3efe7;

    --fg:        #14171c;
    --fg-strong: #000000;
    --muted:     #6b6b66;

    --rule:        #e9e3d6;
    --rule-strong: #c8c2b3;

    --accent:     #b85a32;
    --accent-dim: #7a3a1e;

    --cool: #194291;
    --ok:   #3e7a4e;
    --warn: #c89b3c;

    --code-key: #8b5a1f;
    --code-str: #5a7a3a;
  }
}

/* =====================================================================
   @FONT-FACE — self-hosted woff2
   ===================================================================== */

/* Inter — body / UI / display */
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/Inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/Inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/Inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/Inter-700.woff2") format("woff2");
}

/* JetBrains Mono — labels, code, nav */
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/JetBrainsMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/JetBrainsMono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/JetBrainsMono-600.woff2") format("woff2");
}

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

html {
  font-size: clamp(16px, 1vw + 14px, 17px);
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }

/* =====================================================================
   STATUS-BAR NAV
   ===================================================================== */
.status-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--rule);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 400;
}

.status-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  gap: 1rem;
}

/* Left brand */
.status-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--fg-strong);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-brand .prompt {
  color: var(--accent);
}

/* Right nav links — desktop */
.status-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.status-links li {
  display: flex;
  align-items: center;
}
.status-links .pipe {
  color: var(--rule-strong);
  padding: 0 0.5rem;
  user-select: none;
}
.status-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease-out, border-color 120ms ease-out;
}
.status-links a:hover {
  color: var(--fg);
}
.status-links a.active {
  color: var(--fg-strong);
  border-bottom: 2px solid var(--accent);
}
.status-theme {
  color: var(--muted);
  padding: 0 0;
  cursor: default;
  user-select: none;
}

/* Mobile nav — <details> toggle, no JS */
.status-toggle {
  display: none;
}
.status-toggle summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  user-select: none;
}
.status-toggle summary::-webkit-details-marker { display: none; }
.status-toggle summary::marker { display: none; }
.status-toggle[open] summary {
  color: var(--accent);
  border-color: var(--accent);
}
.status-mobile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 99;
}
.status-mobile-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.1rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}
.status-mobile-menu a:hover {
  color: var(--fg);
}
.status-mobile-menu a.active {
  color: var(--fg-strong);
  border-left-color: var(--accent);
}

@media (max-width: 799px) {
  .status-links { display: none; }
  .status-toggle { display: block; position: relative; }
}
@media (min-width: 800px) {
  .status-toggle { display: none; }
}

/* =====================================================================
   MAIN LAYOUT
   ===================================================================== */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
}

/* Wide body (Tier 1) */
body.wide main {
  max-width: var(--max-wide);
}

/* Home — wide container for 3-up cards */
body.home main {
  max-width: var(--max-wide);
}

/* =====================================================================
   HERO (landing page)
   ===================================================================== */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s7) 0 var(--s6);
  max-width: var(--max-wide);
}

/* Eyebrow chip */
.hero-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s4);
}
.hero-eyebrow::before {
  content: "[ ";
}
.hero-eyebrow::after {
  content: " ]";
}

/* Hero h1 — Inter 700, display weight */
.hero h1 {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.05;
  color: var(--fg-strong);
  margin: 0 0 var(--s4);
  letter-spacing: -0.02em;
}

/* Tagline */
.hero-tagline {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 var(--s5);
}

@media (max-width: 799px) {
  .hero { min-height: auto; padding: var(--s6) 0 var(--s5); }
  .hero h1 { font-size: 2.25rem; line-height: 1.1; }
}

/* =====================================================================
   TOOL-CALL BOX — universal container motif
   Max 5 uses per page — do NOT extend to code blocks or h2 sections.
   ===================================================================== */
.tool-call {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  margin: var(--s5) 0;
}

/* Header strip inside tool-call */
.tool-call-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: 0.55rem var(--s4);
  border-bottom: 1px solid var(--rule);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.tool-call-header .tc-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg);
}
.tool-call-header .tc-label .prompt {
  color: var(--accent);
}
.tool-call-header .tc-meta {
  color: var(--muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* Body of tool-call */
.tool-call-body {
  padding: var(--s4);
}
.tool-call-body p:first-child { margin-top: 0; }
.tool-call-body p:last-child  { margin-bottom: 0; }

/* =====================================================================
   CARDS (landing page)
   ===================================================================== */
.cards {
  display: grid;
  gap: var(--s4);
  margin: var(--s5) 0;
}

@media (min-width: 800px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* Each card is a tool-call styled anchor */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  transition: transform 120ms ease-out,
              box-shadow 120ms ease-out,
              border-color 120ms ease-out;
  /* left rail does not transition — it switches */
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  border-left-color: var(--fg-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}

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

/* Card header strip */
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s4);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}
.card-chip {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 0.15em 0.5em;
}
.card-meta-right {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

/* Card title */
.card h3 {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--fg-strong);
  margin: 0 0 var(--s3);
}

/* Card description */
.card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 var(--s4);
  flex-grow: 1;
}

/* Hairline divider */
.card-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 0 var(--s4);
}

/* Card affordance link */
.card-read {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  transition: color 120ms ease-out;
}
.card-read .prompt {
  color: var(--accent);
}
.card-read .arrow {
  display: inline-block;
  transition: transform 120ms ease-out;
}
.card:hover .card-read {
  color: var(--fg);
}
.card:hover .card-read .arrow {
  transform: translateX(4px);
}

/* =====================================================================
   TIER-PAGE CHROME
   ===================================================================== */

/* Tier header */
.tier-header {
  margin-bottom: var(--s6);
}

.tier-label {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 0.2em 0.6em;
  margin-bottom: var(--s3);
}

.tier-header h1 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.15;
  color: var(--fg-strong);
  margin: var(--s3) 0 var(--s2);
  letter-spacing: -0.02em;
}

.tier-header .meta {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* =====================================================================
   AUDIO PLAYER — tool-call now-playing
   ===================================================================== */
.now-playing {
  margin: var(--s5) 0;
}

.now-playing audio {
  display: block;
  width: 100%;
  height: 40px;
  accent-color: var(--accent);
}

/* =====================================================================
   PROSE TYPOGRAPHY
   ===================================================================== */
main h2, main h3, main h4 {
  color: var(--fg-strong);
}

main h2 {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: var(--s7) 0 var(--s4);
  padding-bottom: 0;
  /* underline via ::after */
  position: relative;
}

/* H2 accent underline — 32px wide, 2px, --accent, 8px below text */
main h2::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  background: var(--accent);
  margin-top: 8px;
}

main h3 {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  margin: var(--s6) 0 var(--s3);
}

main h4 {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: var(--s5) 0 var(--s3);
}

main p, main ul, main ol {
  font-size: 1rem;
  line-height: 1.65;
  margin: var(--s4) 0;
}

main ul, main ol { padding-left: var(--s5); }
main li { margin: 0.4rem 0; }

main a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 2px;
}
main a:hover { color: var(--fg-strong); }

main strong { color: var(--fg-strong); font-weight: 600; }
main em { font-style: italic; color: var(--muted); }

main hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--s6) 0;
}

main blockquote {
  border-left: 3px solid var(--accent);
  margin: var(--s5) 0;
  padding: var(--s2) 0 var(--s2) var(--s5);
  color: var(--muted);
}

/* Inline code */
main code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875em;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 0.1em 0.35em;
}

/* =====================================================================
   H2 GUTTER COUNTER MARKERS
   ===================================================================== */
main { counter-reset: h2; }
main h2 { counter-increment: h2; }

/* ≥1100px (≥1280px for body.wide) — absolute gutter position */
@media (min-width: 1100px) {
  body:not(.wide) main h2::before {
    content: "§ " counter(h2, decimal-leading-zero);
    position: absolute;
    left: -5.5rem;
    top: 0.35em;
    font: 500 0.85rem/1 "JetBrains Mono", monospace;
    color: var(--muted);
    letter-spacing: 0.08em;
  }
}
@media (min-width: 1280px) {
  body.wide main h2::before {
    content: "§ " counter(h2, decimal-leading-zero);
    position: absolute;
    left: -5.5rem;
    top: 0.35em;
    font: 500 0.85rem/1 "JetBrains Mono", monospace;
    color: var(--muted);
    letter-spacing: 0.08em;
  }
}

/* <1100px (or <1280px wide) — inline chip above h2 */
@media (max-width: 1099px) {
  body:not(.wide) main h2::before {
    content: "§ " counter(h2, decimal-leading-zero);
    display: block;
    font: 500 0.72rem/1 "JetBrains Mono", monospace;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
  }
}
@media (max-width: 1279px) {
  body.wide main h2::before {
    content: "§ " counter(h2, decimal-leading-zero);
    display: block;
    font: 500 0.72rem/1 "JetBrains Mono", monospace;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
  }
}

/* =====================================================================
   TABLES (Tier 1)
   ===================================================================== */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: var(--s5) 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
}

main table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  margin: 0;
}

main thead {
  position: sticky;
  top: 2.5rem; /* clear status-bar */
  z-index: 1;
}

main th {
  background: var(--bg-sunk);
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

main th + th,
main td + td {
  border-left: 1px solid var(--rule);
}

main td {
  padding: 0.55rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
}

main tr:last-child td {
  border-bottom: none;
}

/* =====================================================================
   PRE / CODE BLOCKS
   NOT wrapped in .tool-call — own treatment per spec.
   ===================================================================== */
main pre {
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-left: 8px solid var(--accent);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  overflow-x: auto;
  margin: var(--s5) 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

main pre code {
  font-family: "JetBrains Mono", monospace;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--fg);
}

/* =====================================================================
   TIER-NAV (prev/next) — tool-call chrome
   ===================================================================== */
.tier-nav {
  margin: var(--s8) 0 var(--s6);
}

.tier-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

@media (max-width: 500px) {
  .tier-nav-inner { grid-template-columns: 1fr; }
}

.tier-nav-link {
  display: flex;
  flex-direction: column;
  padding: var(--s4);
  text-decoration: none;
  color: var(--fg);
  transition: background 120ms ease-out;
}
.tier-nav-link:hover {
  background: var(--bg-sunk);
}
.tier-nav-link.nav-next {
  text-align: right;
  align-items: flex-end;
}

.tier-nav-dir {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--s1);
}
.tier-nav-dir .prompt { color: var(--accent); }

.tier-nav-label {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg-strong);
}

.tier-nav-arrow {
  display: inline-block;
  margin-left: 0.3em;
  transition: transform 120ms ease-out;
}
.tier-nav-link.nav-next:hover .tier-nav-arrow {
  transform: translateX(4px);
}

/* Divider between prev/next inside tool-call */
.tier-nav .tier-nav-inner::after {
  display: none;
}

/* =====================================================================
   FOOTER — minimal two-line
   ===================================================================== */
.site-footer {
  padding: 0 var(--s5) var(--s8);
}

/* Constrain to match page width */
body.home .site-footer,
body.wide .site-footer { max-width: var(--max-wide); margin: 0 auto; }
body.tier .site-footer  { max-width: var(--max); margin: 0 auto; }

/* Standalone footer text — no tool-call wrapper */
.footer-meta {
  padding: var(--s4) 0;
  border-top: 1px solid var(--rule);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.8;
}

.footer-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 2px;
}
.footer-meta a:hover { color: var(--fg); }

/* =====================================================================
   UTILITIES
   ===================================================================== */
.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;
}

/* Meta bar (Tier 1 intro note) */
.meta-bar {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.6rem var(--s4);
  margin: 0 0 var(--s5);
}
.meta-bar a { color: var(--accent); }

/* Lede — definitional sentence on landing, between tagline and tool-call */
.lede {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
  letter-spacing: 0.01em;
  margin: var(--s3) 0 var(--s5);
}
