@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/assets/fonts/archivo-100-900.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/space-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/space-mono-700.woff2') format('woff2');
}
/* Whiphand (Rian Hughes / Device) — subset to the six glyphs of the mark.
   Licensing note: retail font; a webfont license from Device/MyFonts is
   required for production use. */
@font-face {
  font-family: 'Whiphand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/whiphand-mark.woff2') format('woff2');
}

/* base64.amsterdam — design system
   "The whole site is the screen." Dark-first: a deep phosphor ground with
   hairline rules, the brand chartreuse (#ebff32) as glow and surface, and
   seeded glyph fields as ambient texture (pure CSS steps() mutation — no
   JavaScript anywhere). Whiphand carries the mark; Archivo (variable width,
   full expansion) carries headlines; Space Mono carries labels and the real
   base64 encodings. Long-form articles print onto a paper sheet — encoded
   world on screen, decoded output on paper. */

:root {
  --screen: #0c0c09;        /* ground */
  --screen-2: #12120e;      /* raised tiles */
  --line: #2a2a22;          /* hairlines on dark */
  --text: #d8d8c8;
  --strong: #f2f2e4;
  --muted: #8f8f80;
  --volt: #ebff32;          /* brand chartreuse — glow, surfaces, highlights */
  --volt-deep: #d2e612;
  --phosphor: #a8b426;      /* chartreuse's readable voice for small text on dark */
  --paper: #f7f8ee;         /* decoded output */
  --ink: #1f1f1a;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --rule: 1px solid var(--line);
  --gutter: clamp(20px, 4vw, 48px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sB { opacity: 0; }
}
body {
  margin: 0;
  overflow-x: hidden; /* .crt spans 100vw, which includes the scrollbar gutter */
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 410;
  line-height: 1.6;
  color: var(--text);
  background: var(--screen);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* type roles ------------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0 0 0.45em; text-wrap: balance; color: var(--strong); }
.display, .headline, .subhead {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 780;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.display  { font-size: clamp(2.5rem, 7.5vw, 6.4rem); }
.headline { font-size: clamp(1.8rem, 4vw, 3.4rem); }
.subhead  { font-size: clamp(1.1rem, 1.9vw, 1.45rem); line-height: 1.1; }
p { margin: 0 0 1em; }
.lede { font-size: 1.14rem; line-height: 1.65; max-width: 58ch; }
.muted { color: var(--muted); }

.mono, .b64 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
}
.b64 { color: var(--phosphor); }
.b64 .decoded { color: var(--muted); }
.b64 .decoded::before { content: " ⇢ "; }

/* glyph fields — two seeded states per cell, hard-swapped by steps() ------- */
.field { max-width: 100%; height: auto; display: block; }
.sA, .sB { animation-timing-function: steps(1); animation-iteration-count: infinite; }
.sA { animation-name: swapA; }
.sB { animation-name: swapB; }
@keyframes swapA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes swapB { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

/* the ruled sheet --------------------------------------------------------- */
.sheet {
  max-width: var(--max);
  margin: 0 auto;
  border-left: var(--rule);
  border-right: var(--rule);
  min-height: 100vh;
  background: var(--screen);
}
.cell { padding: clamp(48px, 7vw, 104px) var(--gutter); }
.cell + .cell, .rule-top { border-top: var(--rule); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(32px, 4vw, 56px);
}

/* nav --------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--screen) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--rule);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  border-left: var(--rule);
  border-right: var(--rule);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.wordmark {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 820;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--strong);
}
.wordmark em { font-style: normal; color: var(--volt); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
.nav-links a:hover { color: var(--volt); }
.nav-cta {
  border: 1px solid var(--text);
  padding: 8px 18px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-cta:hover { background: var(--volt); border-color: var(--volt); color: var(--ink) !important; }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 760px) {
  .nav-burger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
    cursor: pointer;
  }
  .nav-burger span { width: 24px; height: 2px; background: var(--strong); transition: transform 0.2s; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    background: var(--screen);
    border-bottom: var(--rule);
    padding: 20px var(--gutter) 28px;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-toggle:checked ~ .nav-burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

/* CRT intro — full-bleed screen, the glyph field is the background ---------- */
.crt {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  background: #0a0a07;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  overflow: hidden;
  padding: 48px var(--gutter);
  text-align: center;
}
.crt > .field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}
/* dim the field behind the mark, then vignette + scanlines over everything */
.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 38% at center,
    rgba(10, 10, 7, 0.92) 0%, rgba(10, 10, 7, 0.55) 55%, transparent 100%);
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.05) 0 1px,
      rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0) 55%,
      rgba(0, 0, 0, 0.6) 100%);
}
.crt-mark, .crt-sub, .crt-cue { position: relative; z-index: 1; }
.crt-mark {
  font-family: "Whiphand", var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 15vw, 12rem);
  line-height: 1;
  margin: 0;
  color: var(--volt);
  text-shadow:
    0 0 14px rgba(235, 255, 50, 0.55),
    0 0 55px rgba(235, 255, 50, 0.30),
    0 0 120px rgba(235, 255, 50, 0.18),
    -2px 0 6px rgba(255, 60, 90, 0.18),
    2px 0 6px rgba(60, 220, 255, 0.18);
  animation: crt-flicker 7s infinite;
}
.crt-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  letter-spacing: 0.55em;
  text-indent: 0.55em; /* re-center: tracking adds a trailing gap */
  text-transform: lowercase;
  color: #b9bd8e;
  margin: 0;
  text-shadow: 0 0 12px rgba(235, 255, 50, 0.25);
}
.crt-cue {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6f6f60;
  animation: crt-bob 2.4s ease-in-out infinite;
}
@keyframes crt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes crt-flicker {
  0%, 93%, 100% { opacity: 1; }
  94% { opacity: 0.82; }
  95% { opacity: 0.97; }
  96% { opacity: 0.88; }
  97% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .crt-mark { animation: none; }
}

