/*
Theme Name: Lightbridge
Theme URI: https://glitchcity.xyz
Author: Marz
Description: Lean Bridge-compatible theme for Glitch City. Renders the WPBakery/Qode shortcode vocabulary natively with a self-hosted design system — three-layer tokens, sophisticated components, self-hosted fonts — and no page-builder dependency. Districts restyle by overriding tokens only.
Version: 0.2.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lightbridge
*/

/* ===========================================================================
   FONTS — self-hosted variable woff2 (latin). ~70KB, 2 requests.
=========================================================================== */
@font-face {
	font-family: "Space Grotesk";
	src: url("assets/fonts/space-grotesk.woff2") format("woff2");
	font-weight: 300 700;
	font-display: swap;
	font-style: normal;
}
@font-face {
	font-family: "Inter";
	src: url("assets/fonts/inter.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
	font-style: normal;
}

/* ===========================================================================
   LAYER 1 — PRIMITIVES (raw values, never referenced by components directly)
=========================================================================== */
:root {
	/* neutral ramp (HSL parts so districts can shift lightness/temperature) */
	--n-0: 0 0% 4%;
	--n-1: 0 0% 6.5%;
	--n-2: 0 0% 9%;
	--n-3: 0 0% 13%;
	--n-50: 0 0% 62%;
	--n-70: 0 0% 78%;
	--n-100: 0 0% 100%;

	/* accent as HSL parts — a district overrides just these three lines */
	--accent-h: 43;
	--accent-s: 74%;
	--accent-l: 54%;

	/* neon signal accents (shared Glitch City identity — tie to trace fx) */
	--neon-cyan: 183 100% 50%;
	--neon-magenta: 322 100% 50%;
	--neon-violet: 255 100% 69%;

	/* type families */
	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

	/* fluid type scale (major-third-ish) */
	--step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
	--step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
	--step-1:  clamp(1.2rem, 1.09rem + 0.5vw, 1.45rem);
	--step-2:  clamp(1.55rem, 1.3rem + 1.2vw, 2.1rem);
	--step-3:  clamp(2.1rem, 1.6rem + 2.4vw, 3.2rem);
	--step-4:  clamp(2.9rem, 1.9rem + 4.6vw, 5.4rem);

	/* spacing */
	--sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;  --sp-6: 1.5rem;
	--sp-8: 2rem;    --sp-10: 2.5rem; --sp-12: 3rem;
	--sp-section: clamp(3.5rem, 2.5rem + 5vw, 7.5rem);

	/* radius / blur */
	--r-sm: 10px; --r: 16px; --r-lg: 24px; --r-pill: 999px;
	--blur: 16px;

	/* layout */
	--grid: 1180px;
	--measure: 68ch;
	--gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
}

/* ===========================================================================
   LAYER 2 — SEMANTIC (purpose aliases; components reference these)
=========================================================================== */
:root {
	--bg:            hsl(var(--n-0));
	--surface:       hsl(var(--n-1));
	--surface-2:     hsl(var(--n-2));
	--surface-3:     hsl(var(--n-3));
	--text:          hsl(var(--n-70));
	--text-dim:      hsl(var(--n-50));
	--heading:       hsl(var(--n-100));

	--accent:        hsl(var(--accent-h) var(--accent-s) var(--accent-l));
	--accent-bright: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) + 16%));
	--accent-deep:   hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 20%));
	--accent-12:     hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.12);
	--accent-24:     hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.24);
	--accent-40:     hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.40);

	--hairline:      hsl(var(--n-100) / 0.09);
	--hairline-2:    hsl(var(--n-100) / 0.16);

	--shadow-lift:   0 26px 70px -20px hsl(var(--n-0) / 0.9);
	--shadow-card:   0 2px 8px hsl(var(--n-0) / 0.4);

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===========================================================================
   BASE
=========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* subtle page-level atmosphere (fixed, cheap, non-interactive) */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 50% at 50% -10%, var(--accent-12), transparent 70%),
		radial-gradient(40% 40% at 100% 0%, hsl(var(--neon-violet) / 0.06), transparent 70%);
}
.lb-header, .lb-main, .lb-footer { position: relative; z-index: 1; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	color: var(--heading);
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
	font-weight: 600;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: var(--measure); }
