/* >_ hackercats — site styles.
   Tokens and base copied from ../design-kit/tokens/web.css + base.css (Web expression).
   Use the --web-* tokens below; don't introduce new colours. */

:root {
  --web-paper: #F5F0E6;          /* page ground */
  --web-surface: #FFFCF6;        /* cards, forms */
  --web-sunk: #EFE7D8;           /* bands, neutral chips, disabled */
  --web-field: #FFFFFF;          /* text inputs */
  --web-line: #D9CCB4;           /* hairlines, card borders */
  --web-line-strong: #B9A685;    /* dashed / quiet frames */
  --web-control: #8C7556;        /* input + checkbox borders */
  --web-ink: #2F2114;            /* headings, dark chrome */
  --web-ink-deep: #140D06;       /* hard drop under buttons on ink */
  --web-text: #4A3826;           /* body copy */
  --web-muted: #5C4632;          /* secondary copy */
  --web-brown: #5A3E22;          /* primary action */
  --web-brown-hover: #4A321B;
  --web-khaki: #C2A97F;          /* bold section band (ink text only) */
  --web-khaki-rule: #A88F66;
  --web-on-ink: #F5F0E6;
  --web-on-ink-muted: #DCD0B4;
  --web-ink-rule: #5A4532;
  --web-ink-hover: #3E2D1C;
  --web-on-brown-muted: #EADFC8;

  --web-yellow: #E4B33A;         /* highlight only: underline, marker, focus ring, CTA on ink */
  --web-yellow-tint: #FAF0D2;
  --web-yellow-text: #6B4A0E;
  --web-green: #2E7F46;          /* live state only */
  --web-green-tint: #E3EFE3;
  --web-red: #9E3B22;            /* danger, validation */
  --web-red-tint: #F7E6DF;

  --web-radius: 4px;
  --web-shadow-card: 3px 3px 0 var(--web-line);
  --web-shadow-button: 2px 2px 0 var(--web-ink);
  --web-focus-outline: 3px solid var(--web-ink);

  --web-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --web-font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;  /* wordmark + code only */
  --web-size-display: clamp(38px, 5.2vw, 62px);
  --web-size-h1: clamp(34px, 4.4vw, 52px);
  --web-size-h2: clamp(26px, 3vw, 34px);
  --web-size-h3: 20px;
  --web-size-lead: 18px;
  --web-size-body: 16px;
  --web-size-small: 14px;
  --web-leading: 1.6;
  --web-measure: 62ch;

  --web-page-max: 1200px;
  --web-pad-x: clamp(20px, 4vw, 48px);
  --web-section-y: clamp(48px, 6vw, 80px);
  --web-hit: 44px;
  --web-ease: cubic-bezier(.2, .8, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--web-paper);
  color: var(--web-text);
  font-family: var(--web-font);
  font-size: var(--web-size-body);
  line-height: var(--web-leading);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--web-brown); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--web-ink); }
:focus-visible { outline: var(--web-focus-outline); outline-offset: 2px; }
img, svg, iframe { max-width: 100%; }
h1, h2, h3, h4 { color: var(--web-ink); font-weight: 600; margin: 0; }
p { margin: 0; }
code {
  font-family: var(--web-font-mono);
  font-size: 0.92em;
  background: var(--web-sunk);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  padding: 0 5px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.wrap {
  max-width: var(--web-page-max);
  margin: 0 auto;
  padding-left: var(--web-pad-x);
  padding-right: var(--web-pad-x);
}
.icon { display: block; flex: none; shape-rendering: crispEdges; }

@keyframes hcPulse { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--web-ink);
  color: var(--web-on-ink);
  padding: 10px 16px;
  border-radius: var(--web-radius);
  font-weight: 600;
}
.skip-link:focus { left: 12px; outline: 3px solid var(--web-yellow); color: var(--web-on-ink); }

/* ---------- Header ---------- */
.site-header { background: var(--web-ink); border-bottom: 1px solid var(--web-ink); }
.site-header .wrap {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-family: var(--web-font-mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--web-on-ink);
  text-decoration: none;
  border-radius: var(--web-radius);
}
.wordmark:hover { color: var(--web-on-ink); }
.wordmark-prompt { color: var(--web-yellow); }
.site-header :focus-visible,
.hero :focus-visible,
.page-head :focus-visible,
.band-brown :focus-visible,
.site-footer :focus-visible { outline-color: var(--web-yellow); }

