/* ── SHARED STYLES ──
   Loaded by index.html, case-studies.html, pz-mod.html and this-website.html.
   Page-specific rules stay in each page's own <style> block.
   easter.html is deliberately standalone and does not use this file. */

/* ── FONTS ──
   Self-hosted, so rendering text costs no third-party request: no DNS lookup
   and TLS handshake to fonts.googleapis.com for a stylesheet, then another to
   fonts.gstatic.com for the files. It also keeps both origins out of the CSP
   and means no visitor request reaches Google.
   Licences and refresh instructions: assets/fonts/README.md */
@font-face {
  font-family: 'Share Tech Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/share-tech-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vt323-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Sixtyfour Convergence';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/sixtyfour-convergence-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── VARIABLES ── */
:root {
  --bg: #0f0f0f;
  --bg2: #141414;
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.15);
  --text: #e8e6e0;
  /* Contrast on --bg, WCAG AA wants 4.5:1 for text and 3:1 for UI graphics:
       --text    15.4:1   headlines and emphasis
       --muted2   6.7:1   article body copy
       --muted    4.9:1   secondary text: nav, labels, subtitles, footer
       --dim      3.3:1   decorative glyphs ONLY (the '//' marks, the '▾')
     --muted was #6b6b6b (3.6:1) and --dim was #2a2a2a (1.3:1), which made the
     footer and the service numbers effectively invisible. Anything that is a
     word now uses --muted or brighter; --dim is not for words. */
  --muted: #808080;
  --muted2: #999;
  --dim: #666666;
  --scan: rgba(0, 0, 0, 0.03);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='20' viewBox='0 0 16 20'%3E%3Cpolygon points='0,0 0,16 4,12 7,19 9,18 6,11 11,11' fill='white' stroke='black' stroke-width='1'/%3E%3C/svg%3E") 0 0, auto;
  overflow-x: hidden;
}

/* ── SCANLINE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      var(--scan) 0px,
      var(--scan) 1px,
      transparent 1px,
      transparent 3px);
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── NOISE TEXTURE ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--border);
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(8px);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a,
.nav-links button {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links button:hover {
  color: var(--text);
}

.nav-logo-link {
  display: block;
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* ── MOBILE MENU BUTTON ──
   display: none on desktop is load-bearing: it keeps <nav> at two flex children
   so justify-content: space-between lays out exactly as it always has. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 13px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--muted);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s;
}

.nav-toggle:hover span {
  background: var(--text);
}

.nav-open .nav-toggle span {
  background: var(--text);
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── NAV DROPDOWN ── */
.nav-links li {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  line-height: inherit;
}

.nav-dropdown-toggle::after {
  content: '▾';
  font-size: 10px;
  color: var(--dim);
  transition: color 0.15s;
}

.nav-dropdown-toggle:hover::after {
  color: var(--text);
}

.dropdown {
  position: absolute;
  top: calc(100% + 0.9rem);
  left: 0;
  min-width: 230px;
  background: rgba(15, 15, 15, 0.98);
  border: 0.5px solid var(--border2);
  list-style: none;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li a {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.dropdown li a:hover {
  color: var(--text);
  background: var(--bg2);
}

/* ── HERO ──
   Each page sets its own .hero padding / height / alignment locally, plus the
   matching mobile padding — the landing heroes are full-height and the article
   heroes are a short banner. Everything below is common to all four. */
.hero {
  position: relative;
  border-bottom: 0.5px solid var(--border);
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero-kicker {
  font-family: 'Sixtyfour Convergence', sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 0.5px;
  background: var(--muted);
}

.hero-headline {
  font-family: 'VT323', monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(232, 230, 224, 0.4);
}

.hero-headline em {
  font-style: normal;
  color: var(--muted2);
}

.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.8;
}

/* grid overlay */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── SECTION LABEL ── */
.section-label {
  font-family: 'Sixtyfour Convergence', sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 0.5px;
  background: var(--muted);
}

/* ── TOOL WORD POP ── */
.tool-word {
  cursor: default;
  display: inline-block;
  padding: 4px 3px;
  margin: -4px -3px;
}

.tool-pixel {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  border-radius: 1px;
}

/* ── FOOTER ── */
footer {
  padding: 2rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy,
.footer-mark {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-decoration: none;
}

/* ── FOCUS ──
   :focus-visible only, so a mouse click stays clean and only keyboard users
   get the ring. Phosphor glow to match the type rather than the UA default. */
:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

.nav-links a:focus-visible,
.nav-dropdown-toggle:focus-visible,
.dropdown li a:focus-visible,
.footer-copy:focus-visible,
.footer-mark:focus-visible {
  color: var(--text);
  outline-offset: 2px;
  box-shadow: 0 0 8px rgba(232, 230, 224, 0.25);
}

/* ── ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  /* The five links plus the logo need 410px of a 390px phone, so below the
     breakpoint the row becomes a panel under the bar. It is a disclosure, not a
     modal: it does not cover the page, so focus is deliberately NOT trapped. */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    background: rgba(15, 15, 15, 0.98);
    border-bottom: 0.5px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  }

  .nav-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a,
  .nav-dropdown-toggle {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
  }

  .nav-dropdown-toggle {
    display: flex;
    justify-content: space-between;
  }

  /* Inline and indented rather than a floating card, and opened only by tap or
     keyboard focus — :hover sticks after a tap on touch screens. */
  .dropdown {
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    transform: none;
    display: none;
  }

  .has-dropdown.open .dropdown,
  .has-dropdown:focus-within .dropdown {
    display: block;
  }

  .dropdown li a {
    padding: 0.8rem 1.5rem 0.8rem 2.75rem;
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ── REDUCED MOTION ──
   The reveal transitions, the blinking terminal cursor and the glitch shakes
   are decoration. Honour the OS setting and drop them. .reveal needs the
   explicit opacity/transform reset: killing the transition on its own would
   leave the content stranded at opacity: 0.
   The scanline and noise overlays stay — they are static, not motion. */
@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