/* hero (inner pages) ------------------------------------------------------- */
.hero { padding: clamp(56px, 9vw, 128px) var(--gutter); }
.hero .display { max-width: 14ch; }
.hero .display .acc {
  background: var(--volt);
  color: var(--ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.12em;
}
.hero-code {
  margin-top: clamp(28px, 4vw, 48px);
  max-width: 72ch;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--muted);
  word-break: break-all;
}
.hero-code b { font-weight: 400; color: var(--phosphor); }

/* meta strip ---------------------------------------------------------------- */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--rule);
  border-bottom: var(--rule);
  background: #0a0a07;
  color: var(--volt);
}
.meta-strip > div {
  padding: 14px var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-strip > div + div { border-left: var(--rule); }
@media (max-width: 900px) {
  .meta-strip { grid-template-columns: 1fr 1fr; }
  .meta-strip > div:nth-child(3) { border-left: none; border-top: var(--rule); }
  .meta-strip > div:nth-child(4) { border-top: var(--rule); }
}

/* split + columns ------------------------------------------------------------ */
.split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 72px);
}
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); }
.col { border-left: 1px solid var(--phosphor); padding-left: clamp(16px, 2vw, 28px); }
@media (max-width: 900px) {
  .split, .cols-3 { grid-template-columns: 1fr; }
}

/* tiles ----------------------------------------------------------------------- */
.tiles-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: var(--rule); }
.tiles-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: var(--rule); }
@media (max-width: 900px) { .tiles-2, .tiles-3 { grid-template-columns: 1fr; } }