.lb-align-center p, [class*="text-align:center"] p { margin-left: auto; margin-right: auto; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-bright); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent); color: hsl(var(--n-0)); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 1000; background: var(--accent); color: #000; padding: 10px 16px; border-radius: var(--r-sm); }

:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

/* ===========================================================================
   HEADER / NAV
=========================================================================== */
.lb-header {
	display: flex; align-items: center; justify-content: space-between;
	gap: var(--sp-6);
	min-height: 74px;
	padding: 0 clamp(18px, 4vw, 44px);
	position: sticky; top: 0;
	background: hsl(var(--n-0) / 0.72);
	backdrop-filter: blur(var(--blur)) saturate(1.3);
	-webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
	border-bottom: 1px solid var(--hairline);
}
.lb-branding { display: flex; align-items: center; gap: 12px; }
.lb-branding img { max-height: 42px; width: auto; }
.lb-site-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; }
.lb-site-title a { color: var(--heading); }

.lb-nav ul { list-style: none; display: flex; gap: clamp(16px, 2.4vw, 34px); margin: 0; padding: 0; }
.lb-nav a { color: var(--text-dim); font-family: var(--font-display); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; position: relative; padding: 6px 0; }
.lb-nav a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); transition: width 0.28s var(--ease); }
.lb-nav a:hover { color: var(--heading); }
.lb-nav a:hover::after, .lb-nav .current-menu-item > a::after { width: 100%; }

.lb-nav-toggle { display: none; background: none; border: 1px solid var(--hairline-2); color: var(--heading); font-size: 18px; line-height: 1; padding: 9px 13px; border-radius: var(--r-sm); cursor: pointer; }

@media (max-width: 860px) {
	.lb-nav-toggle { display: block; }
	.lb-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface-2); padding: 18px clamp(18px,4vw,44px) 26px; border-bottom: 1px solid var(--hairline); }
	.lb-nav-open .lb-nav { display: block; }
	.lb-nav ul { flex-direction: column; gap: 16px; }
}

/* ===========================================================================
   ROWS / COLUMNS (vc_row / vc_column)
=========================================================================== */
.lb-row { position: relative; }
.lb-row-grid > .lb-row-inner { max-width: var(--grid); margin: 0 auto; padding-inline: var(--gutter); }
.lb-row-full > .lb-row-inner { max-width: none; }

.lb-row-parallax { background-size: cover; background-position: center; background-attachment: fixed; }
@media (max-width: 1024px) { .lb-row-parallax { background-attachment: scroll; } }

/* legibility scrim over photographic parallax rows */
.lb-row-parallax::before { content: ""; position: absolute; inset: 0; background: linear-gradient(hsl(var(--n-0) / 0.78), hsl(var(--n-0) / 0.66)); z-index: 0; }
.lb-row-parallax > .lb-row-inner { position: relative; z-index: 1; }

.lb-cols { display: grid; grid-template-columns: 1fr; gap: var(--gutter); align-items: stretch; }
@media (min-width: 768px) {
	.lb-cols { grid-template-columns: repeat(12, 1fr); }
	.lb-col, .lb-col-1-1 { grid-column: span 12; }
	.lb-col-1-2 { grid-column: span 6; }
	.lb-col-1-3 { grid-column: span 4; }
	.lb-col-2-3 { grid-column: span 8; }
	.lb-col-1-4 { grid-column: span 3; }
	.lb-col-3-4 { grid-column: span 9; }
	.lb-col-1-6 { grid-column: span 2; }
	.lb-col-5-6 { grid-column: span 10; }
	.lb-col-1-12 { grid-column: span 1; }
}
.lb-align-left { text-align: left; }
.lb-align-center { text-align: center; }
.lb-align-right { text-align: right; }

.lb-container { max-width: var(--grid); margin: 0 auto; padding: var(--sp-section) var(--gutter); }

