/*
Theme Name: Umbra
Theme URI: https://umbra.example
Author: Umbra Society
Description: Independent paranormal & folklore research collective. Analog-horror case-file aesthetic — VHS/CRT shader hero, a draggable red-string evidence corkboard (not a scroll-section grid), redacted-document reveal interactions and an oscilloscope ambient signal layer.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: umbra
*/

/* ============ Fonts ============ */
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Courier+Prime:wght@400;700&display=swap');

/* ============ Tokens ============ */
:root {
	--bg: #0c0b09;
	--panel: #131210;
	--panel-2: #1b1916;
	--paper: #e4d9b8;
	--paper-2: #d8caa0;
	--paper-ink: #1c1712;

	--ink: #e7e2d2;
	--ink-dim: #a49a80;
	--ink-mute: #635b48;

	--accent: #e3241f;
	--accent-ink: #0c0b09;
	--accent-2: #ffb020;
	--accent-soft: rgba(227,36,31,.12);

	--line: rgba(231,226,210,.12);
	--line-strong: rgba(231,226,210,.24);

	--ff-head: 'Special Elite', 'Courier New', monospace;
	--ff-body: 'Courier Prime', 'Courier New', monospace;
	--ff-mono: 'Courier Prime', 'Courier New', monospace;

	--radius: 0px;
	--container: 1320px;
}

* { box-sizing: border-box; }
body {
	margin: 0; background: var(--bg); color: var(--ink);
	font-family: var(--ff-body); font-size: 16px; line-height: 1.65;
	-webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { font-family: var(--ff-head); font-weight: 400; line-height: 1.08; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 40px; }
.mono { font-family: var(--ff-mono); }

/* ============ CRT / scanline / vignette overlay ============ */
.crt-overlay {
	position: fixed; inset: 0; z-index: 9500; pointer-events: none;
	background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0px, rgba(0,0,0,.14) 1px, transparent 1px, transparent 3px);
	mix-blend-mode: multiply; opacity: .55;
}
.vignette { position: fixed; inset: 0; z-index: 9499; pointer-events: none; box-shadow: inset 0 0 220px 60px rgba(0,0,0,.75); }
.grain { position: fixed; inset: 0; z-index: 9498; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%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");
}
#bg-fx-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5; }

/* ============ Flicker / glitch text ============ */
.glitch { position: relative; display: inline-block; }
.glitch.is-glitching::before, .glitch.is-glitching::after {
	content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden;
}
.glitch.is-glitching::before { color: var(--accent); transform: translate(-2px, 1px); clip-path: inset(20% 0 55% 0); }
.glitch.is-glitching::after { color: var(--accent-2); transform: translate(2px, -1px); clip-path: inset(60% 0 10% 0); }

/* ============ Progress + preloader ============ */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0%; background: var(--accent); z-index: 9999; transition: width .1s linear; }
#pre { position: fixed; inset: 0; z-index: 9600; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .6s ease, visibility .6s ease; }
#pre.done { opacity: 0; visibility: hidden; }
.pre-mark { font-family: var(--ff-head); font-size: 26px; letter-spacing: .05em; color: var(--accent); }
.pre-bar { width: 240px; height: 2px; background: var(--line-strong); overflow: hidden; }
.pre-bar span { display: block; height: 100%; width: 0%; background: var(--accent-2); }
.pre-pct { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); letter-spacing: .1em; }

