/* The site chrome, shared by EVERY page (homepage, tool pages, blog): design
   tokens, base reset, the masthead (brand + live-visitor pill) and the footer
   (+ terminal prompt). Its markup is shared too: build/chrome.mjs stamps one
   header/footer into every page. Page-specific styles live in hc.css (app
   pages) and blog/blog.css (articles). */
:root {
  --ink: #181b16;
  --ink-2: #21251d;
  --paper: #f1eee2;
  --surface: #faf8ef;
  --line: rgba(24, 27, 22, 0.14);
  --line-strong: rgba(24, 27, 22, 0.28);
  --muted: #5e6156;
  --amber: #d98e2b;
  --amber-dim: rgba(217, 142, 43, 0.16);
  --moss: #4c7a5e;
  --rust: #b5502f;
  --prose: #2b2f26;
  --radius: 8px;
  --paper-line: rgba(241, 238, 226, 0.16);
  --paper-muted: rgba(241, 238, 226, 0.62);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ---- masthead --------------------------------------------------- */
.masthead {
  background: var(--ink);
  color: var(--paper);
}
.masthead-in {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-decoration: none;
}
.brand small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--amber);
}
.presence-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--paper-muted);
}

/* footer: dark band like the masthead - eyebrow, one social-proof headline, then (c) + terminal link.
   The live visitor count stays in the masthead only. */
footer {
  margin-top: 2.5rem;
  background: var(--ink);
  color: var(--paper-muted);
  font-size: 0.78rem;
}
.foot-in {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 1rem;
}
.foot-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--amber);
}
.foot-big {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--paper);
  margin: 0.3rem 0 0.9rem;
}
.foot-big em { font-style: normal; color: var(--amber); }
.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  border-top: 1px solid var(--paper-line);
  padding-top: 0.8rem;
}
.foot-row a { text-decoration: none; }
.foot-row .foot-copy a:hover { color: var(--paper); }
/* Discreet terminal entrance: a muted shell prompt that types "terminal" on
   hover/focus/tap and boots the terminal front end (same boot screen as the
   secret "terminal" word and the cheat codes). */
.term-prompt { display: inline-flex; align-items: baseline; font-family: var(--mono); font-size: 0.76rem; color: rgba(124, 252, 124, 0.6); text-decoration: none; white-space: nowrap; padding: 0.2rem 0; }
.term-prompt .tp-host { opacity: 0.85; }
.term-prompt .tp-typed { color: #7CFC7C; margin-left: 0.4ch; }
.term-prompt .tp-cursor { color: #7CFC7C; margin-left: 0.15ch; animation: tp-blink 1.1s steps(1) infinite; }
.term-prompt:hover, .term-prompt:focus-visible { color: #7CFC7C; }
@keyframes tp-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term-prompt .tp-cursor { animation: none; } }
@media (pointer: coarse) { .term-prompt { min-height: 44px; display: inline-flex; align-items: center; } }

/* ---- shared components: every page type uses these, so they cannot drift ---- */
/* page title */
h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}
/* section heading (a title with a divider line under it) */
.articles h2, .reference h2, .tp-more h2, .prose h2, .related h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1.4rem;
  padding: 0.4rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
/* card: one border, radius and fill for every boxed thing; linked cards get the amber hover */
.card, .article-card, .promo, .callout, .tp-post, .related a {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.article-card, .promo, .callout, .tp-post, .related a {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.article-card:hover, .promo:hover, .callout:hover, .tp-post:hover, .related a:hover { border-color: var(--amber); }
/* article text: blog posts and the per-tool pages */
.prose h2 { margin: 2.6rem 0 1.4rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1rem; font-weight: 600; margin: 1.6rem 0 0.35rem; }
.prose p { font-size: 1rem; line-height: 1.7; margin: 0 0 1.1rem; color: var(--prose); }
.prose ul, .prose ol { line-height: 1.7; margin: 0 0 1.3rem; padding-left: 1.3rem; color: var(--prose); }
.prose li { margin-bottom: 0.4rem; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { text-decoration-color: var(--amber); text-underline-offset: 2px; }
.prose a:hover { color: var(--rust); }
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--amber-dim);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* ---- tool buttons: the homepage's switchbank, reused as links on every tool page ---- */
.switchbank {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.switch:hover { border-color: var(--amber); }
a.switch { text-decoration: none; }
/* Host Check is featured: a wide button on its own row above the other nine (3 x 3). */
.switch[data-tool="hostcheck"] { grid-column: 1 / -1; padding: 0.85rem 1rem 0.9rem; font-size: 1rem; }
/* The amber outline marks the homepage's DEFAULT tool (what the main Check button runs); on tool pages the buttons are plain links. */
.bench .switch[data-tool="hostcheck"]:not(.is-active):not(:hover) { border-color: var(--amber); }
.switch[data-tool="hostcheck"] .ds { font-size: 0.8rem; }
.switch .ds { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.switch.is-active .ds { color: var(--paper-muted); }
.switch .nm { display: inline-flex; align-items: center; gap: 0.4rem; }
.switch.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
@media (max-width: 640px) {
  /* 1 column, not 2 - stacking cleanly divides evenly no matter how
     many checks there are, and gives the biggest tap target on the
     screens most likely to be a thumb, not a cursor. */
  .switchbank {
    grid-template-columns: 1fr;
  }
}
@media (pointer: coarse) { .switch { min-height: 56px; } }
/* "New" / "Updated" pill */
.badge-new {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  line-height: 1.4;
}

/* ---- shared text roles (one definition each; pages only set margins/spacing) ---- */
/* subtitle under a page title */
.bench-sub, .dek { font-size: 1rem; line-height: 1.5; color: var(--muted); }
/* card title + card description */
.article-body h3, .ref-item h3, .tp-post strong, .callout strong, .related a {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.article-body p, .ref-item p, .tp-post span, .callout span {
  font-size: 0.83rem;
  line-height: 1.4;
  color: var(--muted);
}
