/* ============================================================
   THE FUNGUS — shared design system
   Heavy music, playful spores.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Space+Mono:wght@400;700&display=swap');

/* ---------- PALETTE — black / red --------------------------- */
:root {
  --red:        #f4150b;
  --red-hot:    #ff3a26;
  --red-deep:   #a90c05;
  --red-glow:   rgba(244, 21, 11, .55);
  --accent:     #f4150b;       /* tweakable spore accent */
  --bg:         #08080a;
  --bg-2:       #101015;
  --bg-3:       #16161c;
  --ink:        #f4f1ea;
  --ink-dim:    rgba(244, 241, 234, .60);
  --ink-faint:  rgba(244, 241, 234, .34);
  --line:       rgba(244, 241, 234, .12);
  --line-red:   rgba(244, 21, 11, .40);
  --grain-op:   .055;
  --scan-op:    .045;
  --vignette:   radial-gradient(120% 90% at 50% 8%, rgba(244,21,11,.16), transparent 55%);
  color-scheme: dark;
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background .4s ease, color .4s ease;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--red); color: #fff; }

/* ---------- TYPE -------------------------------------------- */
.display {
  font-family: 'Anton', 'Barlow', sans-serif;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .86;
  text-transform: uppercase;
}
.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--red);
}
.mono { font-family: 'Space Mono', monospace; }

h1, h2, h3 { font-family: 'Anton', sans-serif; font-weight: 400; text-transform: uppercase; line-height: .9; letter-spacing: .01em; }

/* ---------- LAYOUT ------------------------------------------ */
.wrap { width: min(1280px, 92vw); margin-inline: auto; }
.section { padding: clamp(70px, 11vh, 140px) 0; position: relative; }
.section-tight { padding: clamp(48px, 7vh, 90px) 0; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(40px, 7vw, 92px); }
.sec-head .eyebrow { margin-bottom: 14px; display: block; }

/* ---------- OVERLAYS (chaos layers) ------------------------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9000; }
.fx-grain {
  z-index: 9001;
  opacity: var(--grain-op);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift .6s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0,0); } 33% { transform: translate(-4%,2%); } 66% { transform: translate(3%,-3%); } 100% { transform: translate(0,0); }
}
.fx-scan {
  z-index: 9000;
  opacity: var(--scan-op);
  background: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.fx-vignette { z-index: 8999; background: var(--vignette); }
.fx-spores { z-index: 8998; }  /* canvas */

@media (prefers-reduced-motion: reduce) {
  .fx-grain { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- NAV --------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-logo { display: flex; align-items: center; gap: 12px; }
.nav-logo img { height: 30px; width: auto; filter: drop-shadow(0 0 10px var(--red-glow)); }
.nav-links { display: flex; align-items: center; gap: clamp(8px, 1.6vw, 26px); }
.nav-link {
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 2px; position: relative;
  transition: color .2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after,
.nav-link:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--red); box-shadow: 0 0 8px var(--red-glow);
}
.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-burger { display: none; background: none; border: 1px solid var(--line); color: var(--ink); width: 40px; height: 36px; font-size: 18px; }

@media (max-width: 880px) {
  .nav-links {
    position: fixed; inset: 56px 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 8px clamp(16px,4vw,44px) 18px; transform: translateY(-120%); transition: transform .3s; z-index: 199;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link { width: 100%; padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .nav-burger { display: block; }
}

/* ---------- BUTTONS ----------------------------------------- */
.btn {
  --pad-y: 15px;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Space Mono', monospace; font-weight: 700;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  padding: var(--pad-y) 26px;
  background: var(--red); color: #fff; border: 1px solid var(--red);
  position: relative; isolation: isolate;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  box-shadow: 0 0 0 0 var(--red-glow);
  transition: box-shadow .25s, transform .1s, background .2s;
}
.btn:hover { box-shadow: 0 0 26px var(--red-glow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 22px var(--red-glow); }
.btn svg { width: 15px; height: 15px; }

/* ---------- MARQUEE ----------------------------------------- */
.marquee {
  --speed: 26s;
  overflow: hidden; white-space: nowrap; position: relative;
  border-block: 1px solid var(--line-red);
  background: var(--bg-2);
  padding: 12px 0;
}
.marquee-track { display: inline-flex; gap: 0; will-change: transform; animation: scrollX var(--speed) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: 'Anton', sans-serif; text-transform: uppercase;
  font-size: clamp(18px, 2.4vw, 30px); letter-spacing: .02em;
  padding: 0 26px; display: inline-flex; align-items: center; gap: 26px;
  color: var(--ink);
}
.marquee-track .dot { color: var(--red); }
.marquee.rev .marquee-track { animation-direction: reverse; }
@keyframes scrollX { to { transform: translateX(-50%); } }

/* ---------- GLITCH HEADING ---------------------------------- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  clip-path: inset(0 0 0 0);
}
.glitch::before { color: var(--red); left: 2px; mix-blend-mode: screen; opacity: 0; }
.glitch::after  { color: #14b3ff; left: -2px; mix-blend-mode: screen; opacity: 0; }
.glitch:hover::before { animation: gl1 .42s steps(2) 1; }
.glitch:hover::after  { animation: gl2 .42s steps(2) 1; }
@keyframes gl1 { 0%{opacity:.9; clip-path: inset(0 0 70% 0);} 50%{clip-path: inset(40% 0 20% 0);} 100%{opacity:0;} }
@keyframes gl2 { 0%{opacity:.9; clip-path: inset(60% 0 5% 0);} 50%{clip-path: inset(10% 0 60% 0);} 100%{opacity:0;} }

/* ---------- CARDS / PANELS ---------------------------------- */
.panel { background: var(--bg-2); border: 1px solid var(--line); position: relative; }
.card-cut { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%); }

/* image placeholder */
.ph {
  position: relative; background: var(--bg-3); overflow: hidden;
  background-image: repeating-linear-gradient(135deg, transparent 0 13px, rgba(244,21,11,.07) 13px 14px);
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.ph::after {
  content: attr(data-label);
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim); padding: 7px 11px; border: 1px dashed var(--line); text-align: center;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}

/* spore tag */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid var(--line); padding: 5px 10px;
}

/* mushroom glyph (simple geometric) */
.shroom { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.shroom path, .shroom ellipse, .shroom rect { fill: currentColor; }

/* ---------- FOOTER ------------------------------------------ */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 64px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h4 { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .2em; color: var(--ink-dim); margin-bottom: 16px; text-transform: uppercase; font-weight: 700; }
.footer a.fl { display: block; padding: 5px 0; color: var(--ink-dim); font-size: 15px; transition: color .15s, transform .15s; }
.footer a.fl:hover { color: var(--red); transform: translateX(4px); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.footer-bottom, .footer-bottom * { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .12em; color: var(--ink-faint); text-transform: uppercase; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- FORMS ------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 13px 14px; font-family: 'Barlow', sans-serif; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 18px var(--red-glow);
}
.field textarea { resize: vertical; min-height: 120px; }

/* utility */
.stroke-text { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.red { color: var(--red); }
.dim { color: var(--ink-dim); }
.up { text-transform: uppercase; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.noise-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-red), transparent); }
