/* Virtual Colossus shared theme.
   Navy panels with brass fittings, paper-tape ivory for the tape strips. */

:root {
  color-scheme: light dark;
  --rack: #2A3A57;        /* header, hero, footer */
  --rack-2: #364A6E;
  --rack-ink: #E7EBF2;
  --rack-muted: #AEB9CC;
  --plate-ink: #F3EFE4;
  --paper: #EEF1F5;       /* page background */
  --surface: #F8F9FB;
  --ink: #161D2B;
  --muted: #515B6D;
  --rule: #CCD3DE;
  --brass: #C8922F;
  --brass-hi: #D9A443;
  --brass-ink: #161D2B;
  --link: #2B5197;
  --t-plain: #1F6B35;     /* plain text / key / cipher text in worked examples */
  --t-key: #A3262A;
  --t-cipher: #2B5197;

  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 74rem;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rack: #141C2C;
    --rack-2: #22304A;
    --paper: #131924;
    --surface: #1A2230;
    --ink: #E2E6EE;
    --muted: #9DA7B8;
    --rule: #2C374B;
    --link: #92B4EA;
    --t-plain: #7FD195;
    --t-key: #F29191;
    --t-cipher: #92B4EA;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--f-ui);
  font-stretch: 82%;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.005em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.small { font-size: .92rem; color: var(--muted); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--brass); color: var(--brass-ink); padding: .5rem 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 .95rem/1 var(--f-ui);
  padding: .8rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-run { background: var(--brass); color: var(--brass-ink); }
.btn-run:hover { background: var(--brass-hi); }
.btn-ghost { border-color: rgba(230, 234, 228, .6); color: var(--rack-ink); }
.btn-ghost:hover { border-color: var(--rack-ink); background: rgba(255, 255, 255, .06); }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--rack); color: var(--rack-ink);
  font-family: var(--f-ui);
  border-bottom: 1px solid rgba(0, 0, 0, .25);
}
.bar { display: flex; align-items: center; gap: 1rem; min-height: 3.75rem; }
.brand {
  display: flex; align-items: center; gap: .6rem; margin-right: auto;
  color: inherit; text-decoration: none;
  font-weight: 700; font-stretch: 85%; font-size: 1.15rem;
}
.brand img { flex: none; width: 36px; height: 36px; border-radius: 3px; }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav > a:not(.btn), .sims-menu > summary {
  color: var(--rack-ink); text-decoration: none;
  padding: .55rem .7rem; border-radius: var(--radius);
  font-size: .95rem; cursor: pointer;
}
.site-nav > a:not(.btn):hover, .sims-menu > summary:hover { background: var(--rack-2); }
.site-nav > a[aria-current="page"] { box-shadow: inset 0 -2px var(--brass); }
.site-nav > .btn-run { margin-left: .5rem; padding: .62rem .95rem; }

