/* ==========================================================================
   BOLIDE — a demoparty invite that fell through a CRT.
   Layout: zine-collage. Signature: rotated CRT compo blocks with a
   repeating-gradient scanline overlay and offset red/cyan chromatic text.
   ========================================================================== */

:root {
  --bg: #0d1412;
  --surface: #15201c;
  --surface-2: #1b2a25;
  --fg: #dce8e2;
  --muted: #8fa39a;
  --accent: #3fdbe0;
  --accent-fg: #06181a;
  --chroma-red: #ff3b6b;
  --border: color-mix(in srgb, var(--accent) 34%, transparent);
  --border-soft: color-mix(in srgb, var(--fg) 14%, transparent);

  --font-display: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-sm: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.2vw, 2.4rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.6rem);
  --text-hero: clamp(3.2rem, 1.6rem + 8vw, 9rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: 1rem;
  --space-4: 1.5rem; --space-5: 2.5rem; --space-6: 4rem; --space-7: 6rem;

  --tilt-l: -1.5deg;
  --tilt-r: 1.7deg;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-fg); }

/* --- Full-viewport phosphor + scanline field ------------------------------ */
.crt {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0, rgba(0, 0, 0, 0.28) 1px,
    transparent 1px, transparent 3px);
  mix-blend-mode: multiply;
  opacity: 0.7;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.frame {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
}

/* --- Masthead ------------------------------------------------------------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0 var(--space-3);
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-5);
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  line-height: 1;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}
.brand:hover .brand-word { color: var(--accent); }
.brand-tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 0.35rem;
  letter-spacing: 0.04em;
}
.topnav { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.topnav a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding: 0.4rem 0.1rem;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--accent); }
.nav-cta {
  color: var(--accent-fg) !important;
  background: var(--accent);
  padding: 0.45rem 0.85rem !important;
  font-weight: 700;
  transform: rotate(-1.5deg);
}
.nav-cta:hover { background: var(--fg); }

/* --- Links + prose -------------------------------------------------------- */
a { color: var(--accent); text-underline-offset: 3px; }

.prose {
  max-width: 68ch;
  font-size: var(--text-base);
  line-height: 1.75;
}
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
  margin-top: 2em;
  color: var(--accent);
  text-transform: uppercase;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  letter-spacing: 0.03em;
  margin-top: 1.6em;
  text-transform: uppercase;
  color: var(--fg);
}
.prose a { text-decoration: underline; text-decoration-color: var(--border); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4em; }
.prose strong { color: var(--fg); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.4em 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  color: var(--muted);
  font-style: italic;
}
.prose hr { border: none; border-top: 1px dashed var(--border-soft); margin: 2.5rem 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.12rem 0.36rem;
  border: 1px solid var(--border-soft);
}
pre {
  background: #10181a;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
pre code { background: transparent; border: none; padding: 0; color: inherit; }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.prose th, .prose td { border-bottom: 1px solid var(--border-soft); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-size: 0.78em; }

/* --- Tilts (zine irregularity) ------------------------------------------- */
.tilt-l { transform: rotate(var(--tilt-l)); }
.tilt-r { transform: rotate(var(--tilt-r)); }

/* --- Signature: CRT block ------------------------------------------------- */
.crt-block {
  position: relative;
  display: block;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(63, 219, 224, 0.12) inset;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  overflow: hidden;
}
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(63, 219, 224, 0.07) 0, rgba(63, 219, 224, 0.07) 1px,
    transparent 1px, transparent 4px);
  opacity: 0.85;
  z-index: 1;
}
.crt-block > * { position: relative; z-index: 2; }

/* chromatic aberration on display text — the offset red/cyan shadow */
.glitch {
  position: relative;
  color: var(--fg);
  text-shadow: -2px 0 var(--chroma-red), 2px 0 var(--accent);
}
.chroma .compo-name,
.chroma .compo-name.glitch {
  color: var(--accent);
  text-shadow: -2px 1px var(--chroma-red), 2px -1px #ffffff;
}

/* --- Home: zine layout ---------------------------------------------------- */
.zine { padding-bottom: var(--space-7); }

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-areas:
    "title date"
    "title where"
    "ticker ticker";
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-6);
}
.hero-title { grid-area: title; align-self: center; }
.hero-date { grid-area: date; }
.hero-where { grid-area: where; }
.hero-ticker { grid-area: ticker; }

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-hero);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin: 0;
  word-break: break-word;
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 26ch;
  margin: var(--space-4) 0 0;
  line-height: 1.4;
}

.hero-date { text-align: center; }
.hero-date .tiny { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); letter-spacing: 0.1em; margin: 0; }
.bigdate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 0.9;
  margin: 0.4rem 0 0;
  color: var(--accent);
  text-shadow: -2px 1px var(--chroma-red), 2px -1px #ffffff;
}
.bigmonth {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.14em;
  margin: 0 0 0.5rem;
}

.hero-where {
  background: var(--surface);
  border: 2px dashed var(--border);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}
.accent-line { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent); letter-spacing: 0.1em; margin: 0; }
.where-hall { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); margin: 0.4rem 0 0.2rem; }
.where-city { color: var(--muted); margin: 0 0 0.6rem; font-size: var(--text-sm); }
.where-note { font-size: var(--text-sm); margin: 0 0 var(--space-3); }

