@font-face {
  font-family: "VT323";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/vt323-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/plex-mono-600.woff2") format("woff2");
}

:root {
  --canvas: #000000;   /* AMOLED black beside the sheet */
  --sheet: #131313;    /* very dark gray content panel */
  --edge: #262626;     /* sheet edge, rules, card borders (shadows vanish on black) */
  --text: #e6e6e6;     /* one text color, off-white */
  --accent: #3ccf7a;   /* bright green: headings, links, the top strip */
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --crt: "VT323", ui-monospace, monospace;
  --measure: 44rem;
  --gutter: 1.25rem;
}

* { box-sizing: border-box; }
html { background: var(--sheet); color-scheme: dark; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.98rem;
  line-height: 1.75;
  /* Column layout so the footer sits at the foot of short pages */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
main > :last-child { margin-bottom: 0; }
.site-nav-inner,
main,
.site-footer {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header: pinned, with a thin accent strip across the top of the window */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sheet);
  border-top: 4px solid var(--accent);
  margin-bottom: 2.5rem;
}
.site-nav { border-bottom: 1px solid var(--edge); background: var(--sheet); }
.site-nav-inner {
  padding-block: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}
/* Terminal-style nav: a glowing prompt as the home link, pages as paths, ">" marks where you are */
.site-nav-inner nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.25rem; }
.site-nav-inner a { color: var(--text); text-decoration: none; }
.brand {
  font-family: var(--crt);
  font-size: 1.6rem;
  line-height: 1;
  color: #8dffbc !important;
  text-shadow: 0 0 2px rgba(60, 207, 122, 0.9), 0 0 9px rgba(60, 207, 122, 0.5);
}
.brand:hover { text-shadow: 0 0 2px rgba(60, 207, 122, 1), 0 0 14px rgba(60, 207, 122, 0.8); }
.path { position: relative; font-size: 0.92rem; }
.path:hover,
.path.current { color: var(--accent); }
.path.current { font-weight: 600; }
.path.current::before { content: ">"; position: absolute; right: 100%; margin-right: 0.3em; }
.path:hover { text-decoration: underline; text-underline-offset: 0.25em; }

/* Wide screens: black canvas with dim solder-mask traces, and the page as a sheet on top of it
   with a crisp edge. The header is see-through beside the sheet so the traces run up to the top.
   Kept after the base header rules so it wins the cascade. */
@media (min-width: 53rem) {
  html { background: var(--canvas) url("/assets/img/board.svg") center top / 1600px 1200px; }
  body { position: relative; }
  body::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 25rem);
    z-index: -1;
    background: var(--sheet);
    border-inline: 1px solid var(--edge);
  }
  .site-header { background: linear-gradient(90deg, transparent calc(50% - 25rem), var(--sheet) calc(50% - 25rem), var(--sheet) calc(50% + 25rem), transparent calc(50% + 25rem)); }
  .site-nav { max-width: 50rem; margin-inline: auto; }
}

/* Type */
h1, h2, h3 { font-family: var(--mono); color: var(--accent); line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(2rem, 8vw, 2.8rem); margin: 0 0 0.75rem; overflow-wrap: anywhere; }
h2 { font-size: 1.5rem; margin: 2.75rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Homepage hero: the title glows like a CRT, with a hint of red/blue fringing and a gentle
   flicker that never flashes; motion stops for visitors who ask for reduced motion. */
.hero { margin: 0 0 2.25rem; }
.crt {
  margin: 0;
  font-family: var(--crt);
  font-weight: 400;
  font-size: clamp(2rem, 9vw, 4.2rem);
  line-height: 1;
  white-space: nowrap;      /* keeps the cursor on the title's line */
  overflow-wrap: normal;
  color: #8dffbc;
  text-shadow: 0 0 2px rgba(60, 207, 122, 0.9), 0 0 10px rgba(60, 207, 122, 0.55), 0 0 22px rgba(60, 207, 122, 0.3),
               -1.5px 0 rgba(255, 70, 70, 0.35), 1.5px 0 rgba(70, 140, 255, 0.35);
  animation: crt-flicker 6s infinite;
}
.crt .cursor { animation: blink 1.1s steps(1) infinite; }
.hero .tagline { margin: 0.9rem 0 0; font-size: 1.1rem; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes crt-flicker {
  0%, 100% { opacity: 1; transform: none; }
  47% { opacity: 0.97; }
  48% { opacity: 0.9; transform: translateX(0.5px); }
  49% { opacity: 1; transform: none; }
  82% { opacity: 0.96; }
}

/* Homepage cards, one per page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.card { display: block; text-decoration: none; color: var(--text); border: 1px solid var(--edge); border-radius: 6px; padding: 1.1rem 1.2rem 1.2rem; transition: border-color 0.15s; }
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.card p { margin: 0; font-size: 0.92rem; }
.card.soon h3 { color: var(--text); }
.tag {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--edge);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
}

.lede { margin: 0 0 2rem; }
.fine-print { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--edge); font-size: 0.78rem; }

/* Commander decks: commander art beside the deck name, colors, and a short summary */
.decks { display: grid; gap: 1rem; }
.deck { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; align-items: start; border: 1px solid var(--edge); border-radius: 6px; padding: 1rem; }
.deck-art img { display: block; width: 100%; height: auto; border-radius: 4px; }
.deck h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.deck h2 a { text-decoration: none; }
.deck h2 a:hover { text-decoration: underline; }
.deck p { margin: 0 0 0.6rem; font-size: 0.9rem; }
.deck .deck-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; margin-bottom: 0.7rem; }
.deck .credit { margin: 0; font-size: 0.75rem; }
.pips { display: inline-flex; gap: 0.2rem; }
.pip { display: block; width: 1.25rem; height: 1.25rem; }
@media (max-width: 34rem) {
  .deck { grid-template-columns: 1fr; }
  .deck-art img { aspect-ratio: 2 / 1; object-fit: cover; object-position: center 30%; }
}

.site-footer { margin-top: 4rem; padding-bottom: 4rem; font-size: 0.85rem; }
.site-footer p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--edge);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
/* Brand icons (Simple Icons, CC0) masked so they take the link color, including hover */
.social { display: inline-flex; align-items: center; gap: 0.4em; }
.social::before {
  content: "";
  width: 1.1em;
  height: 1.1em;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.social-discord { --icon: url("/assets/img/icons/discord.svg"); }
.social-twitch { --icon: url("/assets/img/icons/twitch.svg"); }
.social-youtube { --icon: url("/assets/img/icons/youtube.svg"); }

/* Kept last so it wins the cascade */
@media (prefers-reduced-motion: reduce) {
  .crt, .crt .cursor { animation: none; }
  .card { transition: none; }
}
