:root {
  --ink: #0a0e0d;
  --ink-soft: #111817;
  --panel: #17201e;
  --paper: #f3ead9;
  --paper-muted: #b9b5a7;
  --phosphor: #9dff72;
  --cyan: #70e7e1;
  --orange: #ff8a3d;
  --yellow: #f6d35f;
  --danger: #ff6b70;
  --line: #3c4b47;
  --max: 1160px;
  --radius: 12px;
  --shadow: 8px 8px 0 #030504;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink) url("../Pics/ScanBG1.jpg") repeat;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: rgba(4, 8, 7, 0.84);
  content: "";
}

img,
video,
embed,
object,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: var(--phosphor);
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  translate: 0 -180%;
  background: var(--paper);
  color: var(--ink);
  font: 800 0.85rem/1 system-ui, sans-serif;
}

.skip-link:focus {
  translate: 0;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 13, 0.96);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 76px;
  margin-inline: auto;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--paper);
  font-family: "Arial Narrow", "Franklin Gothic Condensed", Impact, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand:hover {
  color: var(--paper);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 34px;
  border: 2px solid var(--orange);
  place-items: center;
  color: var(--phosphor);
  font-size: 0.72rem;
  letter-spacing: 0;
  box-shadow: 4px 4px 0 #000;
  transform: skew(-5deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-nav a {
  padding: 0.7rem 0.65rem;
  color: var(--paper-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--phosphor);
}

.menu-button {
  display: none;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--paper);
  font: 800 0.75rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.section-label,
.archive-note,
.caption,
.link-legend,
.fact-label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow,
.section-label {
  color: var(--orange);
}

h1,
h2,
h3 {
  margin-block: 0 0.6em;
  color: var(--paper);
  font-family: "Arial Narrow", "Franklin Gothic Condensed", Impact, sans-serif;
  line-height: 0.98;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.4rem, 10vw, 8.5rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

h3 {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.05;
}

p {
  margin-block: 0 1.15rem;
}

.shell {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.hero {
  display: grid;
  min-height: min(840px, calc(100vh - 76px));
  padding-block: clamp(3rem, 8vw, 7rem);
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero h1 span {
  display: block;
  color: var(--phosphor);
}

.hero-deck {
  max-width: 42rem;
  color: var(--paper-muted);
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.45;
}

.button-row {
  display: flex;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 0.85rem 1.15rem;
  border: 2px solid var(--orange);
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: var(--ink);
  font: 900 0.78rem/1 system-ui, sans-serif;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 #000;
}

.button:hover,
.button:focus-visible {
  background: var(--yellow);
  color: var(--ink);
}

.button-secondary {
  border-color: var(--line);
  background: var(--ink-soft);
  color: var(--paper);
}

.hero-machine {
  position: relative;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: var(--ink-soft);
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
}

.hero-machine img {
  display: block;
  width: 100%;
  filter: contrast(1.07) saturate(0.9);
}

.hero-machine figcaption {
  padding: 0.7rem 0.35rem 0.15rem;
  color: var(--paper-muted);
}

.wire {
  display: inline-block;
  width: 50px;
  height: 7px;
  margin-right: 0.5rem;
  background: var(--phosphor);
  vertical-align: middle;
  box-shadow: 0 0 12px rgba(157, 255, 114, 0.7);
}

.intro-strip {
  border-block: 1px solid var(--line);
  background: var(--ink-soft);
}

.facts {
  display: grid;
  margin: 0;
  padding: 1.35rem 0;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.fact {
  padding: 0.5rem clamp(0.8rem, 3vw, 2rem);
  border-left: 1px solid var(--line);
}

.fact:first-child {
  border-left: 0;
}

.fact dt {
  color: var(--paper-muted);
}

.fact dd {
  margin: 0.15rem 0 0;
  color: var(--phosphor);
  font-family: "Arial Narrow", "Franklin Gothic Condensed", Impact, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1;
  text-transform: uppercase;
}

.section {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.52fr);
  align-items: end;
  gap: 2rem;
}

.section-heading p {
  color: var(--paper-muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.quote-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-left: 6px solid var(--phosphor);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quote-panel blockquote {
  margin: 0 0 1rem;
  color: var(--paper);
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.45;
}

.quote-panel cite {
  color: var(--paper-muted);
  font: 800 0.75rem/1.4 system-ui, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.archive-card {
  display: flex;
  min-height: 250px;
  padding: 1.35rem;
  border: 1px solid var(--line);
  flex-direction: column;
  background: var(--panel);
  color: var(--paper);
  text-decoration: none;
  box-shadow: 5px 5px 0 #030504;
}

.archive-card:nth-child(even) {
  transform: translateY(0.75rem);
}

.archive-card:hover {
  border-color: var(--phosphor);
  color: var(--paper);
  translate: 0 -4px;
}

.archive-card img {
  width: 100%;
  height: 120px;
  margin-bottom: 1.1rem;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.1);
}

.archive-card small {
  margin-top: auto;
  color: var(--cyan);
  font: 800 0.7rem/1.3 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-photo {
  margin: 0;
}

.story-photo img {
  display: block;
  width: 100%;
  max-height: 560px;
  border: 1px solid var(--line);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.story-photo figcaption {
  padding-top: 0.8rem;
  color: var(--paper-muted);
}

.video-links {
  display: grid;
  margin-top: 2rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.video-link {
  padding: 1rem;
  border-top: 3px solid var(--orange);
  background: var(--ink-soft);
  color: var(--paper);
  font-family: system-ui, sans-serif;
  text-decoration: none;
}

.video-link strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--phosphor);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.shop-card {
  display: grid;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: var(--panel);
  grid-template-columns: 145px 1fr;
  gap: 1.5rem;
}

.shop-card img {
  width: 100%;
  align-self: start;
}

.all-pages {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  gap: 0.5rem 1.5rem;
}

.all-pages a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px dotted var(--line);
  font-family: system-ui, sans-serif;
  text-decoration: none;
}

.link-legend {
  display: flex;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px dashed var(--danger);
  align-items: center;
  background: rgba(255, 107, 112, 0.08);
  color: var(--paper-muted);
  gap: 0.75rem;
}

.link-legend::before {
  color: var(--danger);
  content: "Loose wire";
}

a.broken-link,
a[data-link-status="broken"] {
  padding: 0.08em 0.25em;
  border: 1px dashed var(--danger);
  background: rgba(255, 107, 112, 0.12);
  color: #ffb2b5 !important;
  text-decoration-style: wavy;
}

a.broken-link::after,
a[data-link-status="broken"]::after {
  display: inline-block;
  margin-left: 0.45em;
  padding: 0.15em 0.35em;
  background: var(--danger);
  color: var(--ink);
  content: "needs repair";
  font: 900 0.58rem/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

.site-footer {
  padding-block: 3rem;
  border-top: 1px solid var(--line);
  background: #070a09;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.footer-note {
  max-width: 44rem;
  color: var(--paper-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}

/* Original pages: same old material, with room to breathe. */
.legacy-page {
  background: var(--ink) url("../Pics/ScanBG1.jpg") repeat;
  color: var(--paper);
}

.legacy-main {
  overflow: hidden;
  width: min(calc(100% - 2rem), 980px);
  min-height: 70vh;
  margin: clamp(2rem, 6vw, 5rem) auto;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  background: rgba(17, 24, 23, 0.96);
  box-shadow: var(--shadow);
}

.legacy-main::before {
  display: block;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--orange);
  content: "FROM THE ORIGINAL SCANIMATE ARCHIVE  •  ORIGINAL WORDS & IMAGES PRESERVED";
  font: 900 0.7rem/1.4 system-ui, sans-serif;
  letter-spacing: 0.1em;
}

.legacy-main h1,
.legacy-main h2,
.legacy-main h3 {
  margin-top: 1.2em;
  color: var(--phosphor) !important;
}

.legacy-main font,
.legacy-main font[color] {
  color: inherit !important;
  font-size: inherit;
}

.legacy-main table {
  width: min(100%, 900px) !important;
  max-width: 100% !important;
  margin: 1.5rem auto;
  border-collapse: separate;
  border-spacing: 0.8rem;
}

.legacy-main td,
.legacy-main th {
  width: auto !important;
  max-width: 100%;
  padding: 0.35rem;
  vertical-align: top;
}

.legacy-main img {
  max-width: 100% !important;
}

.legacy-main hr {
  height: 1px;
  margin: 2rem 0;
  border: 0;
  background: var(--line);
}

.legacy-main blockquote {
  max-width: 50rem;
  margin-inline: auto;
}

.legacy-main object,
.legacy-main embed,
.legacy-main iframe {
  width: min(100%, 720px) !important;
  height: auto;
  min-height: 315px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
}

.legacy-footer {
  width: min(calc(100% - 2rem), 980px);
  margin: 0 auto 3rem;
  color: var(--paper-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    background: var(--ink);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav a {
    min-height: 44px;
    border-bottom: 1px solid var(--line);
  }

  .menu-button {
    display: inline-block;
  }

  .hero,
  .section-heading,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-machine {
    width: min(100%, 620px);
  }

  .card-grid,
  .all-pages {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .header-inner,
  .shell {
    width: min(calc(100% - 1.25rem), var(--max));
  }

  .brand {
    font-size: 1.15rem;
  }

  .brand-mark {
    width: 36px;
    height: 30px;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .fact:nth-child(3) {
    border-left: 0;
  }

  .fact:nth-child(n + 3) {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  .card-grid,
  .all-pages,
  .video-links,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .archive-card:nth-child(even) {
    transform: none;
  }

  .shop-card {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .legacy-main {
    width: calc(100% - 1rem);
    margin-block: 1rem 2rem;
    padding: 1rem;
  }

  .legacy-main table,
  .legacy-main tbody,
  .legacy-main tr,
  .legacy-main td,
  .legacy-main th {
    display: block;
    width: 100% !important;
  }

  .legacy-main table {
    border-spacing: 0;
  }

  .legacy-main td {
    margin-bottom: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
