/*
Theme Name: Boreal
Description: Aurora expedition & astrophotography touring company.
Version: 1.0
*/

/* ============================================================
   Design tokens — midnight indigo + single vivid aurora-green
   accent. Magenta/violet are reserved for the aurora shader and
   the globe's auroral-oval arc only, never for UI chrome.
   ============================================================ */
:root {
	--bg: #060911;
	--bg-raised: #0b1020;
	--bg-card: #0d1326;
	--line: rgba(150, 190, 210, 0.14);
	--line-strong: rgba(150, 190, 210, 0.28);
	--ink: #e8edf5;
	--ink-dim: #9aa8c2;
	--ink-faint: #5c6786;
	--accent: #33f2ac;
	--accent-dim: rgba(51, 242, 172, 0.14);
	--accent-ink: #04120d;
	--aurora-magenta: #ff3fb0;
	--aurora-violet: #7b5cff;
	--font-display: 'Big Shoulders Display', sans-serif;
	--font-body: 'Inter', sans-serif;
	--font-mono: 'Space Mono', monospace;
	--wrap: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	line-height: 0.98;
	margin: 0 0 0.4em;
	color: #fff;
}
h1 { font-size: clamp(48px, 8vw, 108px); }
h2 { font-size: clamp(32px, 4.6vw, 58px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }
p { margin: 0 0 1em; color: var(--ink-dim); }
.mono { font-family: var(--font-mono); }

.eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--accent); }

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 30px;
	border: 1px solid var(--line-strong);
	border-radius: 2px;
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
	background: transparent;
	transition: border-color 0.25s, background 0.25s, color 0.25s;
	position: relative;
	cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: transparent; color: var(--accent); }

/* ============================================================
   Ambient starfield canvas — sits behind everything, sitewide
   ============================================================ */
#starfieldCanvas {
	position: fixed;
	inset: 0;
	z-index: -3;
	width: 100%;
	height: 100%;
	background: radial-gradient(ellipse at 50% -10%, #0d1530 0%, #060911 60%);
}
.grain {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0.035;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><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>");
}

/* ============================================================
   Header
   ============================================================ */