.sims-menu { position: relative; }
.sims-menu > summary { list-style: none; }
.sims-menu > summary::-webkit-details-marker { display: none; }
.sims-menu > summary::after {
  content: ""; display: inline-block; margin-left: .5rem; padding: 2.5px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-3px) rotate(45deg);
}
.sims-menu[open] > summary { background: var(--rack-2); }
.sims-panel {
  position: absolute; right: 0; top: calc(100% + .5rem);
  width: min(46rem, 92vw);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  background: var(--rack); border: 1px solid var(--rack-2);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.sims-panel h2 { font-size: .9rem; font-weight: 600; color: var(--rack-muted); margin-bottom: .4rem; }
.sims-panel ul { list-style: none; margin: 0; padding: 0; }
.sims-panel a { display: block; padding: .3rem 0; color: var(--rack-ink); text-decoration: none; }
.sims-panel a:hover, .sims-panel a[aria-current] { color: var(--brass-hi); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; background: none; color: inherit; font: inherit;
    border: 1px solid var(--rack-muted); border-radius: var(--radius);
    padding: .45rem .85rem; cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch;
    background: var(--rack); border-top: 1px solid var(--rack-2);
    padding: .75rem 1.25rem 1.25rem;
    max-height: calc(100vh - 3.75rem); overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a[aria-current="page"] { box-shadow: inset 2px 0 var(--brass); }
  .sims-panel { position: static; width: auto; grid-template-columns: 1fr; gap: 1rem; box-shadow: none; border: 0; padding: .5rem .7rem; }
  .site-nav > .btn-run { margin: .75rem 0 0; }
}

/* ---------- Paper tape strip ---------- */
.tape {
  height: 44px;
  background-color: var(--rack);
  background-repeat: repeat-x;
  background-position: left center;
  background-size: auto 40px;
}
@media (prefers-color-scheme: dark) { .tape { opacity: .85; } }

/* ---------- Home hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: min(80vh, 46rem);
  background: var(--rack); color: var(--rack-ink);
}
.hero-slides { position: absolute; inset: 0; z-index: -2; }
.hero-slides img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.6s ease;
}
.hero-slides img.is-active { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(18, 26, 42, .82) 0%, rgba(18, 26, 42, .2) 50%, rgba(18, 26, 42, 0) 100%);
}
.hero-inner { padding-block: 3rem; }

/* The maker's plate */
.plate {
  position: relative;
  max-width: 38rem;
  margin-left: auto;      /* right-hand side, so the machine in the photo (usually on the left) stays visible */
  padding: 2rem 2.4rem 1.8rem;
  background-color: rgba(42, 58, 87, .95);
  background-image:
    radial-gradient(circle at 12px 12px, #9C8656 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 12px) 12px, #9C8656 2.5px, transparent 3px),
    radial-gradient(circle at 12px calc(100% - 12px), #9C8656 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #9C8656 2.5px, transparent 3px);
  border: 1px solid rgba(200, 146, 47, .65);
  outline: 1px solid rgba(200, 146, 47, .25);
  outline-offset: -8px;
}
.plate.plate-left { margin-left: 0; margin-right: auto; }  /* per machine: 'plate' => 'left' in site.php */
.plate-maker { font: 500 .9rem/1.3 var(--f-ui); color: var(--rack-muted); margin-bottom: .6rem; }
.plate h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-stretch: 70%;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--plate-ink);
  margin-bottom: .3em;
}
.plate-tagline { font-size: 1.1rem; line-height: 1.55; }
.plate-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .9rem 1.5rem;
  margin: 1.4rem 0 1.6rem; padding-top: 1.1rem;
  border-top: 1px solid rgba(200, 146, 47, .4);
  font-family: var(--f-ui);
}
.plate-facts dt { font-size: .82rem; color: var(--rack-muted); }
.plate-facts dd { margin: .1rem 0 0; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.plate-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 640px) {
  .hero { display: block; min-height: 0; }
  .hero-slides { position: relative; height: 60vw; z-index: 0; }
  .hero::after { display: none; }
  .hero-inner { width: 100%; padding: 0; }
  .plate { max-width: none; border-inline: 0; padding: 1.75rem 1.4rem 1.5rem; background-color: var(--rack); }
}

/* ---------- Inner page title band ---------- */
.page-band { background: var(--rack); color: var(--rack-ink); padding: 2.75rem 0 2.25rem; }
.crumb { font: 500 .92rem/1.3 var(--f-ui); margin-bottom: .6rem; }
.crumb a { color: var(--rack-muted); }
.page-band h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-stretch: 72%; font-weight: 800; color: var(--plate-ink); margin-bottom: .35em; }
.page-band .lead { max-width: 42rem; font-size: 1.12rem; margin: 0; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--rule); }

/* A feature band on a machine home page (e.g. Zork on the ICT 1301) */
.feature-band {
  background: var(--rack); color: var(--rack-ink);
  border-block: 3px solid var(--brass);
  padding-block: clamp(2rem, 5vw, 3.25rem);
}
.feature-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.feature-art { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px rgba(200, 146, 47, .5), 0 12px 32px rgba(0, 0, 0, .35); transition: transform .2s ease; }
.feature-art:hover, .feature-art:focus-visible { transform: translateY(-2px); }
.feature-art img { display: block; width: 100%; height: auto; }
.feature-kicker {
  display: inline-block; margin: 0 0 .7rem; padding: .2rem .65rem; border-radius: 999px;
  background: var(--brass); color: var(--brass-ink); font: 700 .85rem/1.3 var(--f-ui); letter-spacing: .04em;
}
.feature-band h2 { color: var(--plate-ink); font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-stretch: 75%; font-weight: 800; margin: 0 0 .6rem; }
.feature-band p { font-size: 1.08rem; }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 1.25rem 0 0; }
.feature-more { color: var(--rack-ink); font: 600 1rem/1.3 var(--f-ui); }
.feature-more:hover { color: var(--brass-hi); }
.feature-band + .section { border-top: 0; }
@media (max-width: 760px) { .feature-inner { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .feature-art { transition: none; } .feature-art:hover { transform: none; } }
.section-head { max-width: 46rem; margin-bottom: 2rem; }
.section-intro { color: var(--muted); font-size: 1.05rem; margin: 0; }
.prose { max-width: 42rem; }
.prose h3 { margin-top: 1.8em; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.aside-box {
  font-family: var(--f-ui); font-size: .95rem; line-height: 1.55;
  background: var(--surface); border-left: 3px solid var(--brass);
  padding: 1.25rem 1.5rem;
}
.aside-box h2 { font-size: 1.1rem; }
.aside-box p:last-child { margin: 0; }

/* Information and instruction page links */
.guide-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }
.guide-links a { color: inherit; text-decoration: none; display: block; }
.guide-links img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--rack); margin-bottom: 1rem; }
/* A wide logo (site.php 'img_fit' => 'contain'): show it whole, on the card's navy background */
.guide-links img.fit-contain { object-fit: contain; padding: 0 .5rem; }
.guide-links h3 { color: var(--link); margin-bottom: .3em; }
.guide-links a:hover h3 { text-decoration: underline; text-underline-offset: .15em; }
.guide-links p { color: var(--muted); margin: 0; }