/* ============ Header (control-room chrome, not marketing nav) ============ */
.site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 800; display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1px solid var(--line); background: rgba(12,11,9,.82); backdrop-filter: blur(8px); }
.brand { font-family: var(--ff-head); font-size: 22px; letter-spacing: .04em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand .rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: rec-blink 1.3s step-start infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.head-status { display: flex; align-items: center; gap: 24px; font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.head-status span b { color: var(--accent-2); }
.access-btn { font-family: var(--ff-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 18px; border: 1px solid var(--line-strong); color: var(--ink); transition: border-color .2s ease, color .2s ease; }
.access-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px) { .head-status { display: none; } }

/* ============ Archive drawer ============ */
.drawer-scrim { position: fixed; inset: 0; z-index: 890; background: rgba(0,0,0,.6); opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s ease; }
.drawer-scrim.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 90vw); z-index: 895; background: var(--panel); border-left: 1px solid var(--line-strong); padding: 110px 44px 40px; transform: translateX(100%); transition: transform .5s cubic-bezier(.76,0,.24,1); overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-nav { counter-reset: fileitem; }
.drawer-nav ul { margin: 0; padding: 0; list-style: none; }
.drawer-nav a { display: block; font-family: var(--ff-head); font-size: 28px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.drawer-nav a:hover { color: var(--accent); }
.drawer-nav a::before { counter-increment: fileitem; content: "FILE " counter(fileitem, decimal-leading-zero); font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); display: block; margin-bottom: 4px; }

/* ============ Buttons ============ */
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; font-family: var(--ff-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--ink-dim); transition: border-color .25s ease, color .25s ease, background .25s ease; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* ============ Hero ============ */
.hero { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 140px; background: #000; }
#hero-canvas { position: absolute; inset: 0; z-index: 1; }
.hero-scrim { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.6) 74%, rgba(0,0,0,.96) 100%); pointer-events: none; }
.hero-inner { position: relative; z-index: 3; padding-bottom: 90px; }
.hero-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--ff-mono); font-size: 12px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 24px; }
.hero h1 { font-size: clamp(42px, 7.4vw, 108px); color: var(--ink); }
.hero h1 .reveal-line { overflow: hidden; display: block; }
.hero h1 .reveal-line span { display: block; transform: translateY(110%); transition: transform .8s cubic-bezier(.16,1,.3,1); }
.hero.loaded h1 .reveal-line span { transform: translateY(0); }
.hero-sub { margin-top: 26px; max-width: 54ch; font-size: 17px; color: var(--ink-dim); }
.hero-cta { display: flex; gap: 16px; margin-top: 38px; }
.hero-meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 70px; background: var(--line); }
.hero-meta-row div { background: #000; padding: 18px 0 0; }
.hero-meta-row b { display: block; font-family: var(--ff-head); font-size: 34px; color: var(--accent-2); }
.hero-meta-row span { display: block; margin-top: 4px; font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .05em; }

/* ============ Transmission ticker ============ */
.ticker-strip { background: var(--panel); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); padding: 14px 0; overflow: hidden; position: relative; z-index: 2; }
.ticker-track { display: flex; white-space: nowrap; width: max-content; animation: ticker-l 26s linear infinite; }
.ticker-track span { font-family: var(--ff-mono); font-size: 13px; color: var(--ink-dim); padding: 0 28px; display: flex; align-items: center; gap: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ticker-track span em { font-style: normal; color: var(--accent); }
@keyframes ticker-l { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ Section shell ============ */
.section { position: relative; z-index: 2; padding: 120px 0; }
.section-paper { background: var(--paper); color: var(--paper-ink); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 56px; }
.section-head .idx { display: flex; align-items: center; gap: 10px; font-family: var(--ff-mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(30px, 4vw, 50px); }
.section-head p { color: var(--ink-dim); font-size: 15.5px; max-width: 44ch; }
.section-paper .section-head p { color: #4a4335; }

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

/* ============ Stamp ============ */
.stamp { display: inline-block; font-family: var(--ff-head); font-size: 13px; color: var(--accent); border: 2px solid var(--accent); padding: 4px 12px; transform: rotate(-6deg); text-transform: uppercase; letter-spacing: .06em; opacity: .85; }

/* ============ Evidence corkboard ============ */
.corkboard-wrap { position: relative; background: #241d14; background-image: radial-gradient(circle, rgba(0,0,0,.25) 1px, transparent 1.4px); background-size: 9px 9px; border: 1px solid var(--line-strong); min-height: 720px; overflow: hidden; touch-action: none; }
.corkboard-wrap .board-hint { position: absolute; top: 18px; left: 18px; font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; z-index: 5; }
#stringSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.evidence-card {
	position: absolute; width: 220px; background: var(--paper); color: var(--paper-ink); padding: 12px 12px 16px;
	box-shadow: 0 14px 30px -10px rgba(0,0,0,.6); cursor: grab; z-index: 3; user-select: none;
	transition: box-shadow .2s ease;
}
.evidence-card:active { cursor: grabbing; z-index: 20; box-shadow: 0 22px 44px -8px rgba(0,0,0,.75); }
.evidence-card .ec-pin { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 3px 5px rgba(0,0,0,.5); }
.evidence-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: grayscale(.5) contrast(1.1) sepia(.15); pointer-events: none; }
.evidence-card .ec-code { font-family: var(--ff-mono); font-size: 10px; margin-top: 8px; color: #6b6146; text-transform: uppercase; }
.evidence-card b { display: block; font-family: var(--ff-head); font-size: 15px; margin-top: 3px; line-height: 1.2; }
.evidence-card .ec-status { display: inline-block; margin-top: 6px; font-family: var(--ff-mono); font-size: 9.5px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .04em; }
.evidence-card .ec-status.unresolved { background: var(--accent); color: #fff; }
.evidence-card .ec-status.active { background: var(--accent-2); color: #1c1712; }
.evidence-card .ec-status.archived { background: #6b6146; color: #fff; }
@media (max-width: 760px) { .corkboard-wrap { min-height: 1400px; } .evidence-card { width: 170px; } }

/* ============ Redacted text ============ */
.redacted-block { background: var(--paper); color: var(--paper-ink); padding: 40px; font-family: var(--ff-body); font-size: 15.5px; line-height: 2; max-width: 820px; margin: 0 auto; }
.redacted-block p { margin-bottom: 18px; }
.rd { position: relative; display: inline; background: #17140f; color: transparent; cursor: pointer; padding: 0 2px; transition: background .35s ease, color .35s ease; border-radius: 1px; }
.rd.revealed { background: transparent; color: inherit; }
.rd::selection { background: #17140f; }

/* ============ Case index (archive) ============ */
.case-list { max-width: 980px; margin: 0 auto; }
.case-row { display: grid; grid-template-columns: 110px 1fr 160px 120px; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding-left .25s ease; }
.case-row:hover { padding-left: 10px; }
.case-row .cr-code { font-family: var(--ff-mono); font-size: 12px; color: var(--accent); }
.case-row h4 { font-family: var(--ff-head); font-size: 19px; }
.case-row .cr-loc { font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); text-transform: uppercase; }
.case-row .cr-status { font-family: var(--ff-mono); font-size: 10.5px; padding: 4px 10px; text-align: center; border: 1px solid var(--line-strong); text-transform: uppercase; }

/* ============ Field kit / methods grid ============ */
.kit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kit-card { background: var(--panel); padding: 34px 26px; min-height: 200px; display: flex; flex-direction: column; }
.kit-card .kc-num { font-family: var(--ff-mono); font-size: 11px; color: var(--accent-2); }
.kit-card h3 { font-size: 20px; margin: 30px 0 10px; }
.kit-card p { font-size: 13.5px; color: var(--ink-dim); flex: 1; }

/* ============ Investigators ============ */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.team-card { background: var(--panel); padding: 26px; }
.team-card .tc-id { font-family: var(--ff-head); width: 56px; height: 56px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent-2); }
.team-card b { display: block; margin-top: 16px; font-family: var(--ff-head); font-size: 17px; }
.team-card span { display: block; margin-top: 3px; font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; }

/* ============ Reports (news) ============ */
.reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-card { background: var(--panel); padding: 30px 26px; transition: background .25s ease; }
.report-card:hover { background: var(--panel-2); }
.report-card .rc-tag { font-family: var(--ff-mono); font-size: 10.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.report-card h3 { font-size: 19px; margin: 14px 0 10px; font-family: var(--ff-head); font-weight: 400; }
.report-card .rc-date { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); }

/* ============ Signal waveform strip ============ */
.waveform-strip { position: relative; height: 140px; background: #000; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); overflow: hidden; }
#waveformCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ============ CTA band ============ */
.cta-band { background: var(--accent); color: #fff; padding: 100px 0; text-align: center; }
.cta-band h2 { font-size: clamp(30px, 4.4vw, 58px); max-width: 22ch; margin: 0 auto 32px; }
.cta-band .btn-ghost { border-color: #fff; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--accent); }

/* ============ Footer ============ */
.site-foot { background: #000; color: var(--ink-mute); padding: 90px 0 30px; position: relative; z-index: 2; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 40px; padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.foot-brand .brand { color: var(--ink); }
.foot-brand p { margin-top: 16px; font-size: 13.5px; max-width: 30ch; }
.foot-col span { display: block; font-family: var(--ff-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); margin-bottom: 16px; }
.foot-col a { display: block; padding: 6px 0; font-size: 13.5px; color: var(--ink); transition: color .2s ease; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-family: var(--ff-mono); font-size: 11px; flex-wrap: wrap; gap: 10px; }

/* ============ Page hero ============ */
.page-hero { padding: 180px 0 56px; position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(34px, 5.4vw, 70px); }
.page-hero p { margin-top: 18px; font-size: 16px; color: var(--ink-dim); max-width: 58ch; }

/* ============ Entry ============ */
.entry { max-width: 74ch; margin: 0 auto; font-size: 16.5px; color: var(--ink-dim); }
.entry p { margin-bottom: 22px; }
.entry h2, .entry h3 { color: var(--ink); margin: 40px 0 16px; font-family: var(--ff-head); }

/* ============ Archive list (generic) ============ */
.archive-list { max-width: 920px; margin: 0 auto; }
.archive-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding-left .2s ease; }
.archive-row:hover { padding-left: 8px; }
.archive-row .ar-cat { font-family: var(--ff-mono); font-size: 11px; color: var(--accent); text-transform: uppercase; }
.archive-row h3 { font-size: 18px; font-family: var(--ff-head); font-weight: 400; }
.archive-row .ar-date { font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-mute); }

/* ============ Contact form ============ */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 60px; }
.contact-info ul { margin-top: 22px; }
.contact-info li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.ci-label { font-family: var(--ff-mono); font-size: 10.5px; text-transform: uppercase; color: var(--ink-mute); letter-spacing: .05em; }
.ci-val { font-size: 15px; }
.form-row { display: flex; gap: 18px; margin-bottom: 18px; }
.form-field { flex: 1; }
.form-field.full { flex: 1 1 100%; }
.form-field label { display: block; font-family: var(--ff-mono); font-size: 10.5px; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--panel); font-family: var(--ff-body); font-size: 14.5px; color: var(--ink); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--accent); }

/* ============ Scanner cursor ============ */
.cursor-reticle { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9998; width: 30px; height: 30px; transform: translate(-50%,-50%); opacity: 0; transition: opacity .2s ease, width .2s ease, height .2s ease; }
.cursor-reticle::before, .cursor-reticle::after { content: ''; position: absolute; background: var(--accent-2); }
.cursor-reticle::before { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.cursor-reticle::after { top: 50%; left: 0; height: 1px; width: 100%; transform: translateY(-50%); }
.has-cursor .cursor-reticle { opacity: .8; }
.cursor-reticle.hovering { width: 50px; height: 50px; }
@media (hover: none) { .cursor-reticle { display: none; } }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
	.wrap { padding: 0 24px; }
	.hero-meta-row { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
	.contact-grid { grid-template-columns: 1fr; }
	.kit-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
	.reports-grid { grid-template-columns: 1fr; }
	.foot-top { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.hero-meta-row, .kit-grid, .team-grid { grid-template-columns: 1fr; }
	.case-row { grid-template-columns: 1fr; gap: 6px; }
	.form-row { flex-direction: column; gap: 0; }
	.section { padding: 90px 0; }
	.foot-top { grid-template-columns: 1fr; }
}

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