.site-head {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	padding: 22px 0;
	transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
	border-bottom: 1px solid transparent;
}
.site-head.scrolled {
	background: rgba(6, 9, 17, 0.72);
	backdrop-filter: blur(16px) saturate(1.4);
	border-color: var(--line);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; color: #fff; display: flex; align-items: center; gap: 10px; }
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 2px var(--accent); }
.main-nav ul { list-style: none; display: flex; gap: 34px; margin: 0; padding: 0; }
.main-nav a { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.main-nav a:hover { color: var(--accent); }
.nav-toggle { display: none; }

.mobile-nav { position: fixed; inset: 0; z-index: 200; background: var(--bg-raised); transform: translateX(100%); transition: transform 0.4s; display: flex; flex-direction: column; }
.mobile-nav.open { transform: translateX(0); }
.mobile-nav ul { list-style: none; margin: auto 0; padding: 0 40px; }
.mobile-nav li { border-bottom: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 18px 0; font-family: var(--font-display); font-size: 30px; text-transform: uppercase; color: #fff; }
.mn-close { position: absolute; top: 26px; right: 32px; background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; }

@media (max-width: 860px) {
	.main-nav { display: none; }
	.nav-toggle { display: block; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
}

/* ============================================================
   Field-log marker — Boreal's structural device, used in place
   of numbered chapters or timecodes: real coordinates + KP-index
   ============================================================ */
.field-log {
	display: flex;
	align-items: baseline;
	gap: 18px;
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--ink-faint);
	letter-spacing: 0.02em;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.field-log .fl-coords { color: var(--accent); }
.field-log .fl-kp { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 2px; }
.field-log::before { content: ''; width: 28px; height: 1px; background: var(--line-strong); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	padding-bottom: 90px;
}
.hero-canvas-wrap { position: absolute; inset: 0; z-index: 0; }
#auroraCanvas { width: 100%; height: 100%; display: block; }
.hero::after {
	content: '';
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(6,9,17,0) 0%, rgba(6,9,17,0.55) 70%, var(--bg) 100%);
	z-index: 1;
	pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-content { max-width: 900px; }
.hero h1 { margin-top: 18px; }
.hero-lede { max-width: 520px; font-size: 18px; margin-top: 22px; }
.hero-cta { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.hero-scroll-cue {
	position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
	z-index: 2; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
	color: var(--ink-faint); text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hero-scroll-cue .line { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); animation: sc-drop 1.8s ease-in-out infinite; }
@keyframes sc-drop { 0% { opacity: 0; transform: scaleY(0.2); transform-origin: top; } 40% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: top; } }

/* ============================================================
   Section rhythm
   ============================================================ */
.section { padding: 130px 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head p { font-size: 17px; max-width: 560px; }

/* ============================================================
   Route rail — the scroll-scrub device: an SVG expedition route
   line with a GSAP motionPath-driven marker/plane icon, replacing
   the timecode / ghost-numeral devices used on prior themes
   ============================================================ */
.route-section { padding: 110px 0 140px; }
.route-rail { position: relative; margin-top: 70px; }
.route-svg-wrap { position: relative; width: 100%; }
.route-svg-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.route-path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 6; }
.route-path-progress { fill: none; stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 6px var(--accent)); }
#routeMarker { position: absolute; top: 0; left: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; }
#routeMarker svg { width: 100%; height: 100%; }
.route-stops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin-top: 50px; }
.route-stop { padding-top: 18px; border-top: 1px solid var(--line); }
.route-stop .rs-coords { font-family: var(--font-mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 8px; }
.route-stop h3 { font-size: 18px; margin-bottom: 6px; }
.route-stop p { font-size: 14px; }
@media (max-width: 900px) { .route-stops { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 560px) { .route-stops { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   Expedition grid
   ============================================================ */
.expedition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.expedition-card {
	position: relative;
	background: var(--bg-card);
	padding: 34px 30px 30px;
	overflow: hidden;
	transition: transform 0.35s cubic-bezier(.2,.7,.3,1);
	transform-style: preserve-3d;
}
.hw-glow { position: absolute; inset: -1px; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(280px circle at var(--hw-mx,50%) var(--hw-my,50%), var(--accent-dim), transparent 65%); }
.hw-tilt:hover .hw-glow { opacity: 1; }
.hw-tilt { transform: perspective(1000px) rotateX(var(--hw-rx,0deg)) rotateY(var(--hw-ry,0deg)); }
.ec-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; margin: -34px -30px 22px; }
.ec-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.expedition-card:hover .ec-thumb img { transform: scale(1.06); }
.ec-region { position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: rgba(6,9,17,0.6); backdrop-filter: blur(6px); padding: 5px 10px; border: 1px solid var(--line-strong); }
.ec-coords { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 8px; display: block; }
.ec-meta { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 940px) { .expedition-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 620px) { .expedition-grid { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   Globe section — "The Science of Aurora"
   ============================================================ */
.globe-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 60px; padding: 130px 0; }
.globe-canvas-wrap { position: relative; aspect-ratio: 1/1; }
#globeCanvas { width: 100%; height: 100%; display: block; }
.globe-copy .kp-scale { display: flex; gap: 6px; margin-top: 26px; }
.kp-cell { flex: 1; text-align: center; padding: 10px 4px; font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line); color: var(--ink-faint); }
.kp-cell.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.science-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.science-stat .ss-num { font-family: var(--font-display); font-size: 40px; color: #fff; }
.science-stat .ss-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); text-transform: uppercase; }
@media (max-width: 900px) { .globe-section { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   Guide / expert notes
   ============================================================ */
.guide-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.guide-card { border-top: 1px solid var(--line-strong); padding-top: 22px; }
.guide-card .gc-role { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.guide-card blockquote { font-family: var(--font-display); font-size: 22px; text-transform: none; letter-spacing: 0; color: #fff; margin: 12px 0; line-height: 1.25; }
.guide-card cite { font-style: normal; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 900px) { .guide-band { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   Journal / dispatches
   ============================================================ */
.notebook-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.notebook-card { border: 1px solid var(--line); padding: 26px; position: relative; }
.notebook-card .nc-date { font-size: 12px; color: var(--accent); margin-bottom: 10px; display: block; }
@media (max-width: 900px) { .notebook-grid { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   Stat band (reused pattern, restyled)
   ============================================================ */
.stat-band { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-cell { padding: 34px 20px; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: 0; }
.sc-num { font-family: var(--font-display); font-size: 46px; color: #fff; }
.sc-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
@media (max-width: 900px) { .stat-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stat-cell { border-bottom: 1px solid var(--line); } }

/* ============================================================
   CTA
   ============================================================ */
.cta-band { padding: 130px 0; text-align: center; border-top: 1px solid var(--line); }
.cta-band h2 { max-width: 760px; margin: 0 auto 20px; }
.cta-band p { max-width: 560px; margin: 0 auto 34px; }

/* ============================================================
   Footer — an asymmetric "field log" sign-off instead of the
   standard four equal columns: a brand block paired with a live
   next-departure transmission callout, then link rows labelled
   like log fields rather than stacked menu columns.
   ============================================================ */
.site-foot { padding: 80px 0 40px; border-top: 1px solid var(--line-strong); }
.foot-log {
	display: grid;
	grid-template-columns: 1fr 1.3fr;
	gap: 50px;
	padding-bottom: 44px;
	margin-bottom: 34px;
	border-bottom: 1px solid var(--line);
}
.fl-brand p { max-width: 340px; margin-top: 16px; font-size: 14px; }
.fl-transmission {
	justify-self: end;
	text-align: right;
	border-left: 1px solid var(--line-strong);
	padding-left: 34px;
	max-width: 420px;
}
.fl-transmission .eyebrow { justify-content: flex-end; }
.fl-big { font-family: var(--font-mono); font-size: clamp(20px, 2.6vw, 30px); color: var(--accent); margin: 14px 0 8px; letter-spacing: 0.01em; }
.fl-big .fl-kp { margin-left: 10px; }
.fl-note { font-size: 13px; color: var(--ink-faint); }
.foot-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 40px; }
.fl-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 26px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fl-row-label { width: 90px; flex-shrink: 0; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.fl-row li { list-style: none; margin: 0; }
.fl-row > a, .fl-row li a { color: var(--ink-dim); font-size: 14px; }
.fl-row > a:hover, .fl-row li a:hover { color: var(--accent); }
.foot-bottom { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-faint); padding-top: 4px; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) {
	.foot-log { grid-template-columns: minmax(0, 1fr); }
	.fl-transmission { justify-self: start; text-align: left; border-left: 0; border-top: 1px solid var(--line-strong); padding-left: 0; padding-top: 24px; max-width: none; }
	.fl-transmission .eyebrow { justify-content: flex-start; }
	.fl-row { flex-direction: column; gap: 10px; }
}

/* ============================================================
   Single expedition / archive / taxonomy / pages / misc
   ============================================================ */
.page-hero { padding: 200px 0 60px; border-bottom: 1px solid var(--line); }
.page-hero .field-log { margin-bottom: 26px; }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; padding: 80px 0; }
.detail-facts { border: 1px solid var(--line); padding: 28px; align-self: start; position: sticky; top: 110px; }
.detail-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.detail-facts dt { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); text-transform: uppercase; }
.detail-facts dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--accent); text-align: right; }
.detail-body img { margin: 30px 0; }
.detail-body p { font-size: 17px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-facts { position: static; } }

.archive-grid, .taxonomy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); margin-top: 40px; }
.region-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.region-filter a { padding: 8px 16px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; color: var(--ink-dim); }
.region-filter a.active, .region-filter a:hover { border-color: var(--accent); color: var(--accent); }

.simple-page { padding: 200px 0 130px; }
.simple-page .content { max-width: 720px; }
.simple-page .content p { font-size: 17px; }
.contact-form { display: grid; gap: 18px; max-width: 560px; margin-top: 30px; }
.contact-form label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 8px; }
.contact-form input, .contact-form textarea {
	width: 100%; background: var(--bg-card); border: 1px solid var(--line); color: var(--ink);
	padding: 13px 14px; font-family: var(--font-body); font-size: 15px; border-radius: 2px;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }

.notfound { padding: 220px 0; text-align: center; }
.notfound .kp-code { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }

/* ============================================================
   Reveal-on-scroll baseline (no-JS / reduced-motion fallback)
   ============================================================ */
[data-reveal] { opacity: 0; }
[data-reveal].in, [data-reveal][style*="opacity: 1"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
	[data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Preloader */
#pre { position: fixed; inset: 0; z-index: 999; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity 0.6s, visibility 0.6s; }
#pre .pre-mark { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.1em; }
#pre.done { opacity: 0; visibility: hidden; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 300; width: 0%; box-shadow: 0 0 8px var(--accent); }