/* ===========================================================================
   HERO (title band + first section)
=========================================================================== */
.lb-title-band {
	text-align: center;
	padding: clamp(64px, 12vw, 132px) var(--gutter) clamp(20px, 4vw, 44px);
	background: radial-gradient(120% 150% at 50% -20%, var(--accent-12) 0%, transparent 55%);
}
.lb-title-band h1 {
	margin: 0;
	font-size: var(--step-4);
	font-weight: 700;
	letter-spacing: -0.03em;
	background: linear-gradient(178deg, var(--heading) 12%, var(--accent-bright) 62%, var(--accent-deep));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===========================================================================
   TYPOGRAPHIC COMPONENTS (shared; districts recolor via tokens)
   .v-* class names kept for content compatibility.
=========================================================================== */
.v-section-label, .lb-eyebrow {
	display: inline-flex; align-items: center; gap: 12px;
	font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
	letter-spacing: 0.32em; text-transform: uppercase; color: var(--accent);
	margin: 0 0 var(--sp-4);
}
.lb-align-center .v-section-label { justify-content: center; }
.v-section-label::before, .v-section-label::after { content: ""; width: 30px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-40)); }
.v-section-label::before { background: linear-gradient(90deg, var(--accent-40), transparent); }

.v-lead {
	font-family: var(--font-display); font-weight: 400;
	font-size: var(--step-2); line-height: 1.28; color: var(--heading);
	letter-spacing: -0.01em; max-width: 20ch; margin: 0 auto;
}
.lb-align-left .v-lead { margin-inline: 0; }

.v-body-text { color: var(--text); font-size: var(--step-0); line-height: 1.8; }

.v-quote {
	position: relative; font-family: var(--font-display); font-weight: 400; font-style: normal;
	font-size: var(--step-1); line-height: 1.4; color: var(--heading);
	padding: var(--sp-4) 0 var(--sp-4) var(--sp-6);
	border-left: 2px solid var(--accent); margin: 0;
}

/* ===========================================================================
   STAT CARDS  (counter column → card via :has)
=========================================================================== */
.lb-cols > .lb-col:has(.lb-counter) {
	background: linear-gradient(180deg, var(--surface), var(--surface-2));
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	padding: clamp(22px, 3vw, 34px) var(--sp-6);
	text-align: center;
	transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.lb-cols > .lb-col:has(.lb-counter):hover { border-color: var(--accent-24); transform: translateY(-4px); }
.lb-counter { text-align: center; }
.lb-counter-num {
	font-family: var(--font-display); font-weight: 700; line-height: 1;
	letter-spacing: -0.03em;
	background: linear-gradient(180deg, var(--accent-bright), var(--accent-deep));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.v-counter-label { color: var(--text-dim); font-family: var(--font-display); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; margin: 10px 0 0; }

/* ===========================================================================
   FEATURE / TIER CARDS  (icon_text)
=========================================================================== */
.lb-icon-text {
	height: 100%;
	padding: clamp(24px, 3vw, 36px);
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: var(--r-lg);
	text-align: left;
	position: relative; overflow: hidden;
	transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.lb-icon-text::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: 0.75; }
.lb-icon-text:hover { transform: translateY(-8px); border-color: var(--accent-24); box-shadow: var(--shadow-lift); }
.lb-icon-pos-left, .lb-icon-pos-top { display: block; }
.lb-icon {
	display: inline-grid; place-items: center;
	width: 58px; height: 58px; border-radius: 15px;
	background: var(--accent-12); color: var(--accent);
	margin-bottom: var(--sp-6);
	box-shadow: inset 0 0 0 1px var(--accent-24);
}
.lb-icon svg { width: 28px; height: 28px; }
.lb-icon-title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; text-transform: none; color: var(--heading); margin: 0 0 10px; }
.lb-icon-desc { color: var(--text-dim); font-size: var(--step-0); margin: 0; }

/* ===========================================================================
   BUTTONS
=========================================================================== */
.lb-btn, .qbutton {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 15px 30px;
	font-family: var(--font-display); font-size: 0.86rem; font-weight: 600;
	letter-spacing: 0.1em; text-transform: uppercase;
	color: hsl(var(--n-0)); background: var(--accent);
	border: 1px solid var(--accent); border-radius: var(--r-pill);
	transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
	box-shadow: 0 10px 30px -8px var(--accent-40);
}
.lb-btn:hover, .qbutton:hover { color: hsl(var(--n-0)); background: var(--accent-bright); transform: translateY(-2px); box-shadow: 0 16px 40px -10px var(--accent-40); }
.lb-btn-ghost { background: transparent; color: var(--accent); box-shadow: none; }
.lb-btn-ghost:hover { background: var(--accent-12); color: var(--accent-bright); }

/* ===========================================================================
   ACCORDION (qode_accordion → <details>)
=========================================================================== */
.qode_accordion_holder { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--hairline); }
.qode_accordion_holder details { border-bottom: 1px solid var(--hairline); }
.qode_accordion_holder .accordion_title {
	cursor: pointer; list-style: none; position: relative;
	padding: var(--sp-6) 48px var(--sp-6) 4px;
	font-family: var(--font-display); font-size: var(--step-1); font-weight: 500;
	color: var(--heading); transition: color 0.25s;
}
.qode_accordion_holder .accordion_title:hover { color: var(--accent); }
.qode_accordion_holder .accordion_title::-webkit-details-marker { display: none; }
.qode_accordion_holder .accordion_title::after {
	content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
	margin-top: -6px;
	background:
		linear-gradient(var(--accent), var(--accent)) center/12px 2px no-repeat,
		linear-gradient(var(--accent), var(--accent)) center/2px 12px no-repeat;
	transition: transform 0.3s var(--ease);
}
.qode_accordion_holder details[open] > .accordion_title::after { transform: rotate(135deg); }
.qode_accordion_holder .accordion_content { padding: 0 4px var(--sp-6); color: var(--text-dim); font-size: var(--step-0); }
.qode_accordion_holder .accordion_content > :last-child { margin-bottom: 0; }

