/* cache-rev: 2026-06-21b */
/* ==========================================================================
   GuruHits — design system
   A clean docs/wiki look. One restrained accent (a late-90s iTunes-era navy
   blue). System font stack, ~70ch measure, sticky chrome, responsive grid.
   WCAG-AA contrast, print-friendly.
   ========================================================================== */

/* Period chrome font: ChiKareGo2, a Chicago-style pixel font by Giles Booth,
   used under Creative Commons Attribution (CC BY). Credit on /copyright.html.
   Activates the "GuruChrome" slot already present in the --font-chrome stack. */
@font-face {
  font-family: "GuruChrome";
  src: url("/assets/fonts/chikarego2.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* Accent: deep "Aqua"-era blue, with a darker shade for AA-safe text on white. */
  --accent:        #1f5fbf;       /* links, current-nav underline, rails */
  --accent-strong: #18488f;       /* hover / pressed */
  --accent-soft:   #eaf1fb;       /* tinted backgrounds */

  --ink:        #1a2230;          /* body text */
  --ink-soft:   #4a5568;          /* secondary text, captions */
  --ink-faint:  #6b7280;          /* muted / metadata */

  --bg:         #ffffff;
  --bg-alt:     #f7f8fa;          /* code title bars, subtle panels */
  --bg-sunken:  #f1f3f6;          /* exhibit frame, pre background */

  --line:       #e2e6ec;          /* hairlines */
  --line-strong:#cbd2dc;

  --radius:     8px;
  --radius-sm:  5px;

  --measure:    70ch;
  --topbar-h:   56px;
  --eq-h:       30px;   /* the equalizer separator strip under the menu (incl. 4px border) */

  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
          "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Helvetica Neue", sans-serif;
}

/* --- reset-ish ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Anchored headings clear the sticky topbar when jumped to. */
:target { scroll-margin-top: calc(var(--topbar-h) + var(--eq-h) + 16px); }

/* Equalizer separator strip — a segmented rainbow LED bar under the sticky menu. */
.eq-strip {
  position: sticky;
  top: 0;
  z-index: 51;
  height: var(--eq-h);
  /* layered: top bevel (white->black), bottom bevel (black->white), a vertical
     gloss for a rounded/protruding feel, then the rainbow LED image. */
  background:
    linear-gradient(to bottom, #fff, #000) top / 100% 4px no-repeat,
    linear-gradient(to bottom, #000, #000) bottom / 100% 4px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,1.0), rgba(255,255,255,0) 42%, rgba(0,0,0,.40)) center / 100% 100% no-repeat,
    #0b0b0f url("/assets/img/eq-separator.png") center / cover;
}

/* Section hero — a slim, full-width photographic band under the menu strip.
   The title is baked into the image, so the block is purely decorative. */
.page-hero {
  height: 180px;
  overflow: hidden;
  background: #0b0b0f;
  border-bottom: 1px solid var(--line);
}
.page-hero img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 38%;
}
@media (max-width: 800px) {
  .page-hero { height: 130px; }
}

/* Home sidebar: the guru + a pure-CSS animated equalizer. */
.sidebar-guru {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  margin: 1.75rem auto 0;
}
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  margin: 1.25rem auto 0;
  max-width: 190px;
}
.eq span {
  flex: 1 1 0;
  height: 100%;
  transform: scaleY(0.3);
  transform-origin: bottom;
  border-radius: 2px 2px 0 0;
  background: hsl(calc(var(--i) * 24), 85%, 55%);
  /* animate transform (not height) so the bars run on the compositor — no main-thread layout, no jank */
  animation: eqbar calc(0.6s + var(--i) * 0.06s) ease-in-out calc(var(--i) * -0.14s) infinite alternate;
  will-change: transform;
}
@keyframes eqbar { from { transform: scaleY(0.12); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .eq span { animation: none; transform: scaleY(0.55); }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

/* TL;DR answer block — a concise, quotable summary under the h1 (also the speakable target).
   Tinted callout with an accent rule, set a touch larger than body for a clear lead-in. */
.tldr {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.55;
}

/* On-page FAQ — visible Q&A; questions as h3 for structure and AI extraction. */
.faq { margin: 1.5rem 0; }
.faq-item { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: 0; }
.faq-q { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--ink); }
.faq-a { margin: 0; color: var(--ink-soft); }

img { max-width: 100%; height: auto; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: var(--eq-h);            /* sits directly under the equalizer bar, which is pinned at the top */
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--topbar-h);
  padding: 0 clamp(1rem, 4vw, 2rem);
  /* Rainbow hairline along the BOTTOM edge (between the menu and the hero), echoing the footer.
     Order down the page: equalizer bar -> menu -> this hairline -> hero. */
  background:
    linear-gradient(to right,
      #ff2d2d, #ff8a00, #ffd400, #38c24a, #1f9be0, #3a4ed6, #9b35d4) bottom / 100% 4px no-repeat,
    rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--accent); text-decoration: none; }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  margin-left: auto;
}
.topnav a {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.topnav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-decoration: none;
}
.topnav a[aria-current="page"] {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
  border-radius: 0;
  font-weight: 600;
}