.tile {
  display: block;
  text-decoration: none;
  padding: clamp(24px, 3vw, 40px);
  background: var(--screen-2);
  transition: background 0.15s, color 0.15s;
}
.tiles-2 > .tile:not(:first-child) { border-top: var(--rule); }
.tiles-3 > .tile:not(:first-child) { border-top: var(--rule); }
@media (min-width: 901px) {
  .tiles-2 > .tile:not(:first-child) { border-top: none; border-left: var(--rule); }
  .tiles-3 > .tile:not(:first-child) { border-top: none; border-left: var(--rule); }
}
.tile:hover { background: var(--volt); }
.tile:hover h3, .tile:hover p, .tile:hover .muted,
.tile:hover .tile-meta, .tile:hover .tile-more { color: var(--ink); }
.tile img {
  border: var(--rule);
  margin-bottom: 20px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.tile:hover img { border-color: var(--ink); }
.tile-art {
  border: var(--rule);
  margin-bottom: 20px;
  background: #0a0a07;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.tile-art .field { width: 100%; height: 100%; }
.tile:hover .tile-art { border-color: var(--ink); }
.tile h3 {
  font-stretch: 125%;
  font-weight: 780;
  text-transform: uppercase;
  font-size: 1.3rem;
  line-height: 1.05;
}
.tile p { font-size: 0.95rem; margin-bottom: 18px; color: var(--muted); }
.tile-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}
.tile-more {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--phosphor);
}
.tile-more::after { content: " →"; }

/* buttons + links -------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--volt);
  padding: 14px 30px;
  background: var(--volt);
  color: var(--ink);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: transparent; color: var(--volt); }
.band .btn { background: var(--ink); border-color: var(--ink); color: var(--volt); }
.band .btn:hover { background: transparent; color: var(--ink); }

.arrow-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid var(--volt-deep);
  padding-bottom: 3px;
  color: var(--strong);
}
.arrow-link::after { content: " →"; }
.arrow-link:hover { background: var(--volt); color: var(--ink); }

/* brand band ---------------------------------------------------------------------- */
.band { background: var(--volt); color: var(--ink); }
.band h1, .band h2, .band h3 { color: var(--ink); }
.band .b64 { color: var(--ink); }
.band .b64 .decoded { color: color-mix(in srgb, var(--ink) 55%, var(--volt)); }
.band .muted { color: color-mix(in srgb, var(--ink) 70%, var(--volt)); }

/* tags ------------------------------------------------------------------------------ */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--phosphor);
  color: var(--phosphor);
  padding: 6px 14px;
}

/* article — decoded output prints onto paper ---------------------------------------- */
.article { max-width: 760px; }
.article-head { margin-bottom: clamp(32px, 5vw, 56px); }
.article-head .headline { text-transform: none; font-stretch: 118%; letter-spacing: -0.02em; }
.article-body {
  background: var(--paper);
  color: var(--ink);
  border: var(--rule);
  padding: clamp(28px, 5vw, 64px);
  position: relative;
}
.article-body::before {
  content: "$ base64 -d";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #8a8a72;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dcded0;
}
.article-body h3 {
  font-stretch: 118%;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 2.2em 0 0.6em;
  color: var(--ink);
}
.article-body p { color: #3c3c34; }
.article-body p:first-of-type { font-size: 1.14rem; color: var(--ink); }

/* project media ---------------------------------------------------------------------- */
.project-media { display: grid; gap: var(--gutter); margin-top: clamp(32px, 5vw, 64px); }
.project-media img { border: var(--rule); }
.project-media-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .project-media-2 { grid-template-columns: 1fr; } }

/* footer — sign-off field above the mark ---------------------------------------------- */
.footer { border-top: var(--rule); background: #0a0a07; color: var(--text); }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) var(--gutter) 32px;
}
.footer-field { margin-bottom: clamp(28px, 4vw, 48px); opacity: 0.9; }
.footer-field .field { width: 100%; height: auto; }
.footer-mark {
  font-family: "Whiphand", var(--font-display);
  font-weight: 400;
  color: var(--volt);
  font-size: clamp(2.4rem, 7vw, 6rem);
  line-height: 1;
  margin: 0 0 4px;
  text-shadow: 0 0 12px rgba(235, 255, 50, 0.4), 0 0 40px rgba(235, 255, 50, 0.2);
}
.footer-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: #b9bd8e;
  margin: 0 0 48px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  border-top: var(--rule);
  padding-top: 32px;
  margin-bottom: 48px;
}
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer a:hover { color: var(--volt); }
.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #6f6f60;
  margin: 0;
}

/* misc -------------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--volt);
  color: var(--ink);
  padding: 8px 16px;
  z-index: 100;
  font-family: var(--font-mono);
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.center { text-align: center; }
.stack-gap { margin-top: clamp(28px, 4vw, 48px); }
