/* turbozine theme: mental-athletic
   turbozine engine from 17 refs in desing refs
   Load fonts yourself:
   <link href="https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Big+Shoulders+Display:wght@700;900&family=Oswald:wght@700&family=Archivo+Black&family=Playfair+Display:wght@700;900&family=Inter:wght@400;700&family=Space+Mono:wght@400;700&family=IBM+Plex+Mono:wght@400;700&display=swap" rel="stylesheet">
*/

/* ---------- tokens ---------- */
:root {
  --tz-bg: #000000;
  --tz-bg-alt: #0a0a0a;
  --tz-paper: #d0c8bb;
  --tz-ink: #f2f2f2;
  --tz-ink-on-paper: #0a0a0a;
  --tz-muted: #6b6b6b;

  --tz-signal: #39ff14;
  --tz-signal-2: #f4ff00;
  --tz-signal-3: #ff4d00;
  --tz-accent: #ff2a1a;
  --tz-accent-2: #1a1aff;

  --tz-chrome-hi: #fafafa;
  --tz-chrome-mid: #9a9a9a;
  --tz-chrome-lo: #3a3a3a;
  --tz-chrome-edge: #d6d6d6;

  --tz-font-display: 'Anton', 'Bebas Neue', 'Big Shoulders Display', Impact, sans-serif;
  --tz-font-display-alt: 'Big Shoulders Display', 'Oswald', Impact, sans-serif;
  --tz-font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --tz-font-mono: 'Space Mono', 'IBM Plex Mono', 'Courier New', monospace;

  --tz-size-xs: 0.65rem;
  --tz-size-sm: 0.78rem;
  --tz-size-md: 0.95rem;
  --tz-size-lg: 1.4rem;
  --tz-size-xl: 2.6rem;
  --tz-size-xxl: 5rem;
  --tz-size-poster: clamp(4rem, 18vw, 22rem);

  --tz-track-display: -0.03em;
  --tz-track-caps: 0.08em;
  --tz-lead-display: 0.85;
  --tz-lead-body: 1.35;
  --tz-lead-mono: 1.45;

  --tz-gutter: 14px;
  --tz-margin: clamp(16px, 4vw, 56px);
  --tz-max: 1600px;
  --tz-text-columns: 3;

  --tz-scanlines: 0.18;
  --tz-grain: 0.23;
  --tz-vhs: 0.44;

  color-scheme: dark;
}