/* Group separator: a thin vertical rule between nav groups on desktop. */
.navsep {
  align-self: center;
  width: 1px;
  height: 1.1em;
  margin: 0 0.3rem;
  background: var(--line);
}

/* Hamburger + off-canvas: hidden on desktop, shown at the mobile breakpoint. */
.nav-toggle,
.nav-close,
.nav-overlay { display: none; }

.nav-toggle {
  margin-left: auto;
  width: 40px; height: 40px;
  padding: 9px 8px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 800px) {
  .nav-toggle { display: flex; }

  /* backdrop-filter makes .topbar a containing block for position:fixed children,
     which would trap the off-canvas drawer to the topbar's height. Drop it on
     mobile so the drawer is sized to the viewport. */
  .topbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }

  .nav-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 60;
  }

  .topnav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(78vw, 300px);
    margin-left: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.15rem;
    padding: 4.5rem 1.25rem 2rem;
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 70;
  }
  .topnav a {
    font-size: 1.05rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 0;
  }
  .topnav a[aria-current="page"] {
    border-bottom: 0;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
  }
  .navsep {            /* becomes a horizontal divider in the drawer */
    width: 100%;
    height: 1px;
    margin: 0.45rem 0;
  }
  .nav-close {
    display: block;
    position: absolute;
    top: 0.6rem; right: 0.9rem;
    background: none; border: 0; cursor: pointer;
    font-size: 1.9rem; line-height: 1;
    color: var(--ink-soft);
  }

  body.nav-open { overflow: hidden; }
  body.nav-open .topnav { transform: translateX(0); }
  body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
}

/* ==========================================================================
   Shell — two-column grid (toc rail + content)
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
  align-items: start;
}
/* Pages without a contents rail (e.g. home) center the content column. */
.shell:not(:has(.toc)) {
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(var(--measure) + 4rem);
}

/* ==========================================================================
   Contents rail (toc)
   ========================================================================== */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + var(--eq-h) + 1.5rem);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - var(--eq-h) - 3rem);
  overflow-y: auto;
  font-size: 0.9rem;
}
.toc-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.22rem 0.7rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  line-height: 1.4;
}
.toc a:hover { color: var(--accent-strong); border-left-color: var(--line-strong); text-decoration: none; }
.toc-l3 a { padding-left: 1.5rem; font-size: 0.85rem; }
.toc a.active {
  color: var(--accent-strong);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ==========================================================================
   Content
   ========================================================================== */
.content { max-width: var(--measure); min-width: 0; }

.content h1 {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.content h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
.content h3 {
  font-size: 1.2rem;
  margin: 1.8rem 0 0.6rem;
}
.content h4 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; }

.content p { margin: 0 0 1.1rem; }
.content ul, .content ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.content li { margin: 0.3rem 0; }
.content li > ul, .content li > ol { margin: 0.3rem 0; }

.content hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.content a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.content a:hover { text-decoration-color: currentColor; }

/* Inline code */
.content :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  word-break: break-word;
}

/* ==========================================================================
   Codeblock component
   ========================================================================== */
.codeblock {
  margin: 1.5rem 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}