/* ---------- Simulation list ---------- */
.sims { background: var(--surface); }
.sim-group + .sim-group { margin-top: 3rem; }
.sim-group-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.25rem;
  border-bottom: 1px solid var(--rule); padding-bottom: .7rem; margin-bottom: 1.5rem;
}
.sim-group-head h3 { margin: 0; }
.sim-group-head p { margin: 0; font: .95rem/1.4 var(--f-ui); color: var(--muted); }
.sim-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2rem 1.5rem;
}
.sim-card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.sim-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--rack); }
.sim-card.is-current img { outline: 3px solid var(--brass); outline-offset: 3px; }
.sim-meta { font: 500 .85rem/1.3 var(--f-ui); color: var(--muted); margin: .9rem 0 .25rem; }
.here { display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border-radius: 2px; background: var(--brass); color: var(--brass-ink); font-size: .78rem; font-weight: 600; }
.sim-card h4 { margin-bottom: .35rem; }
.sim-text { flex: 1; font-size: .95rem; line-height: 1.5; color: var(--muted); margin: 0 0 .8rem; }
.sim-cta { font: 600 .92rem/1.3 var(--f-ui); color: var(--link); }
.sim-card a:hover h4, .sim-card a:hover .sim-cta { text-decoration: underline; text-underline-offset: .15em; }

@media (max-width: 640px) {
  .sim-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .75rem;
    margin-right: -1.25rem; padding-right: 1.25rem;
  }
  .sim-card { scroll-snap-align: start; }
}

/* ---------- About, credits, licence ---------- */
.credits-col h2 { font-size: 1.35rem; }
.credits-col h2 + * { margin-top: 0; }
.credits { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1.1rem; }
.credits a { font: 600 1rem/1.3 var(--f-ui); }
.credits p { margin: .2rem 0 0; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.credits-col #licence { margin-top: 2.25rem; }
.licence img { margin-bottom: .6rem; }
.licence { font-size: .95rem; }

/* ---------- Information / instruction pages ---------- */
.doc { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); padding-block: 3rem 4.5rem; }
.toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 6.5rem); overflow-y: auto; overscroll-behavior: contain; font-family: var(--f-ui); font-size: .93rem; }
.toc > nav + nav { margin-top: 1.75rem; }
.toc h2 { font-size: .92rem; font-weight: 600; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; margin-left: -1px; padding: .32rem .9rem; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--brass); }