/* ---------- base ---------- */
.tz, .tz body {
  background: var(--tz-bg);
  color: var(--tz-ink);
  font-family: var(--tz-font-body);
  font-size: var(--tz-size-md);
  line-height: var(--tz-lead-body);
  -webkit-font-smoothing: antialiased;
}
.tz * { box-sizing: border-box; }
.tz img, .tz video { display: block; max-width: 100%; }
.tz a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tz a:hover { color: var(--tz-signal); }
.tz ::selection { background: var(--tz-signal); color: #000; }

/* ---------- type ---------- */
.tz-display {
  font-family: var(--tz-font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tz-track-display);
  line-height: var(--tz-lead-display);
  margin: 0;
}
.tz-display-alt { font-family: var(--tz-font-display-alt); font-weight: 900; }
.tz-poster-text { font-size: var(--tz-size-poster); }
.tz-h1 { font-size: var(--tz-size-xxl); }
.tz-h2 { font-size: var(--tz-size-xl); }
.tz-h3 { font-size: var(--tz-size-lg); }

.tz-mono {
  font-family: var(--tz-font-mono);
  font-size: var(--tz-size-sm);
  line-height: var(--tz-lead-mono);
  letter-spacing: -0.01em;
}
.tz-body { font-family: var(--tz-font-body); font-size: var(--tz-size-md); line-height: var(--tz-lead-body); }
.tz-small { font-size: var(--tz-size-xs); }
.tz-caps { text-transform: uppercase; letter-spacing: var(--tz-track-caps); font-size: var(--tz-size-xs); }
.tz-justify { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }

/* text set into a hard block: justify everything, including the last line */
.tz-block {
  text-align: justify;
  text-align-last: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  word-spacing: -0.05em;
}

/* color utilities */
.tz-c-signal { color: var(--tz-signal); }
.tz-c-signal-2 { color: var(--tz-signal-2); }
.tz-c-signal-3 { color: var(--tz-signal-3); }
.tz-c-accent { color: var(--tz-accent); }
.tz-c-accent-2 { color: var(--tz-accent-2); }
.tz-c-ink { color: var(--tz-ink); }
.tz-c-black { color: #000; }
.tz-c-muted { color: var(--tz-muted); }

.tz-bg-signal { background: var(--tz-signal); color: #000; }
.tz-bg-signal-2 { background: var(--tz-signal-2); color: #000; }
.tz-bg-signal-3 { background: var(--tz-signal-3); color: #000; }
.tz-bg-accent { background: var(--tz-accent); color: #000; }
.tz-bg-paper { background: var(--tz-paper); color: var(--tz-ink-on-paper); }
.tz-bg-black { background: var(--tz-bg); color: var(--tz-ink); }
.tz-bg-chrome {
  background: linear-gradient(180deg, var(--tz-chrome-hi) 0%, var(--tz-chrome-mid) 45%, var(--tz-chrome-lo) 52%, var(--tz-chrome-edge) 100%);
  color: #000;
}

/* ---------- layout ---------- */
.tz-wrap { width: 100%; max-width: var(--tz-max); margin-inline: auto; padding-inline: var(--tz-margin); }
.tz-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--tz-gutter); }
.tz-span-3 { grid-column: span 3; }
.tz-span-4 { grid-column: span 4; }
.tz-span-6 { grid-column: span 6; }
.tz-span-8 { grid-column: span 8; }
.tz-span-12 { grid-column: span 12; }
@media (max-width: 800px) {
  .tz-span-3, .tz-span-4, .tz-span-6, .tz-span-8 { grid-column: span 12; }
}

/* dense multi-column text */
.tz-cols { column-count: 3; column-gap: var(--tz-gutter); column-rule: 1px solid rgba(255,255,255,0.08); }
.tz-cols-2 { column-count: 2; }
@media (max-width: 1000px) { .tz-cols { column-count: 2; } }
@media (max-width: 640px) { .tz-cols, .tz-cols-2 { column-count: 1; } }

/* ---------- components ---------- */
/* POSTER: huge headline, lots of black */
.tz-poster {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: end;
  padding: var(--tz-margin);
  background: var(--tz-bg);
  overflow: hidden;
}
.tz-poster .tz-display { font-size: var(--tz-size-poster); }

/* TEXTWALL: dense justified body on black or signal */
.tz-textwall { padding: var(--tz-margin); }
.tz-textwall p { margin: 0 0 0.9em; }
.tz-textwall p + p { text-indent: 1.5em; margin-top: -0.9em; }
.tz-textwall .tz-cols p:first-child::first-letter {
  font-family: var(--tz-font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding-right: 0.08em;
  color: var(--tz-signal);
}
.tz-bg-signal .tz-cols p:first-child::first-letter,
.tz-bg-signal-2 .tz-cols p:first-child::first-letter,
.tz-bg-signal-3 .tz-cols p:first-child::first-letter,
.tz-bg-paper .tz-cols p:first-child::first-letter { color: #000; }

/* BLEED: full-width image with overlaid text column */
.tz-bleed { position: relative; width: 100%; min-height: 70svh; overflow: hidden; background: #000; }
.tz-bleed > img, .tz-bleed > video { width: 100%; height: 100%; min-height: 70svh; object-fit: cover; }
.tz-bleed .tz-over {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--tz-margin);
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
}
.tz-bleed .tz-over--top { justify-content: flex-start; background: linear-gradient(0deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%); }

/* INDEX: contents page, centered stacked lines in signal on black */
.tz-index { padding: var(--tz-margin); text-align: center; color: var(--tz-signal); }
.tz-index ol { list-style: none; margin: 0; padding: 0; }
.tz-index li { margin: 1.6em 0; }
.tz-index .tz-index-page { font-family: var(--tz-font-mono); font-size: var(--tz-size-sm); display: block; margin-bottom: 0.3em; }
.tz-index .tz-index-title { font-family: var(--tz-font-display); font-size: var(--tz-size-xl); text-transform: uppercase; line-height: 0.9; display: block; text-decoration: none; }
.tz-index .tz-index-title:hover { color: var(--tz-ink); }
.tz-index .tz-index-credit { font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); display: block; margin-top: 0.4em; opacity: 0.9; }

/* CAPTION / CREDIT furniture */
.tz-caption { font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); line-height: 1.4; color: var(--tz-ink); opacity: 0.85; margin-top: 0.5em; }
.tz-credit { font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.tz-credit b { color: var(--tz-signal); font-weight: 400; }
.tz-pagenum { font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); }
.tz-pagenum::before { content: 'p. '; }
.tz-runhead {
  display: flex; justify-content: space-between; gap: var(--tz-gutter);
  font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); text-transform: uppercase;
  padding: 0.6em var(--tz-margin); border-bottom: 1px solid rgba(255,255,255,0.15);
}

/* GALLERY: tight brutal grid */
.tz-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; padding: 4px; background: #000; }
.tz-gallery figure { margin: 0; position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.tz-gallery img, .tz-gallery video { width: 100%; height: 100%; object-fit: cover; }
.tz-gallery figcaption { position: absolute; left: 0; bottom: 0; padding: 4px 6px; background: var(--tz-signal); color: #000; font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); }

/* RULE / DIVIDER */
.tz-rule { border: 0; border-top: 2px solid var(--tz-signal); margin: 0; }
.tz-rule--thin { border-top-width: 1px; opacity: 0.4; }

/* BUTTON / TAG */
.tz-btn {
  display: inline-block; font-family: var(--tz-font-mono); font-size: var(--tz-size-sm); text-transform: uppercase;
  padding: 0.6em 1em; border: 2px solid var(--tz-signal); color: var(--tz-signal); background: transparent; text-decoration: none; cursor: pointer;
}
.tz-btn:hover { background: var(--tz-signal); color: #000; }
.tz-tag { display: inline-block; font-family: var(--tz-font-mono); font-size: var(--tz-size-xs); text-transform: uppercase; padding: 0.2em 0.5em; background: var(--tz-signal-2); color: #000; }

/* ---------- effects ---------- */
/* scanlines overlay */
.fx-scanlines { position: relative; }
.fx-scanlines::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,var(--tz-scanlines)) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* grain: inline SVG feTurbulence */
.fx-grain { position: relative; }
.fx-grain::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  opacity: var(--tz-grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}
.fx-grain--animated::before { animation: tz-grain-shift 0.5s steps(4) infinite; }
@keyframes tz-grain-shift {
  0% { background-position: 0 0; } 25% { background-position: -40px 60px; }
  50% { background-position: 80px -30px; } 75% { background-position: -60px -80px; } 100% { background-position: 0 0; }
}

/* chrome / liquid metal text */
.fx-chrome {
  background: linear-gradient(180deg, var(--tz-chrome-hi) 0%, var(--tz-chrome-edge) 30%, var(--tz-chrome-lo) 50%, var(--tz-chrome-mid) 54%, var(--tz-chrome-hi) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0,0,0,0.6);
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 6px 10px rgba(0,0,0,0.6));
}
/* red extruded 3D type */
.fx-extrude {
  color: var(--tz-accent);
  text-shadow: 1px 1px 0 #7a0000, 2px 2px 0 #7a0000, 3px 3px 0 #7a0000, 4px 4px 0 #7a0000, 5px 5px 0 #7a0000, 6px 6px 0 #5a0000, 8px 8px 12px rgba(0,0,0,0.6);
}
/* outline with glow */
.fx-outline { color: transparent; -webkit-text-stroke: 1.5px var(--tz-signal); text-shadow: 0 0 12px rgba(57,255,20,0.45); }
.fx-outline--paper { -webkit-text-stroke-color: #000; text-shadow: none; }

/* VHS chromatic aberration + jitter */
.fx-vhs {
  text-shadow: calc(-2px * var(--tz-vhs)) 0 rgba(255,0,60,0.8), calc(2px * var(--tz-vhs)) 0 rgba(0,255,255,0.8);
  animation: tz-vhs-jitter 2.6s steps(1) infinite;
}
@keyframes tz-vhs-jitter {
  0%, 92%, 100% { transform: translateX(0); }
  93% { transform: translateX(calc(3px * var(--tz-vhs))) skewX(2deg); }
  95% { transform: translateX(calc(-4px * var(--tz-vhs))); }
  97% { transform: translateX(calc(2px * var(--tz-vhs))) skewX(-1deg); }
}
.fx-vhs-img { position: relative; overflow: hidden; }
.fx-vhs-img > img, .fx-vhs-img > video { filter: contrast(1.15) saturate(1.3); }
.fx-vhs-img::after {
  content: ''; position: absolute; inset: -10% 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.08) 48%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.08) 52%, transparent 100%);
  animation: tz-vhs-roll 5s linear infinite;
}
@keyframes tz-vhs-roll { from { transform: translateY(-60%); } to { transform: translateY(60%); } }

/* duotone photo: grayscale + signal screen */
.fx-duotone { position: relative; background: var(--tz-signal); overflow: hidden; }
.fx-duotone > img, .fx-duotone > video { filter: grayscale(1) contrast(1.25) brightness(0.9); mix-blend-mode: multiply; }
.fx-duotone--2 { background: var(--tz-signal-2); }
.fx-duotone--3 { background: var(--tz-signal-3); }
.fx-duotone--accent { background: var(--tz-accent); }

/* halftone dots over image */
.fx-halftone { position: relative; }
.fx-halftone::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(0,0,0,0.55) 1px, transparent 1.6px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

/* flash photo: blown highlights + vignette */
.fx-flash > img, .fx-flash > video { filter: contrast(1.3) brightness(1.08) saturate(0.9); }
.fx-flash { position: relative; }
.fx-flash::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 160px rgba(0,0,0,0.75); }

/* spine text: rotated along the page edge */
.fx-spine {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--tz-font-display);
  text-transform: uppercase;
  letter-spacing: var(--tz-track-display);
  line-height: 0.85;
  white-space: nowrap;
}
.fx-spine--down { transform: none; }

/* ticker / marquee */
.fx-ticker { overflow: hidden; white-space: nowrap; border-top: 2px solid var(--tz-signal); border-bottom: 2px solid var(--tz-signal); }
.fx-ticker > span { display: inline-block; padding: 0.35em 0; font-family: var(--tz-font-display); text-transform: uppercase; font-size: var(--tz-size-lg); animation: tz-ticker 18s linear infinite; }
.fx-ticker > span > i { font-style: normal; color: var(--tz-signal); margin: 0 0.6em; }
@keyframes tz-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* blinking cursor */
.fx-cursor::after { content: '_'; animation: tz-blink 1s steps(1) infinite; }
@keyframes tz-blink { 50% { opacity: 0; } }

/* giant background word texture */
.fx-watermark { position: relative; overflow: hidden; }
.fx-watermark > .fx-watermark-word {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  font-family: var(--tz-font-display); text-transform: uppercase; line-height: 0.8;
  font-size: clamp(8rem, 40vw, 60rem); color: rgba(255,255,255,0.05);
  overflow: hidden; word-break: break-all;
}
.fx-watermark > :not(.fx-watermark-word) { position: relative; z-index: 1; }

/* overprint collision: text crossing an image */
.fx-overprint { mix-blend-mode: difference; color: #fff; }

/* reveal on scroll helper (JS adds .is-in) */
.fx-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fx-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .fx-vhs, .fx-vhs-img::after, .fx-ticker > span, .fx-grain--animated::before, .fx-cursor::after { animation: none; }
  .fx-reveal { opacity: 1; transform: none; transition: none; }
}