.codeblock-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.codeblock .copy {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.codeblock .copy:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.codeblock .copy:active { background: var(--accent-strong); }
/* When there's no title, float the copy button into the corner. */
.codeblock > .copy {
  display: block;
  margin: 0.55rem 0.55rem -0.25rem auto;
}
.codeblock pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: transparent;
}
.codeblock pre code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
  background: none;
  border: 0;
  padding: 0;
}

/* ==========================================================================
   Exhibit — framed figure with caption
   ========================================================================== */
.exhibit {
  margin: 1.75rem 0;
  padding: 0.6rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.exhibit img { display: block; width: 100%; border-radius: var(--radius-sm); }
.exhibit figcaption {
  margin-top: 0.6rem;
  padding: 0 0.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}

/* Retro variant — classic Mac beveled 2px border. */
.exhibit.retro {
  background: #dcdcdc;
  border: 2px solid;
  border-color: #fafafa #707070 #707070 #fafafa; /* light top/left, dark bottom/right */
  border-radius: 0;
  padding: 4px;
  box-shadow: 1px 1px 0 #000;
}
.exhibit.retro img { border-radius: 0; border: 1px solid #707070; }
.exhibit.retro figcaption {
  margin-top: 0.5rem;
  color: #2a2a2a;
  font-family: "Geneva", "Chicago", var(--sans);
}

/* ==========================================================================
   Callouts — note / info / warning, left accent bar
   ========================================================================== */
.callout {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.callout-note    { border-left-color: var(--accent);  background: var(--accent-soft); }
.callout-info    { border-left-color: #0e8a6e;         background: #e7f6f1; }
.callout-warning { border-left-color: #c98a00;         background: #fdf3df; }

/* ==========================================================================
   Bilingual quote — muted original, normal translation
   ========================================================================== */
.bilingual {
  margin: 1.5rem 0;
  padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 3px solid var(--line-strong);
}
.bilingual .original {
  margin: 0 0 0.5rem;
  color: var(--ink-faint);
  font-style: italic;
}
.bilingual .translation {
  margin: 0;
  color: var(--ink);
}

/* Plain markdown blockquotes (e.g. legal notes) get the same treatment. */
.content blockquote:not(.bilingual) {
  margin: 1.5rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.content blockquote > :first-child { margin-top: 0; }
.content blockquote > :last-child { margin-bottom: 0; }

/* ==========================================================================
   Site footer
   ========================================================================== */
.sitefoot {
  /* charcoal slab, bookended by a thin rainbow hairline that echoes the menu strip */
  margin-top: 3rem;
  background:
    linear-gradient(to right,
      #ff2d2d, #ff8a00, #ffd400, #38c24a, #1f9be0, #3a4ed6, #9b35d4) top / 100% 4px no-repeat,
    #1f242e;
  padding: calc(1.75rem + 4px) clamp(1rem, 4vw, 2rem) 1.75rem;
  color: #9aa3b2;
  font-size: 0.85rem;
  text-align: center;
}
.sitefoot p { max-width: 60ch; margin: 0 auto; }
.sitefoot a { color: #8fb4f2; }
.sitefoot a:hover { color: #b9d1f8; }
.sitefoot .legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  margin-top: 0.6rem;
}

/* ==========================================================================
   Responsive — collapse to one column under ~800px
   ========================================================================== */
@media (max-width: 800px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* Contents become a secondary, non-sticky block below the heading flow. */
  .toc {
    position: static;
    max-height: none;
    order: 2;            /* push below the content on small screens */
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
  }
  .content { order: 1; }
  /* Homepage: keep the sidebar (guru + intro contents) ABOVE the content on mobile,
     so the guru photo greets visitors instead of loading at the very bottom. */
  .shell-home .toc {
    order: 0;
    margin-top: 0;
    margin-bottom: 2rem;
    padding-top: 0;
    border-top: 0;
  }
  .shell-home .content { order: 1; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .topbar, .toc, .codeblock .copy { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .shell { display: block; max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .codeblock, .exhibit, .callout { break-inside: avoid; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ==========================================================================
   Dedication — an understated closing note on the home page
   ========================================================================== */
.dedication {
  margin: 3rem auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  max-width: 40ch;
  text-align: center;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-soft);
}
.dedication strong { font-style: normal; color: var(--accent-strong); }

/* ==========================================================================
   Timeline — era-grouped vertical rail (full page) + compact home strip
   ========================================================================== */
.timeline { margin: 1.5rem 0; }

.tl-era {
  position: relative;
  margin: 0 0 1.75rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--line-strong);
}
.tl-era:last-child { margin-bottom: 0; }
.tl-era-head {
  margin: 0 0 .9rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tl-event {
  position: relative;
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: .25rem 1rem;
  margin: 0 0 1rem;
}
.tl-event:last-child { margin-bottom: 0; }
.tl-date {
  color: var(--ink-faint);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  padding-top: .1rem;
}
.tl-text { min-width: 0; }
.tl-title { font-weight: 600; line-height: 1.35; }
.tl-title a { text-decoration: none; }
.tl-title a:hover { text-decoration: underline; }
.tl-body { margin-top: .2rem; color: var(--ink-soft); font-size: .92rem; }

/* dot sitting on the rail */
.tl-dot {
  position: absolute;
  left: calc(-1.5rem - 6px);
  top: .35rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 3px var(--bg);
}

/* category hues */
.cat-idea        { background: #d99100; }
.cat-licensing   { background: var(--accent); }
.cat-tech        { background: #0f8a7e; }
.cat-launch      { background: #d6453d; }
.cat-operations  { background: #5a6b86; }
.cat-legacy      { background: #7c5cc4; }
.cat-rediscovery { background: #2e9e54; }
.cat-context     { background: var(--line-strong); }

/* a context event reads as muted */
.tl-event:has(.cat-context) .tl-title { color: var(--ink-soft); font-weight: 500; }

/* home highlights strip */
.tl-highlights {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tl-hl { display: flex; align-items: baseline; gap: .6rem; }
.tl-hl .tl-dot {
  position: static;
  box-shadow: none;
  flex: 0 0 auto;
  align-self: center;
}
.tl-hl-date {
  flex: 0 0 auto;
  min-width: 7rem;
  color: var(--ink-faint);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.tl-hl-title { font-size: .95rem; }
.tl-hl-title a { text-decoration: none; }
.tl-hl-title a:hover { text-decoration: underline; }
.tl-more {
  align-self: flex-start;
  margin-top: .4rem;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}
.tl-more:hover { text-decoration: underline; }

/* responsive: stack date above title; keep the rail */
@media (max-width: 640px) {
  .tl-event { grid-template-columns: 1fr; gap: .1rem; }
  .tl-hl { flex-wrap: wrap; }
  .tl-hl-date { min-width: 0; }
}

/* ==========================================================================
   SABAM Files — bilingual primary-source letter cards
   ========================================================================== */
.letters { margin: 1.5rem 0; }

.letter {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
}
.letter:last-child { margin-bottom: 0; }
.letter.dir-sent { border-left-color: var(--accent); }        /* Joe's outgoing letters */

.letter-head {
  margin: 0 0 .6rem;
  font-size: .8rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.letter-orig,
.letter-en { margin: 0 0 .5rem; line-height: 1.55; }
.letter-orig { color: var(--ink-soft); font-style: italic; }
.letter-en   { color: var(--ink); }
.letter-en:last-of-type { margin-bottom: 0; }

.lang-tag {
  display: inline-block;
  margin-right: .5rem;
  padding: 0 .35rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: .08em;
  font-style: normal;
}

.letter-sig {
  margin: .6rem 0 0;
  color: var(--ink-soft);
  font-size: .9rem;
}

@media (max-width: 640px) {
  .letter { padding: .85rem 1rem; }
}

/* ==========================================================================
   The Stack — CSS-simulated HyperCard window + object/script browser
   Chrome prefers real Charcoal/Chicago; falls back to the system sans (a
   bundled "GuruChrome" pixel font activates automatically if present — see
   assets/fonts/README.md). No JS: a hidden radio-group drives selection.
   ========================================================================== */
.stack-explorer {
  --font-chrome: Charcoal, Chicago, "GuruChrome", var(--sans);
  --font-field:  Geneva, Verdana, var(--sans);
  margin: 1.5rem 0;
}

/* the radios that drive selection are visually hidden but focusable */
.hc-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* --- the simulated window ------------------------------------------------ */
/* The card uses fixed pixel coordinates for a faithful 512px HyperCard window, so on
   narrow screens we keep its true width and let the window scroll horizontally inside
   this wrapper rather than letting the fields overflow the viewport. */
.hc-winwrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.hc-window {
  width: 512px;
  margin: 0 auto;
  border: 1px solid #000;
  background: #fff;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.hc-titlebar {
  position: relative;
  height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid #000;
  /* classic horizontal pin-stripes */
  background: repeating-linear-gradient(#fff, #fff 1px, #000 1px, #000 2px);
  font-family: var(--font-chrome);
}
.hc-close {
  position: absolute; left: 6px; top: 4px;
  width: 11px; height: 11px;
  background: #fff; border: 1px solid #000;
}
.hc-title {
  padding: 0 8px;
  background: #fff;
  font-size: 12px; line-height: 1;
}
.hc-card {
  position: relative;
  height: 272px;
  background: #fff;
  font-family: var(--font-field);
}
.hc-btn {
  position: absolute;
  min-width: 88px;
  padding: 4px 10px;
  text-align: center;
  font-family: var(--font-chrome);
  font-size: 13px;
  color: #000; background: #dcdcdc;
  border: 1px solid #000; border-radius: 9px;
  box-shadow: inset -1px -1px 0 #8a8a8a, inset 1px 1px 0 #fff;
  cursor: pointer; user-select: none;
}
.hc-btn:hover { background: #cfcfcf; }
.hc-btn:active { box-shadow: inset 1px 1px 0 #8a8a8a; }

/* a HyperCard scrolling field, drawn as a labelled text box on the card */
.hc-field {
  position: absolute;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #000;
  box-shadow: inset -1px -1px 0 #8a8a8a, inset 1px 1px 0 #fff;
  cursor: pointer; overflow: hidden;
}
.hc-field-name {
  flex: 0 0 auto;
  padding: 1px 4px;
  font-family: var(--font-chrome); font-size: 10px; line-height: 1.4;
  color: #000; background: #dcdcdc;
  border-bottom: 1px solid #000;
}
.hc-field-body {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  padding: 3px 5px;
  font-family: var(--mono); font-size: 9px; line-height: 1.35;
  color: #000; white-space: pre;
}
.hc-field:hover .hc-field-name { background: #cfcfcf; }

/* --- the object/script browser ------------------------------------------ */
.hc-browser {
  display: grid;
  grid-template-columns: 200px 1fr;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.hc-objects {
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
  padding: .35rem;
  display: flex; flex-direction: column; gap: 1px;
}
.hc-obj {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .45rem;
  font-family: var(--font-chrome); font-size: .85rem;
  color: var(--ink); cursor: pointer; border-radius: var(--radius-sm);
}
.hc-obj:hover { background: var(--accent-soft); }
.hc-ico { width: 13px; height: 11px; border: 1px solid var(--ink-faint); background: #fff; flex: 0 0 auto; }
.hc-ico-stack  { box-shadow: 2px 2px 0 #fff, 3px 3px 0 var(--ink-faint); }  /* stacked cards */
.hc-ico-card   { border-radius: 1px; }
.hc-ico-button { border-radius: 6px; }
.hc-ico-field  { background: repeating-linear-gradient(#fff,#fff 2px,var(--line) 2px,var(--line) 3px); }

.hc-scripts { background: #fff; min-width: 0; }
.hc-pane { display: none; }
.hc-pane-title {
  font-family: var(--font-chrome); font-size: .8rem;
  padding: .4rem .6rem; background: var(--bg-alt);
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
}
.hc-note { margin: .5rem .6rem 0; color: var(--ink-soft); font-size: .9rem; }
.hc-script {
  margin: 0; padding: .6rem;
  max-height: 420px; overflow: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  color: var(--ink); background: #fff;
  white-space: pre;
}

/* --- pure-CSS reveal: the checked radio shows its pane + highlights its
       list item and (if on the card) its button. One block per object id. -- */
#hc-stack:checked      ~ .hc-browser .hc-pane[data-for="stack"],
#hc-btn-card:checked   ~ .hc-browser .hc-pane[data-for="btn-card"],
#hc-btn-start:checked  ~ .hc-browser .hc-pane[data-for="btn-start"],
#hc-btn-temp:checked   ~ .hc-browser .hc-pane[data-for="btn-temp"],
#hc-btn-shrink:checked ~ .hc-browser .hc-pane[data-for="btn-shrink"],
#hc-fld-level:checked  ~ .hc-browser .hc-pane[data-for="fld-level"],
#hc-fld-highscore:checked ~ .hc-browser .hc-pane[data-for="fld-highscore"] { display: block; }

#hc-stack:checked      ~ .hc-browser .hc-obj[for="hc-stack"],
#hc-btn-card:checked   ~ .hc-browser .hc-obj[for="hc-btn-card"],
#hc-btn-start:checked  ~ .hc-browser .hc-obj[for="hc-btn-start"],
#hc-btn-temp:checked   ~ .hc-browser .hc-obj[for="hc-btn-temp"],
#hc-btn-shrink:checked ~ .hc-browser .hc-obj[for="hc-btn-shrink"],
#hc-fld-level:checked  ~ .hc-browser .hc-obj[for="hc-fld-level"],
#hc-fld-highscore:checked ~ .hc-browser .hc-obj[for="hc-fld-highscore"] { background: var(--accent); color: #fff; }

#hc-btn-start:checked  ~ .hc-window .hc-btn[for="hc-btn-start"],
#hc-btn-temp:checked   ~ .hc-window .hc-btn[for="hc-btn-temp"],
#hc-btn-shrink:checked ~ .hc-window .hc-btn[for="hc-btn-shrink"] {
  background: #000; color: #fff; box-shadow: inset 1px 1px 0 #8a8a8a;
}

/* a selected field gets its name bar inverted on the card */
#hc-fld-level:checked     ~ .hc-window .hc-field[for="hc-fld-level"] .hc-field-name,
#hc-fld-highscore:checked ~ .hc-window .hc-field[for="hc-fld-highscore"] .hc-field-name {
  background: #000; color: #fff;
}

/* keyboard focus visibility: outline the focused object's own list item */
#hc-stack:focus-visible      ~ .hc-browser .hc-obj[for="hc-stack"],
#hc-btn-card:focus-visible   ~ .hc-browser .hc-obj[for="hc-btn-card"],
#hc-btn-start:focus-visible  ~ .hc-browser .hc-obj[for="hc-btn-start"],
#hc-btn-temp:focus-visible   ~ .hc-browser .hc-obj[for="hc-btn-temp"],
#hc-btn-shrink:focus-visible ~ .hc-browser .hc-obj[for="hc-btn-shrink"],
#hc-fld-level:focus-visible  ~ .hc-browser .hc-obj[for="hc-fld-level"],
#hc-fld-highscore:focus-visible ~ .hc-browser .hc-obj[for="hc-fld-highscore"] {
  outline: 2px solid var(--accent); outline-offset: -2px;
}

@media (max-width: 640px) {
  .hc-browser { grid-template-columns: 1fr; }
  .hc-objects { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   /netcloak — tag reference tables + download button
   ========================================================================== */
.nc-tags-wrap { margin: 1.5rem 0; }
.nc-cat { margin: 0 0 1.5rem; }
.nc-cat-head {
  margin: 0 0 .5rem; font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
}
.nc-tags {
  width: 100%; border-collapse: collapse; font-size: .9rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.nc-tags th, .nc-tags td {
  text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.nc-tags thead th {
  background: var(--bg-alt); color: var(--ink-soft);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
}
.nc-tags tbody tr:nth-child(even) { background: var(--bg-alt); }
.nc-tags tbody tr:last-child td { border-bottom: 0; }
.nc-tags td code { font-family: var(--mono); font-size: .85em; white-space: nowrap; }
.nc-tags td:nth-child(3) code { white-space: normal; }
.nc-note { color: var(--ink-faint); }
.nc-eg { display: inline-block; margin-top: .25rem; color: var(--ink-soft); white-space: normal; }

.nc-download {
  display: inline-block; margin: .25rem 0; padding: .5rem .9rem;
  background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.nc-download:hover { background: var(--accent-strong); }

@media (max-width: 640px) {
  .nc-tags td code { white-space: normal; }
}
