/*
Theme Name: Wavefront
Theme URI: https://wavefront.example
Author: Wavefront Audio
Description: Independent spatial audio technology studio theme. Pure black + one electric-cyan accent, a real Three.js particle wavefront with genuine UnrealBloomPass post-processing in the hero (not a CSS glow fake), kinetic split-text typography, a timeline/waveform-timestamp structural device instead of numbered chapters, and a click-driven ripple cursor tied to the sound-propagation concept. Still a normal scrollable site — no full-viewport WebGL takeover.
Version: 1.0
Requires PHP: 7.4
Text Domain: wavefront
*/

/* ============ Design tokens — pure black + one electric accent ============ */
:root {
  --bg: #050506;
  --bg-2: #0c0d0f;
  --bg-3: #131417;
  --line: rgba(240,245,250,.08);
  --line-strong: rgba(240,245,250,.18);
  --ink: #eef2f5;
  --ink-dim: rgba(238,242,245,.66);
  --ink-mute: rgba(238,242,245,.38);
  --accent: #4ef5d6;
  --accent-soft: rgba(78,245,214,.14);
  --accent-strong: #8bffe6;
  --rgb-split: #ff3d7f;
  --ff-head: 'Unbounded', 'Songti SC', sans-serif;
  --ff-body: 'Inter', 'Songti SC', sans-serif;
  --ff-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--ff-body); font-size: 16.5px; line-height: 1.64;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
::selection { background: var(--accent); color: #000; }

h1, h2, h3, h4 { font-family: var(--ff-head); font-weight: 700; line-height: 1.06; margin: 0; letter-spacing: -.01em; }
.mono { font-family: var(--ff-mono); letter-spacing: .03em; }
.eyebrow {
  font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--accent); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 780px) { .wrap { padding: 0 20px; } }

/* Fine grain — reads as signal noise / static on a black field */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .045; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============ Click-driven ripple cursor — a sound source, not a generic dot+ring ============ */
.ripple-layer { position: fixed; inset: 0; z-index: 650; pointer-events: none; overflow: hidden; }
.ripple-ring { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: .8; animation: rf-expand 1.1s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes rf-expand { to { width: 240px; height: 240px; margin: -120px 0 0 -120px; opacity: 0; border-width: .5px; } }

/* ============ Progress / preloader ============ */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0%; background: var(--accent); z-index: 500; box-shadow: 0 0 12px var(--accent); }
.preloader {
  position: fixed; inset: 0; z-index: 999; background: var(--bg); display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader .pre-inner { font-size: 12px; letter-spacing: .24em; color: var(--accent); text-transform: uppercase; font-family: var(--ff-mono); }
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* ============ Header — glass, floats over the wavefront ============ */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 22px 0; border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, padding .3s;
}
.site-head.scrolled {
  background: rgba(5,5,6,.6); backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(238,242,245,.06);
  padding: 15px 0;
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--ff-head); font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.brand .brand-mark { position: relative; width: 22px; height: 22px; }
.brand .brand-mark svg { width: 100%; height: 100%; }
.head-nav { display: flex; align-items: center; gap: 34px; }
.main-nav { display: flex; gap: 30px; }
.main-nav a { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); position: relative; }
.main-nav a:hover { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 22px; border: 1px solid var(--line-strong); color: var(--ink); position: relative; overflow: hidden; border-radius: 2px;
}
.btn.primary { background: var(--accent); color: #04120e; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); box-shadow: 0 0 24px var(--accent-soft); }
.btn:not(.primary) { transition: border-color .25s, color .25s; }
.btn:not(.primary):hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ''; display: block; width: 14px; height: 1px; background: var(--ink); position: relative; }
.nav-toggle span::before { position: absolute; top: -4px; }
.nav-toggle span::after { position: absolute; top: 4px; }
@media (max-width: 860px) { .main-nav { display: none; } .nav-toggle { display: flex; } }