.article { max-width: 42rem; }
.article > h2 { margin-top: 2.6rem; }
.article > h2:first-child { margin-top: 0; }
.article figure { margin: 2rem 0; }
.article figure img { border-radius: var(--radius); width: 100%; }
a[href^="/glossary#"] { text-decoration-style: dotted; text-underline-offset: .18em; }
.gloss-tip {
  position: absolute; z-index: 60; max-width: min(22rem, calc(100vw - 16px));
  padding: .75rem .95rem; border-radius: var(--radius);
  background: var(--rack); color: var(--rack-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  font: .9rem/1.5 var(--f-ui);
}
.gloss-tip strong { display: block; margin-bottom: .2rem; font-weight: 650; }
.glossary-index { margin: 1.5rem 0 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font-family: var(--f-ui); }
.glossary-index h2 { font-size: 1rem; margin: 0 0 .5rem; }
.glossary-index ul { list-style: none; margin: 0; padding: 0 !important; columns: 13rem auto; column-gap: 1.5rem; font-size: .92rem; line-height: 1.7; }
.glossary-index li { break-inside: avoid; }
.glossary dt { margin-top: 1.4rem; font: 650 1.05rem/1.3 var(--f-ui); scroll-margin-top: 5rem; }
.glossary dd { margin: .3rem 0 0; }
.glossary dt:target, .glossary dt:target + dd { background: var(--surface); box-shadow: -.6rem 0 0 var(--surface), .6rem 0 0 var(--surface); }
.glossary dt:target { border-left: 3px solid var(--brass); padding-left: .5rem; margin-left: calc(-.5rem - 3px); }
.article figcaption { font: .88rem/1.45 var(--f-ui); color: var(--muted); margin-top: .55rem; }
.article ul:not(.steps) { padding-left: 1.2rem; }
.article li { margin-bottom: .4em; }

/* Worked examples: tables, equations, videos */
.article table { border-collapse: collapse; margin: 1.5rem 0; font: .95rem/1.3 var(--f-ui); font-variant-numeric: tabular-nums; }
.article th, .article td { border: 1px solid var(--rule); padding: .35rem .6rem; text-align: center; }
.article thead th, .article th[scope="row"] { background: var(--surface); font-weight: 600; }
.article tr > th[scope="row"] { text-align: left; }
.table-scroll { overflow-x: auto; }
.article table.text-table th, .article table.text-table td { text-align: left; }
.table-pair { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.table-pair > div > table { margin-bottom: .5rem; }
.equation { text-align: center; font: 600 1.15rem/1.5 var(--f-ui); margin: 1.25rem 0; }
.equation small { display: block; font: .9rem var(--f-text); color: var(--muted); margin: .25rem 0; }
.mono-cell { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-x: auto; white-space: pre; text-align: center; }
.t-plain { color: var(--t-plain); }
.t-key { color: var(--t-key); }
.t-cipher { color: var(--t-cipher); }
.hl { background: var(--surface); color: var(--t-cipher); }
.hl-2 { background: var(--surface); color: var(--t-plain); }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.article figure.portrait { max-width: 14rem; }
.small { font-size: .88rem; color: var(--muted); }
.article blockquote { margin: 1.5rem 0; padding: .2rem 0 .2rem 1.25rem; border-left: 3px solid var(--rule); color: var(--muted); font-style: italic; }
.article pre { overflow-x: auto; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font: .82rem/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; }
/* Zork page: the Flexowriter printout and expandable detail */
.article pre.flexo { background: #FBF8EF; color: #1E1E1E; border-color: #D8D0B8; }
.flexo .typed { color: #B3261E; }
.article details { margin: 1rem 0; border: 1px solid var(--rule); border-radius: var(--radius); padding: .6rem 1rem; background: var(--surface); }
.article details > summary { cursor: pointer; font: 600 1rem/1.4 var(--f-ui); }
.article details[open] > summary { margin-bottom: .6rem; }
.tone-demo .btn { margin: 0 .4rem .5rem 0; }
.reading { list-style: none; padding: 0 !important; }
.reading > li { padding: 1rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.reading h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.reading p { margin: .3rem 0 0; }

.note { background: var(--surface); border-left: 3px solid var(--brass); padding: 1rem 1.25rem; margin: 1.5rem 0; font-size: .98rem; }
.note > :last-child { margin-bottom: 0; }

/* A step for the reader to do in the simulation */
.try { position: relative; padding: .8rem 1.1rem .8rem 2.9rem; margin: 1.25rem 0; border-radius: var(--radius); background: var(--rack); color: var(--rack-ink); font: 600 .97rem/1.5 var(--f-ui); }
.try a { color: var(--rack-ink); text-decoration-line: underline; text-underline-offset: .18em; }
.try a:hover { color: var(--brass-hi); }
.try::before { content: "\2192"; position: absolute; left: 1.05rem; top: .78rem; color: var(--brass-hi); font-weight: 700; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: 1.3rem; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .05rem;
  width: 2rem; height: 2rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--rack); color: var(--brass-hi);
  font: 700 .95rem/1 var(--f-ui);
}
.steps strong { font-family: var(--f-ui); }

kbd {
  font: 600 .82em/1 var(--f-ui);
  padding: .15em .45em; border: 1px solid var(--rule); border-bottom-width: 2px;
  border-radius: 3px; background: var(--surface); color: var(--ink);
}

.doc-next { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; font-family: var(--f-ui); }
.doc-next .btn { margin-left: auto; }
.doc-next a { font-weight: 600; }

@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; max-height: none; overflow: visible; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--rack); color: var(--rack-ink); font: .95rem/1.5 var(--f-ui); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding-block: 3rem 2.5rem; }
.site-footer h2 { font-size: .95rem; font-weight: 600; color: var(--rack-muted); margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--rack-ink); text-decoration: none; }
.site-footer a:hover { color: var(--brass-hi); text-decoration: underline; }
.footer-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--rack-2); padding-block: 1.25rem; color: var(--rack-muted); font-size: .88rem;
}
.footer-base p { margin: 0; }
.socials { display: flex; gap: 1.1rem; font-size: 1.3rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