.site-nav { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--web-hit);
  padding: 10px 0 7px;
  border-bottom: 3px solid transparent;
  color: var(--web-on-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 150ms var(--web-ease);
}
.nav-link:hover { color: var(--web-on-ink); border-bottom-color: var(--web-control); }
.nav-link[aria-current="page"] { font-weight: 600; border-bottom-color: var(--web-yellow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--web-radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--web-ease), filter 150ms var(--web-ease);
}
.btn-sm { min-height: var(--web-hit); padding: 0 18px; font-size: 15px; }
.btn-primary { background: var(--web-brown); color: var(--web-surface); box-shadow: var(--web-shadow-button); }
.btn-primary:hover { background: var(--web-brown-hover); color: var(--web-surface); }
.btn-signal { background: var(--web-yellow); color: var(--web-ink); box-shadow: 2px 2px 0 var(--web-ink-deep); }
.btn-signal:hover { color: var(--web-ink); filter: brightness(1.08); }
.btn-signal[aria-current="page"] { box-shadow: none; }
.btn-secondary { background: transparent; color: var(--web-ink); border: 1.5px solid var(--web-brown); }
.btn-secondary:hover { background: var(--web-sunk); color: var(--web-ink); }
.btn-secondary-dark { background: transparent; color: var(--web-on-ink); border: 1.5px solid var(--web-on-ink-muted); }
.btn-secondary-dark:hover { background: var(--web-ink-hover); color: var(--web-on-ink); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--web-size-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--web-muted);
}
.eyebrow::before { content: ""; width: 10px; height: 10px; background: var(--web-yellow); flex: none; }

