/* =====================================================================
   dtm.co.uk — shared stylesheet
   Tokens, page chrome (header / nav / footer) and common components.
   Page-specific styles live in a small <style> block on each page.
   ===================================================================== */

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

:root {
  --ink: #000010;
  --cyan: #00ffe7;
  --magenta: #ff00ff;
  --lilac: #e0b3ff;
  --text: #ecdcff;                      /* body copy: lilac, lifted for contrast */
  --muted: #a898c8;
  --line: rgba(0, 255, 231, 0.24);
  --panel: rgba(1, 1, 18, 0.8);
  --card: rgba(0, 0, 16, 0.72);
  --max: 1100px;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Share Tech Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background-color: var(--ink);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* fixed glitch backdrop + a dark wash and faint scanlines on top of it */
body::before, body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background: var(--ink) url('/bg-glitch.webp') center / cover no-repeat;
}
body::after {
  z-index: -1;
  background:
    repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.14) 3px 4px),
    linear-gradient(to bottom, rgba(0, 0, 16, 0.2), rgba(0, 0, 16, 0.45));
}

::selection { background: var(--magenta); color: var(--ink); }

a { color: var(--cyan); }
img { max-width: 100%; height: auto; }

a:focus-visible, button:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

/* ---------- motion ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes glitch {
  0%   { text-shadow:  2px  2px var(--magenta), -2px -2px var(--cyan); }
  25%  { text-shadow: -2px  2px var(--magenta),  2px -2px var(--cyan); }
  50%  { text-shadow:  2px -2px var(--magenta), -2px  2px var(--cyan); }
  75%  { text-shadow: -2px -2px var(--magenta),  2px  2px var(--cyan); }
  100% { text-shadow:  2px  2px var(--magenta), -2px -2px var(--cyan); }
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* staggered entrance: set style="--i:N" to delay */
.reveal { animation: fadeInUp 0.55s ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }

/* ---------- header / nav ---------- */
.skip-link {
  position: absolute; top: -48px; left: 0;
  background: var(--cyan); color: var(--ink);
  padding: 8px 12px; text-decoration: none; z-index: 100;
}
.skip-link:focus { top: 0; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  padding: 0.9rem 2rem;
  background-color: rgba(0, 0, 8, 0.82);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.logo:hover { animation: glitch 0.3s ease; }
.logo .cursor { color: var(--magenta); animation: blink 1.1s steps(1) infinite; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.site-nav a {
  position: relative;
  color: var(--cyan);
  text-decoration: none;
  padding: 0.45rem 0;
  font-size: 1rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: 0.2rem;
  width: 0; height: 2px;
  background-color: var(--magenta);
  transition: width 0.3s ease;
}
.site-nav a:hover { color: var(--magenta); }
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { width: 100%; }
.site-nav a[aria-current="page"] { color: #fff; }

/* ---------- layout ---------- */
main { flex: 1; }
.container { width: min(100% - 3rem, var(--max)); margin-inline: auto; }
.band { background-color: var(--panel); padding: 4rem 0; }
.band + .band { border-top: 1px solid rgba(0, 255, 231, 0.1); }

/* ---------- type ---------- */
.kicker {
  color: var(--magenta);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  margin-bottom: 0.9rem;
}
.kicker::before { content: '> '; color: var(--cyan); }

.page-title {
  font-size: clamp(2.1rem, 6.2vw, 3.6rem);
  font-weight: normal;
  line-height: 1.08;
  letter-spacing: 0.04em;
  color: #f4fffd;
  text-shadow: 2px 2px var(--magenta), -2px -2px var(--cyan), 0 0 34px rgba(0, 255, 231, 0.3);
}
.lede {
  margin-top: 1.25rem;
  font-size: 1.12rem;
  max-width: 62ch;
  color: var(--text);
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 1.15rem;
  font-weight: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-title small { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; }

.crumb { font-size: 0.85rem; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.crumb a { color: var(--lilac); text-decoration: none; border-bottom: 1px dotted currentColor; }
.crumb a:hover { color: var(--magenta); }
.crumb span { color: var(--cyan); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cyan);
  background: rgba(0, 255, 231, 0.06);
  border: 1px solid var(--cyan);
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover {
  color: var(--ink);
  background: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 26px rgba(255, 0, 255, 0.5);
}
.btn--solid { background: var(--cyan); color: var(--ink); box-shadow: 0 0 22px rgba(0, 255, 231, 0.3); }

/* ---------- cards ---------- */
.card {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
/* corner bracket */
.card::before {
  content: '';
  position: absolute; top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  transition: border-color 0.25s ease, width 0.25s ease, height 0.25s ease;
}
a.card:hover, .card:has(a:hover), .card:focus-within {
  transform: translateY(-5px);
  border-color: var(--magenta);
  box-shadow: 0 10px 30px rgba(255, 0, 255, 0.16), 0 0 0 1px rgba(255, 0, 255, 0.25);
}
a.card:hover::before, .card:has(a:hover)::before, .card:focus-within::before {
  border-color: var(--magenta); width: 22px; height: 22px;
}
.card-title { color: var(--cyan); font-size: 1.1rem; font-weight: normal; }
.card-text { color: var(--text); font-size: 0.92rem; margin-top: 0.3rem; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid rgba(168, 152, 200, 0.4);
  padding: 0.05rem 0.45rem;
  white-space: nowrap;
}
.tag--hot { color: var(--magenta); border-color: rgba(255, 0, 255, 0.5); }

/* ---------- footer ---------- */
.site-footer {
  background-color: #000;
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
}
.site-footer .prompt { color: var(--cyan); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-footer a { color: var(--lilac); text-decoration: none; }
.site-footer a:hover { color: var(--magenta); }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .site-header { padding: 0.6rem 1rem 0.5rem; }
  .logo { font-size: 1.6rem; }
  .site-nav { width: 100%; gap: 0 0.75rem; justify-content: space-between; }
  .site-nav a { font-size: 0.8rem; padding: 0.3rem 0; }
  .site-footer nav { gap: 0.25rem 1.1rem; font-size: 0.85rem; }
  .container { width: min(100% - 2rem, var(--max)); }
  .band { padding: 2.5rem 0; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