.mobile-nav { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.mobile-nav.open { visibility: visible; }
.mobile-nav .mn-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; }
.mobile-nav.open .mn-scrim { opacity: 1; }
.mobile-nav .mn-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86%); background: var(--bg-2); border-left: 1px solid var(--line); padding: 96px 28px 28px; transform: translateX(100%); transition: transform .4s cubic-bezier(.16,1,.3,1); }
.mobile-nav.open .mn-panel { transform: translateX(0); }
.mobile-nav a { display: block; padding: 15px 0; font-family: var(--ff-head); font-size: 20px; font-weight: 700; border-bottom: 1px solid var(--line); }

/* ============ Hero — the wavefront canvas is the whole visual, kinetic split-text over it ============ */
.hero { padding: 168px 0 100px; position: relative; overflow: hidden; min-height: 100vh; display: flex; align-items: center; }
.hero-canvas-wrap { position: absolute; inset: 0; z-index: 0; }
#wavefrontCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .wrap { position: relative; z-index: 2; }
.hero-content { max-width: 780px; }
.hero-kicker { margin-bottom: 24px; }
.hero h1 { font-size: clamp(42px, 6.6vw, 92px); letter-spacing: -.02em; }
.hero h1 .split-word { display: inline-block; overflow: hidden; vertical-align: top; margin-right: .22em; }
.hero h1 .split-word span { display: inline-block; transform: translateY(115%); }
.hero-lede { font-size: 17px; color: var(--ink-dim); margin: 26px 0 32px; max-width: 50ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Chromatic-aberration text — a genuine red/cyan channel split, not a plain color swap */
.rgb-split { position: relative; display: inline-block; }
.rgb-split::before, .rgb-split::after {
  content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: .7; mix-blend-mode: screen;
}
.rgb-split::before { color: var(--rgb-split); transform: translate(2px, 0); }
.rgb-split::after { color: var(--accent); transform: translate(-2px, 0); }

/* ============ Waveform timeline marker — the recurring structural device instead of chapter numerals ============ */
.tc-marker { display: flex; align-items: center; gap: 18px; margin-bottom: 48px; flex-wrap: wrap; }
.tc-time { font-family: var(--ff-mono); font-size: 13px; color: var(--accent); letter-spacing: .06em; }
.tc-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.tc-wave span { width: 2px; background: var(--line-strong); border-radius: 1px; }
.tc-marker h2 { font-size: clamp(26px, 3.2vw, 40px); width: 100%; margin-top: 6px; }
.tc-marker p { color: var(--ink-dim); max-width: 46ch; font-size: 14.5px; margin-top: 10px; width: 100%; }

/* ============ Waveform ticker strip ============ */
.ticker-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 52px; will-change: transform; }
.ticker-track span { font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 52px; }
.ticker-track span::after { content: '~'; color: var(--accent); }