/* ===========================================================================
   IMAGES / BANNERS / DIVIDERS / SPACE
=========================================================================== */
figure.lb-image { margin: 0 0 1em; }
.lb-image-center { text-align: center; }
.lb-image-right { text-align: right; }
.lb-row-full figure.lb-image { margin: 0; line-height: 0; }
.lb-row-full figure.lb-image img { width: 100%; object-fit: cover; }

hr.lb-sep { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hairline-2), transparent); margin: var(--sp-8) auto; max-width: var(--grid); }
.lb-space { display: block; }

/* ===========================================================================
   YUM progressive disclosure
=========================================================================== */
.yum-full { display: none; margin-top: 10px; }
.yum-open .yum-full { display: block; }
.yum-trigger { color: var(--accent); cursor: pointer; font-weight: 600; white-space: nowrap; }
.yum-trigger:hover { color: var(--accent-bright); }

/* ===========================================================================
   FOOTER
=========================================================================== */
.lb-footer { border-top: 1px solid var(--hairline); padding: var(--sp-section) var(--gutter); text-align: center; color: var(--text-dim); font-size: var(--step--1); }
.lb-footer p { margin: 0 auto; }

/* ===========================================================================
   BACK TO TOP (JS toggles .is-visible past 600px)
=========================================================================== */
.lb-to-top {
	position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px);
	z-index: 99998;
	width: 48px; height: 48px; display: grid; place-items: center;
	border-radius: var(--r-pill); cursor: pointer;
	color: var(--accent); background: hsl(var(--n-1) / 0.72);
	backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
	border: 1px solid var(--accent-24); box-shadow: var(--shadow-card);
	opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none;
	transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.25s, color 0.25s;
}
.lb-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.lb-to-top:hover { background: var(--accent); color: hsl(var(--n-0)); transform: translateY(-3px); }
.lb-to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ===========================================================================
   MOTION — scroll reveal (JS adds .reveal + .is-in; safe without JS)
=========================================================================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--rd, 0ms); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
	.lb-row-parallax { background-attachment: scroll; }
}