.hero-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--fg);
  text-transform: uppercase;
}
.hero-ticker span[aria-hidden] { color: var(--accent); }

/* --- Buttons -------------------------------------------------------------- */
.btn, .btn-solid {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--accent); color: var(--accent-fg); }
.btn-solid { background: var(--accent); color: var(--accent-fg); }
.btn-solid:hover { background: var(--fg); border-color: var(--fg); }
.btn:active, .btn-solid:active { transform: translate(2px, 2px); }

/* --- Compo deck ----------------------------------------------------------- */
.compo-deck { margin-bottom: var(--space-6); }
.deck-head { margin-bottom: var(--space-4); }
.deck-head h2, .section-head .page-title, .deadlines h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
  margin: 0;
}
.deck-sub, .lede {
  font-family: var(--font-mono);
  color: var(--muted);
  max-width: 60ch;
  margin: var(--space-3) 0 0;
  font-size: var(--text-base);
}

.deck {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4) var(--space-5);
}
.deck-item { margin: 0; }
.deck-item .crt-block { height: 100%; text-decoration: none; color: var(--fg); transition: transform 0.15s ease, border-color 0.15s ease; }
.deck-item .crt-block:hover { transform: rotate(0deg) translateY(-4px); border-color: var(--accent); }

.compo-tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-2);
}
.compo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.05;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}
.compo-limit {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--fg);
  background: var(--surface-2);
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  margin: 0 0 var(--space-3);
}
.compo-desc { color: var(--muted); margin: 0 0 var(--space-3); font-size: var(--text-sm); line-height: 1.5; }
.compo-dead {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--fg);
  letter-spacing: 0.05em;
  margin: 0;
}
.compo-dead .arrow, .compo-dead a { color: var(--accent); }

/* --- Deadlines + join ----------------------------------------------------- */
.deadlines {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-4) var(--space-5);
  align-items: start;
  margin-bottom: var(--space-6);
}
.dl-card {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: clamp(1rem, 2.5vw, 1.8rem);
}
.dl-list { list-style: none; padding: 0; margin: var(--space-4) 0 var(--space-3); }
.dl-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--border-soft);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.dl-when { color: var(--accent); white-space: nowrap; }
.dl-what a { font-family: var(--font-display); font-weight: 700; color: var(--fg); text-decoration: none; font-size: var(--text-base); }
.dl-what a:hover { color: var(--accent); }
.dl-lim { color: var(--muted); white-space: nowrap; }
.dl-note { font-size: var(--text-sm); color: var(--muted); margin: 0; }

.join-card { color: var(--fg); }
.join-h { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); margin: var(--space-2) 0 var(--space-3); }
.join-card p { color: var(--muted); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.join-card .tiny { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent); letter-spacing: 0.1em; margin: 0; }

.readme { max-width: 68ch; }

/* --- Section + standalone pages ------------------------------------------- */
.page, .section { padding-bottom: var(--space-7); }
.section-head, .standalone-head { margin-bottom: var(--space-5); }
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 0.95;
  margin: var(--space-2) 0 0;
  letter-spacing: -0.02em;
}
.section-intro { margin-bottom: var(--space-5); }

/* compo detail */
.compo-page { max-width: 780px; }
.compo-hero { margin-bottom: var(--space-4); }
.compo-hero .compo-name { font-size: var(--text-2xl); }
.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  margin: 0 0 var(--space-5);
}
.spec > div { background: var(--surface); padding: 0.8rem 1rem; }
.spec dt { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.2rem; }
.spec dd { font-family: var(--font-display); font-weight: 700; margin: 0; color: var(--fg); font-size: var(--text-base); }

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-6) 0 var(--space-4);
  border-top: 2px solid var(--border);
  padding-top: var(--space-4);
}
.pn {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
  max-width: 46%;
}
.pn span { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-sm); color: var(--accent); }
.pn-next { text-align: right; margin-left: auto; }
.pn:hover { color: var(--accent); }
.back { font-family: var(--font-mono); font-size: var(--text-sm); }

.standalone { max-width: 780px; }

/* --- 404 ------------------------------------------------------------------ */
.notfound { display: grid; place-items: center; min-height: 55vh; }
.nf-card { max-width: 480px; }
.nf-card .compo-name { font-size: var(--text-2xl); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 2px solid var(--border);
  margin-top: var(--space-6);
  padding: var(--space-5) 0 var(--space-6);
}
.foot-grid { display: grid; gap: var(--space-3); }
.foot-lead { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); margin: 0; max-width: 40ch; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-4); padding: 0; margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); }
.foot-links a { color: var(--accent); text-decoration: none; text-transform: lowercase; letter-spacing: 0.06em; }
.foot-links a:hover { color: var(--fg); }
.foot-meta { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); margin: 0; line-height: 1.7; }

/* --- Accessibility -------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 1000;
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  padding: 0.6rem 1rem;
  text-decoration: none;
}
.skip-link:focus { top: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title title"
      "date where"
      "ticker ticker";
  }
  .deadlines { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "title" "date" "where" "ticker"; }
  .masthead { flex-direction: column; align-items: flex-start; }
  .tilt-l, .tilt-r, .nav-cta { transform: none; }
  .dl-list li { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* --- Motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