/* ============ Story split ============ */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.story-media { position: relative; border: 1px solid var(--line-strong); overflow: hidden; aspect-ratio: 4/5; background: var(--bg-2); }
.story-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.4) contrast(1.1) brightness(.85); }
.story-media .badge { position: absolute; left: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); padding: 14px 20px; }
.story-media .badge .b-num { font-family: var(--ff-head); font-size: 24px; font-weight: 700; color: var(--accent); }
.story-media .badge .b-label { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.story-copy p { color: var(--ink-dim); margin: 18px 0; }
.story-list { margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }
.story-list li { display: flex; gap: 12px; font-size: 13.5px; color: var(--ink-dim); }
.story-list li::before { content: '~'; color: var(--accent); }
@media (max-width: 900px) { .story { grid-template-columns: 1fr; } }

/* ============ Full-bleed statement — an oversized claim, not another photo+text split ============ */
.statement { padding: 60px 0 40px; }
.statement blockquote {
  margin: 0; font-family: var(--ff-head); font-weight: 700; letter-spacing: -.01em;
  font-size: clamp(30px, 5vw, 64px); line-height: 1.12; max-width: 18ch;
}
.statement blockquote .accent-word { color: var(--accent); }
.statement footer { margin-top: 32px; max-width: 56ch; color: var(--ink-dim); font-size: 15px; }

/* ============ Horizontal-panning work showcase — pinned + scrubbed by vertical scroll,
   not a static grid. Baseline (no-JS / reduced-motion) is a natively scrollable row so it
   never depends on JS to be usable. ============ */
.hscroll-section { position: relative; }
.hscroll-pin { overflow: hidden; }
.hscroll-row {
  display: flex; gap: 1px; background: var(--line);
  overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.hscroll-row.js-driven { overflow-x: visible; }
.hscroll-card {
  flex: 0 0 min(78vw, 420px); scroll-snap-align: start; background: var(--bg);
}
@media (max-width: 700px) { .hscroll-card { flex-basis: 82vw; } }

/* ============ Standard sections ============ */
.section { padding: 100px 0; position: relative; }
.section-tight { padding: 70px 0; }

[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .75s cubic-bezier(.16,1,.3,1), transform .75s cubic-bezier(.16,1,.3,1); }
[data-reveal].in { opacity: 1; transform: translateY(0); }

/* ============ Cursor-tracked glass spotlight + 3D tilt — every card grid ============ */
.hw-tilt {
  --hw-mx: 50%; --hw-my: 50%; --hw-rx: 0deg; --hw-ry: 0deg;
  transform: perspective(900px) rotateX(var(--hw-rx)) rotateY(var(--hw-ry));
  transition: transform .5s cubic-bezier(.16,1,.3,1), background .3s;
  will-change: transform;
}
.hw-glow {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(340px circle at var(--hw-mx) var(--hw-my), rgba(78,245,214,.10), transparent 60%);
}
.hw-tilt:hover .hw-glow { opacity: 1; }

/* ============ Case study (project) cards — canvas waveform reacts on hover ============ */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project-card { display: block; background: var(--bg); padding: 30px 26px; transition: background .3s; position: relative; overflow: hidden; }
.project-card:hover { background: var(--bg-2); }
.pc-frame { position: relative; aspect-ratio: 16/10; margin-bottom: 20px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.pc-frame canvas { width: 100%; height: 100%; display: block; }
.pc-code { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.project-card h3 { font-size: 20px; margin-top: 10px; }
.project-card .pc-meta { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); margin-top: 8px; }
@media (max-width: 980px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .project-grid { grid-template-columns: 1fr; } }

/* ============ Journal / notes cards ============ */
.notebook-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 980px) { .notebook-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .notebook-grid { grid-template-columns: 1fr; } }
.notebook-card { display: block; background: var(--bg); padding: 28px 26px; transition: background .3s; position: relative; overflow: hidden; }
.notebook-card:hover { background: var(--bg-2); }
.notebook-card .nc-date { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.notebook-card h3 { font-size: 18px; margin: 12px 0 8px; font-weight: 700; }
.notebook-card p { font-size: 13.5px; color: var(--ink-dim); }

/* ============ Stat band ============ */
.stat-band { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat-cell { background: var(--bg); padding: 34px 20px; text-align: center; }
.stat-cell .sc-num { font-family: var(--ff-head); font-weight: 700; font-size: clamp(26px, 3vw, 38px); color: var(--accent); }
.stat-cell .sc-label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); margin-top: 8px; line-height: 1.4; }
@media (max-width: 900px) { .stat-band { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stat-band { grid-template-columns: repeat(2, 1fr); } }

.cta-band { text-align: center; padding: 110px 0; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(28px, 3.8vw, 46px); max-width: 20ch; margin: 0 auto 22px; }
.cta-band p { color: var(--ink-dim); max-width: 46ch; margin: 0 auto 32px; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ============ Footer ============ */
.site-foot { padding: 64px 0 30px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 48px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .brand { margin-bottom: 16px; }
.foot-brand p { color: var(--ink-mute); font-size: 13px; max-width: 32ch; }
.foot-col h4 { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 16px; }
.foot-col a { display: block; padding: 6px 0; font-size: 13.5px; color: var(--ink-dim); transition: color .2s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-bottom p { font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-mute); }

/* ============ Forms ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; }
.field input, .field textarea, .field select { width: 100%; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 0; padding: 13px 14px; color: var(--ink); font-family: var(--ff-body); font-size: 14.5px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 120px; resize: vertical; }

/* ============ Team ============ */
.team-list { max-width: 660px; margin: 0 auto; border-top: 1px solid var(--line); }
.team-row { display: flex; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.team-row .tr-stamp {
  width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--accent); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-family: var(--ff-head); font-size: 13px; font-weight: 700; color: var(--accent);
}
.team-row h4 { font-size: 16.5px; }
.team-row .tr-role { font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; }
.team-row .tr-note { margin-left: auto; font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); text-align: right; white-space: nowrap; }

/* ============ Numbered process steps ============ */
.survey-steps { max-width: 700px; margin: 0 auto; }
.survey-step { display: flex; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.survey-step:last-child { border-bottom: 1px solid var(--line); }
.survey-step .ss-num { font-family: var(--ff-mono); font-weight: 700; font-size: 18px; color: var(--accent); flex-shrink: 0; width: 46px; }
.survey-step h3 { font-size: 18px; margin-bottom: 8px; }
.survey-step p { font-size: 14px; color: var(--ink-dim); }

/* ============ Inner pages ============ */
.page-hero { padding: 146px 0 60px; position: relative; }
.page-hero h1 { font-size: clamp(30px, 4.6vw, 54px); max-width: 20ch; }
.page-hero-lede { color: var(--ink-dim); max-width: 58ch; margin-top: 20px; font-size: 15.5px; }
.entry-content { max-width: 680px; margin: 0 auto; font-size: 16.5px; }
.entry-content p { margin: 0 0 20px; color: var(--ink-dim); }
.entry-content h2 { font-size: 24px; margin: 42px 0 16px; }
.entry-content h3 { font-size: 19px; margin: 30px 0 12px; }
.entry-content img { margin: 26px 0; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { border-left: 2px solid var(--accent); padding-left: 18px; font-style: italic; margin: 26px 0; }

.kit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 700px) { .kit-grid { grid-template-columns: 1fr; } }
.kit-card { padding: 30px; background: var(--bg); position: relative; overflow: hidden; }
.kit-card .kc-num { font-family: var(--ff-mono); color: var(--accent); font-size: 11px; }
.kit-card h3 { font-size: 17px; margin: 14px 0 8px; }
.kit-card p { color: var(--ink-dim); font-size: 13.5px; }

.log-list { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); }
.log-list .log-row:last-child { border-bottom: 1px solid var(--line); }
.log-row .lr-date { font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); }
.log-row h3 { font-size: 17px; font-weight: 700; transition: color .2s; }
.log-row:hover h3 { color: var(--accent); }
.log-row .lr-arrow { font-family: var(--ff-mono); color: var(--ink-mute); transition: transform .2s, color .2s; }
.log-row:hover .lr-arrow { transform: translateX(3px); color: var(--accent); }
@media (max-width: 700px) { .log-row { grid-template-columns: 1fr; gap: 6px; } }

.spec-sheet { border: 1px solid var(--line-strong); padding: 24px; background: var(--bg-2); }
.spec-sheet .ss-row { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.spec-sheet .ss-row:first-child { border-top: none; }
.spec-sheet .ss-row .ss-k { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.spec-sheet .ss-row .ss-v { text-align: right; }

.error-404 { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 140px 20px 60px; }
.error-404 .e4-num { font-family: var(--ff-head); font-weight: 700; font-size: clamp(72px,15vw,150px); color: var(--accent); line-height: 1; }

.counter { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