/* ---------- Home hero ---------- */
.hero { background: var(--web-ink); color: var(--web-on-ink-muted); }
.hero .wrap {
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 40px;
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.hero .eyebrow { color: var(--web-on-ink-muted); }
.hero h1 {
  font-size: var(--web-size-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--web-on-ink);
  text-wrap: balance;
}
.underline-yellow {
  text-decoration: underline;
  text-decoration-color: var(--web-yellow);
  text-decoration-thickness: 6px;
  text-underline-offset: 8px;
  text-decoration-skip-ink: none;
}
.hero-lede { max-width: 54ch; font-size: var(--web-size-lead); text-wrap: pretty; }
.hero-facts {
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--web-ink-rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 20px;
  font-size: 15px;
  width: 100%;
  max-width: 520px;
}
.hero-facts dt { font-weight: 600; color: var(--web-on-ink); }
.hero-facts dd { margin: 0; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: 100%; max-width: 380px; height: auto; display: block; }

/* ---------- Inner page header ---------- */
.page-head { background: var(--web-ink); }
.page-head .wrap {
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(32px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-head .eyebrow { color: var(--web-on-ink-muted); }
.page-head h1 {
  font-size: var(--web-size-h1);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--web-on-ink);
  text-wrap: balance;
}
.page-head p.lede { max-width: var(--web-measure); font-size: var(--web-size-lead); color: var(--web-on-ink-muted); text-wrap: pretty; }

/* ---------- Sections & bands ---------- */
.section { padding-top: var(--web-section-y); padding-bottom: var(--web-section-y); }
.section-title {
  font-size: var(--web-size-h2);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.section-intro { margin-top: 8px; max-width: 60ch; color: var(--web-muted); }
.section-head { margin-bottom: 32px; }
.band-khaki { background: var(--web-khaki); border-top: 1px solid var(--web-khaki-rule); border-bottom: 1px solid var(--web-khaki-rule); color: var(--web-ink); }
.band-khaki .section-intro { color: var(--web-ink); }
.band-brown { background: var(--web-brown); color: var(--web-on-brown-muted); }
.band-brown h2 { color: var(--web-surface); }
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 24px 48px;
  align-items: center;
}
.split p { max-width: 58ch; text-wrap: pretty; }
.split h2 { margin-bottom: 12px; }

/* ---------- Cards ---------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.card {
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  box-shadow: var(--web-shadow-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h3 { font-size: var(--web-size-h3); line-height: 1.3; }
.card p { text-wrap: pretty; }
.card .icon { color: var(--web-ink); }
.card blockquote, .prose .card blockquote { margin: 4px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--web-line); font-size: 15px; color: var(--web-muted); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; counter-reset: step; max-width: var(--web-measure); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.steps > li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: var(--web-radius);
  background: var(--web-yellow);
  color: var(--web-ink);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps .step-title { font-weight: 600; color: var(--web-ink); }
.steps .step-body { margin-top: 2px; }

/* ---------- Callout ---------- */
.callout {
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  padding: 18px 22px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.callout p { flex: 1; min-width: 240px; }
.callout strong { color: var(--web-ink); }
.callout-dashed { border-style: dashed; border-color: var(--web-line-strong); }

/* ---------- Prose (markdown pages) ---------- */
.prose { padding-top: clamp(32px, 4vw, 56px); padding-bottom: var(--web-section-y); display: flex; flex-direction: column; gap: 56px; }
.prose > section { display: flex; flex-direction: column; gap: 16px; }
.prose > section > *:not(.cards):not(.embed):not(.callout):not(.qr):not(.facts) { max-width: var(--web-measure); }
.prose h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.2; letter-spacing: -0.015em; }
.prose h3 { font-size: var(--web-size-h3); line-height: 1.3; margin-top: 8px; }
.prose > section > ul:not(.cards):not(.facts),
.prose > section > ol:not(.steps) { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose ul ul { margin-top: 6px; }
.prose strong { color: var(--web-ink); }
.prose hr { width: 100%; max-width: none !important; border: 0; border-top: 1px solid var(--web-line); margin: 0; }
.prose blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--web-line); color: var(--web-muted); }
.prose pre {
  margin: 0;
  background: var(--web-ink);
  color: var(--web-on-ink);
  border-radius: var(--web-radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--web-font-mono);
  font-size: 15px;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Definition-style contact list */
.facts { margin: 0; padding: 0; list-style: none; max-width: 640px; }
.facts li { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--web-line); }
.facts li:first-child { border-top: 1px solid var(--web-line); }
.facts .fact-label { font-size: var(--web-size-small); font-weight: 600; color: var(--web-muted); padding-top: 2px; }
.facts .fact-value { color: var(--web-ink); }

/* ---------- Embeds (calendar, forms) ---------- */
.embed {
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  box-shadow: var(--web-shadow-card);
  padding: 8px;
  width: 100%;
  max-width: 900px;
}
.embed iframe { display: block; width: 100%; border: 0; background: var(--web-field); border-radius: 2px; }
.embed-calendar iframe { height: 600px; }
.embed-form { max-width: 720px; }
.embed-form iframe { height: 1450px; }

/* ---------- QR ---------- */
.qr {
  margin: 0;
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  box-shadow: var(--web-shadow-card);
  padding: 24px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}
.qr img { display: block; width: 100%; height: auto; background: #FFFFFF; border: 1px solid var(--web-line); border-radius: var(--web-radius); padding: 10px; }
.qr figcaption { font-weight: 600; color: var(--web-ink); text-align: center; }

/* Floating QR in the left margin (shown with ?qr=1, wide screens only) */
.floating-qr {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
  width: min(260px, calc((100vw - var(--web-page-max)) / 2 - 48px));
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--web-radius);
  box-shadow: var(--web-shadow-card);
  padding: 14px;
  text-align: center;
}
.floating-qr img { display: block; width: 100%; height: auto; background: #FFFFFF; padding: 6px; border-radius: 2px; }
.floating-qr-label { margin-top: 10px; font-size: var(--web-size-small); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--web-ink); }
@media (min-width: 1560px) {
  .floating-qr.visible { display: block; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: var(--web-ink); color: var(--web-on-ink-muted); border-top: 1px solid var(--web-ink); }
.site-footer .wrap {
  padding-top: 40px;
  padding-bottom: 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px 48px;
  flex-wrap: wrap;
  font-size: 15px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .wordmark { font-size: 20px; padding: 0; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.site-footer a { color: var(--web-on-ink); }
.site-footer a:hover { color: var(--web-yellow); }

/* ---------- Terminal easter egg (Ctrl+`) ---------- */
.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--web-ink-deep);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.terminal-overlay.active { display: flex; }
.terminal-content {
  background: var(--web-ink);
  color: var(--web-on-ink);
  border: 1px solid var(--web-ink-rule);
  border-radius: var(--web-radius);
  width: 100%;
  max-width: 1000px;
  height: min(75vh, 700px);
  display: flex;
  flex-direction: column;
  font-family: var(--web-font-mono);
  font-size: 15px;
}
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid var(--web-ink-rule);
}
.terminal-title { font-weight: 700; color: var(--web-on-ink-muted); }
.terminal-close {
  width: var(--web-hit);
  height: var(--web-hit);
  background: none;
  border: 0;
  border-radius: var(--web-radius);
  color: var(--web-on-ink);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}
.terminal-close:hover { background: var(--web-ink-hover); }
.terminal-close:focus-visible { outline-color: var(--web-yellow); }
.terminal-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px 16px; }
.terminal-output { flex: 1; overflow-y: auto; line-height: 1.45; margin-bottom: 12px; white-space: pre-wrap; }
.terminal-output-line { margin-bottom: 2px; }
.terminal-output-command { color: var(--web-yellow); }
.terminal-output-error { color: var(--web-red-tint); }
.terminal-output-header { color: var(--web-yellow); font-weight: 700; padding: 4px 0; }
.terminal-output-section { color: var(--web-on-ink); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 0 2px; border-bottom: 1px solid var(--web-ink-rule); }
.terminal-output-command-item { color: var(--web-on-ink-muted); padding-left: 16px; }
.terminal-output-current-page { color: var(--web-yellow); font-weight: 700; padding-left: 16px; }
.terminal-output-hint,
.terminal-output-vim-help { color: var(--web-on-ink-muted); }
.terminal-output-vim-indicator { color: var(--web-ink); background: var(--web-yellow); font-weight: 700; padding: 2px 8px; margin: 8px 0; border-radius: var(--web-radius); }
.terminal-output-matrix { color: var(--web-green-tint); }
.terminal-overlay.vim-mode .terminal-input { opacity: 0.5; pointer-events: none; }
.terminal-input-line { display: flex; align-items: center; gap: 8px; }
.terminal-prompt { color: var(--web-yellow); flex: none; }
.terminal-input {
  flex: 1;
  min-width: 0;
  min-height: var(--web-hit);
  background: transparent;
  border: 0;
  outline: none;
  color: var(--web-on-ink);
  font: inherit;
  caret-color: var(--web-yellow);
}
.terminal-input::placeholder { color: var(--web-on-ink-muted); opacity: 0.8; }

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .site-nav { width: 100%; justify-content: space-between; }
  .embed-calendar iframe { height: 520px; }
  .hero-art img { max-width: 240px; }
}
