/*
Theme Name: BMA Vanilla
Description: Clean-room Business Malls of America build. Hand-written, no frameworks, no page builder. Day/Dusk engine via data-theme on <html>.
Version: 0.1.0
Author: Frederick Studios
*/

/* ============ TOKENS ============ */
html[data-theme="day"] {
	--gold: #F0A63C;
	--gold-deep: #D98F22;
	--gold-ink: #2a1d07;
	--bg: #f2eee4;
	--bg-glow: rgba(240, 166, 60, 0.14);
	--card: #ffffff;
	--card-2: #ffffff;
	--ink: #1b1b23;
	--muted: #5d5d68;
	--line: rgba(20, 16, 8, 0.08);
	--shadow: 0 30px 80px rgba(20, 14, 6, 0.50), 0 8px 24px rgba(20, 14, 6, 0.35);
	--shadow-soft: 0 14px 34px rgba(24, 18, 8, 0.35);
	--shadow-strong: 0 36px 90px rgba(20, 14, 6, 0.60), 0 10px 28px rgba(20, 14, 6, 0.40);
	--pill-bg: rgba(12, 12, 16, 0.55);
	--pill-ink: #ffffff;
	--cue-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
html[data-theme="dusk"] {
	--gold: #F0A63C;
	--gold-deep: #D98F22;
	--gold-ink: #2a1d07;
	--bg: #0a0b10;
	--bg-glow: rgba(240, 166, 60, 0.07);
	--card: #15161e;
	--card-2: #15161e;
	--ink: #f4f1e8;
	--muted: #a9a396;
	--line: rgba(255, 255, 255, 0.08);
	--shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
	--shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.70);
	--shadow-strong: 0 36px 90px rgba(0, 0, 0, 0.90), 0 10px 28px rgba(0, 0, 0, 0.65);
	--pill-bg: rgba(10, 10, 14, 0.6);
	--pill-ink: #ffffff;
	--cue-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	position: relative; /* containing block for the full-page bleed background */
	margin: 0;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background:
		radial-gradient(1200px 600px at 50% -10%, var(--bg-glow), transparent 70%),
		var(--bg);
	color: var(--ink);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.5s ease, color 0.5s ease;
}
/* Kristen 2026-10-12: Playfair Display headlines per comps — the institutional voice */
h1, h2, h3, .vision-text {
	font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: var(--gold-deep); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* Eyebrow labels: gold, letterspaced, small caps feel */
.eyebrow {
	color: var(--gold);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	margin: 0 0 14px;
}

/* ============ BIG BLEED BACKGROUND (Brad 2026-10-11) ============ */
/* One long backdrop: top of page to footer, page design lays on top.
   Day/dusk pair crossfades with the toggle. background-size 100% auto
   lets it expand/contract with the page; the sampled tone below the
   image melts any extra page height invisibly into the bleed. */
.page-bg {
	position: absolute; inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
	background-color: #766e68;
}
html[data-theme="dusk"] .page-bg { background-color: #664730; }
.page-bg-layer {
	position: absolute; inset: 0;
	background-size: 100% auto;
	background-position: top center;
	background-repeat: no-repeat;
	transition: opacity 1.1s ease;
	will-change: transform;
}
.page-bg-dusk { opacity: 0; }
html[data-theme="dusk"] .page-bg-dusk { opacity: 1; }
html[data-theme="dusk"] .page-bg-day { opacity: 0; }

/* All page content floats ABOVE the bleed background. */
main, .site-footer { position: relative; z-index: 1; }

/* ============ HERO ============ */
.hero {
	position: relative;
	min-height: 92vh;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow: hidden;
	text-align: center;
}
/* .hero-shade — TEMP OFF per Brad 2026-10-11 (reviewing hero without dimmer)
.hero-shade {
	position: absolute; inset: 0;
	background: linear-gradient(to bottom, rgba(5,6,10,0.42) 0%, rgba(5,6,10,0.12) 34%, rgba(5,6,10,0.10) 62%, transparent 100%);
	pointer-events: none;
} */
.hero-inner { position: relative; z-index: 2; padding: 118px 24px 70px; max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Pin (Brad 2026-10-12): shadow = trial +50% then eased back 20%. Display width 648->538px (Brad): seal nests inside the hero building's glass facade, wordmark/divider flow underneath */
.hero-logo { width: min(538px, 76.4vw); margin: 0 auto 26px; filter: drop-shadow(0 17px 53px rgba(0,0,0,0.8)) drop-shadow(0 3.6px 12px rgba(0,0,0,0.66)); }
.hero-wordmark { margin: 0 0 30px; }
.hero-wordmark .wm-top {
	display: block;
	color: var(--gold);
	font-weight: 800;
	font-size: clamp(30px, 4.6vw, 54px);
	letter-spacing: 0.08em;
	text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}
.hero-wordmark .wm-sub {
	display: block;
	color: #ffffff;
	font-weight: 600;
	font-size: clamp(15px, 2vw, 24px);
	letter-spacing: 0.62em;
	text-indent: 0.62em;
	margin-top: 10px;
	text-shadow: 0 2px 14px rgba(0,0,0,0.55);
}

/* Day/Dusk pill toggle */
.theme-toggle {
	display: inline-flex;
	background: var(--pill-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255,255,255,0.22);
	border-radius: 999px;
	padding: 5px;
	gap: 4px;
}
.theme-toggle button {
	border: 0;
	border-radius: 999px;
	padding: 10px 26px;
	font: 700 13px/1 inherit;
	letter-spacing: 0.14em;
	color: var(--pill-ink);
	background: transparent;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease;
}
.theme-toggle button.is-active {
	background: linear-gradient(to bottom, #F7C86B, #E9A13B);
	color: var(--gold-ink);
	box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}
.scroll-cue {
	margin: 26px 0 0;
	color: #fff;
	font-size: 17px;
	text-shadow: 0 2px 8px rgba(0,0,0,0.7);
	letter-spacing: 0.3em;
	text-transform: uppercase;
	text-shadow: var(--cue-shadow);
	cursor: pointer;
	background: none;
	border: 0;
	font-family: inherit;
}

/* ============ SECTIONS ============ */
.section { padding: 34px 0; }
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 20px;
	box-shadow: var(--shadow);
	padding: clamp(28px, 4vw, 54px);
	transition: background-color 0.5s ease;
}
/* Kristen 2026-10-12 (Brad's call): dark gallery band in BOTH day and dusk — photography glows on dark */
.card-dark {
	background: #131318;
	border-color: rgba(255,255,255,0.07);
	color: #f4f1e8;
}
/* Brad 2026-10-12: in night mode, all dark rows match the interiors card's 35% */
html[data-theme="dusk"] .card,
html[data-theme="dusk"] .dome-card {
	background: rgba(19, 19, 24, 0.35);
}
html[data-theme="dusk"] .dome-grid .dome-card {
	background: rgba(19, 19, 24, 0.5);
}
html[data-theme="dusk"] #concept .card {
	background: rgba(19, 19, 24, 0.75);
}
html[data-theme="dusk"] .stat .num {
	text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.card-dark .muted, .card-dark p { color: #b9b4a8; }
.card-dark h2, .card-dark h3 { color: #ffffff; }

/* Concept: text + image */
.concept-grid {
	display: grid;
	grid-template-columns: 1.02fr 0.98fr;
	gap: clamp(28px, 4vw, 60px);
	align-items: center;
}
.concept-grid h2 { font-size: clamp(34px, 3.8vw, 54px); font-weight: 800; letter-spacing: -0.01em; }
.concept-grid p.lead { color: var(--muted); font-size: 21px; font-weight: 500; }
.concept-grid figure { margin: 0; }
.concept-grid img { border-radius: 14px; box-shadow: var(--shadow-soft); aspect-ratio: 4/3; width: 100%; object-fit: cover; }

/* Dome cards */
.dome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.dome-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
	overflow: hidden;
	transition: background-color 0.5s ease, transform 0.25s ease;
}
.dome-card:hover { transform: translateY(-4px); }
.dome-card figure { margin: 0; }
.dome-card img { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.dome-card .dome-body { padding: 24px 26px 30px; }
.dome-card h3 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.dome-card .dome-role { font-weight: 700; font-size: 18px; margin: 0 0 8px; }
.dome-card p { color: var(--muted); font-size: 20px; font-weight: 500; margin: 0; }
.dome-card .eyebrow { font-size: 13px; margin-bottom: 10px; }

/* Interiors */
.interiors-head h2 { font-size: clamp(32px, 3.4vw, 46px); font-weight: 800; margin-bottom: 26px; }
.interiors-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.interiors-grid figure { margin: 0; }
.interiors-grid img { border-radius: 12px; aspect-ratio: 4/3; width: 100%; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }

/* Photo gallery (Brad 2026-10-12): standalone day + night photos, no swap */
.gallery-head h2 { font-size: clamp(32px, 3.4vw, 46px); font-weight: 800; margin-bottom: 26px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery-grid figure { margin: 0; }
.gimg { border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.45); cursor: zoom-in; transition: transform 0.25s ease; }
.gimg:hover { transform: translateY(-4px); }
.gimg:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gimg img { aspect-ratio: 4/3; width: 100%; height: 100%; object-fit: cover; }

/* Stats */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	text-align: center;
}
.stat .num {
	color: var(--gold);
	font-size: clamp(38px, 4vw, 56px);
	font-weight: 800;
	line-height: 1;
}
.stat .cap { color: var(--muted); font-size: 20px; font-weight: 500; margin-top: 8px; }

/* Vision statement (Brad 2026-10-12) */
.vision-card { overflow: hidden; }
.vision-img { margin: 0; }
.vision-img img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.vision-text {
	font-size: clamp(22px, 2.6vw, 32px);
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	max-width: 800px;
	margin: 28px auto 8px;
	color: var(--ink);
}

/* CTA band */
.cta {
	position: relative;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--shadow);
	text-align: center;
	padding: clamp(60px, 8vw, 110px) clamp(24px, 6vw, 80px);
	color: #fff;
}
.ddbg-day, .ddbg-dusk { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity 1.1s ease; }
.ddbg-dusk { opacity: 0; }
html[data-theme="dusk"] .ddbg-dusk { opacity: 1; }
html[data-theme="dusk"] .ddbg-day { opacity: 0; }
/* Day/dusk image pairs: same shot, two times of day, crossfading. */
.ddimg { position: relative; display: block; }
.ddimg img { display: block; width: 100%; height: auto; }
.ddimg-dusk { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; }
html[data-theme="dusk"] .ddimg-dusk { opacity: 1; }
.cta-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(8,12,22,0.55), rgba(8,12,22,0.72)); }
.cta-inner { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }
.cta h2 { font-size: clamp(34px, 4vw, 56px); font-weight: 800; color: #fff; }
.cta p { color: rgba(255,255,255,0.85); font-size: 21px; font-weight: 500; }
.btn-gold {
	display: inline-block;
	margin-top: 18px;
	background: linear-gradient(to bottom, #F7C86B, #E9A13B);
	color: var(--gold-ink);
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 0.12em;
	padding: 16px 38px;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba(0,0,0,0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.4); }

/* Footer */
.card:has(.stats-grid) { box-shadow: var(--shadow-strong); }
.site-footer { padding: 10px 0 60px; text-align: center; }
.site-footer .wrap { padding-left: 0; padding-right: 0; }
.site-footer .card { padding: 30px; }
.site-footer p { margin: 4px 0; font-size: 14px; color: var(--muted); }
.site-footer .footer-brand { font-family: "Playfair Display", Georgia, 'Times New Roman', serif; font-size: clamp(30px, 4.5vw, 48px); font-weight: 700; letter-spacing: 0.02em; color: var(--ink); margin: 0 0 10px; }
.site-footer .footer-credit { font-size: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--gold); }
.site-footer a:hover { color: var(--gold-deep); }

/* ============ LIGHTBOX GALLERY (Brad 2026-10-11: every photo clickable) ============ */
.ddimg { cursor: zoom-in; }
.bma-lightbox { position: fixed; inset: 0; z-index: 9999; display: none; }
.bma-lightbox.is-open { display: block; }
.bma-lb-backdrop { position: absolute; inset: 0; background: rgba(5,6,10,0.93); }
.bma-lb-figure { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 70px 76px 96px; }
.bma-lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.65); }
.bma-lb-prev, .bma-lb-next, .bma-lb-close {
	position: absolute; border: 1px solid rgba(201,162,75,0.55); background: rgba(20,16,10,0.72);
	color: #E9C766; border-radius: 50%; width: 52px; height: 52px; font-size: 26px; line-height: 1;
	cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}
.bma-lb-prev:hover, .bma-lb-next:hover, .bma-lb-close:hover { background: rgba(201,162,75,0.28); transform: scale(1.06); }
.bma-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.bma-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.bma-lb-prev:hover { transform: translateY(-50%) scale(1.06); }
.bma-lb-next:hover { transform: translateY(-50%) scale(1.06); }
.bma-lb-close { top: 16px; right: 18px; }
.bma-lb-meta { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #F5EFE2; }
.bma-lb-cap { font-size: 16px; margin-bottom: 6px; }
.bma-lb-count { font-size: 13px; letter-spacing: 0.14em; color: #C9A24B; }

/* ============ RESPONSIVE (desktop-first, then mobile-ready) ============ */
@media (max-width: 1020px) {
	.interiors-grid { grid-template-columns: repeat(2, 1fr); }
	.gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
	.concept-grid { grid-template-columns: 1fr; }
	.dome-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
	.stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; }
	.hero { min-height: 86vh; }
}
@media (max-width: 560px) {
	.wrap { padding: 0 20px; }
	.section { padding: 22px 0; }
	.interiors-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.gallery-grid { gap: 12px; }
	.theme-toggle button { padding: 9px 20px; }
	.bma-lb-figure { padding: 60px 20px 80px; }
}
/* ---- Mobile hero: toggle anchors to the bottom (Brad 2026-10-12) ----
   On phones the hero stretches to the full first view and the Day/Dusk
   toggle + scroll cue drop to the bottom of it, covering the faint
   artifact at the lower edge of the hero background. Desktop untouched.
   Second pass (Brad 2026-10-12): the seal slides DOWN into the blurred
   wash, parked just past where the blur begins — the building keeps the
   top of the frame as the highlight, the seal fills the empty blur with
   breathing room around it, and the toggle holds the bottom. */
@media (max-width: 700px) {
	.hero { min-height: 100svh; }
	.hero-inner {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
		min-height: 100svh;
		padding-top: 24px;
		padding-left: 8px;
		padding-right: 8px;
		padding-bottom: calc(26px + env(safe-area-inset-bottom));
	}
	.hero-logo { width: min(538px, calc(100vw - 16px)); margin: 30svh auto 26px; }
	.theme-toggle { margin-top: auto; }
	/* Melt veil (Brad 2026-10-12, third look): at phone scale the baked
	   blur lets the source photo's building REFLECTION ghost through in
	   the band between the seal and the toggle (~150-185vw, just above
	   the toggle). A tone-matched veil melts that band out; it is sized
	   in vw so it tracks the width-locked background image (187.5vw tall)
	   at any phone width. Nothing above ~125vw is touched — the building
	   and the seal's backdrop keep the photo's own blur. */
	.page-bg::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		height: 187.5vw;
		background: linear-gradient(to bottom,
			rgba(117, 115, 105, 0) 0,
			rgba(117, 115, 105, 0) 125vw,
			rgba(117, 115, 105, 0.45) 150vw,
			rgba(117, 115, 105, 0.9) 170vw,
			rgba(117, 115, 105, 0.97) 185vw,
			rgba(117, 115, 105, 0.97) 187.5vw);
	}
	html[data-theme="dusk"] .page-bg::after {
		background: linear-gradient(to bottom,
			rgba(124, 77, 36, 0) 0,
			rgba(124, 77, 36, 0) 125vw,
			rgba(124, 77, 36, 0.45) 150vw,
			rgba(124, 77, 36, 0.9) 170vw,
			rgba(124, 77, 36, 0.97) 185vw,
			rgba(124, 77, 36, 0.97) 187.5vw);
	}
}
@media (prefers-reduced-motion: reduce) {
	.hero-bg-layer { transition: none; }
	html { scroll-behavior: auto; }
}

/* ---- Image stroke trial ---- */
/* Brad 2026-10-12: 1px hairline keyline on all content images. Color: brand gold
   #C9A24B lightened (HSL lightness 54% -> 60%) and warmed one notch (hue 41 -> 38)
   = #DBAB57. Whisper calibration (Kristen): feel the definition, not see the line.
   Outline at -1px offset = inset keyline, zero layout shift. CTA is a background
   pair, so its keyline rides the shade layer as an inset shadow. */
.ddimg > img,
.gimg img {
	outline: 2px solid #DBAB57;
	outline-offset: -2px;
}
.cta-shade {
	box-shadow: inset 0 0 0 2px #DBAB57;
}

/* ---- Back to top ---- */
/* Brad 2026-10-12 (Miri's design, approved): floating return-to-top.
   Hidden through the first view (first-view doctrine — nothing competes
   with building + logo + toggle + scroll cue); theme.js fades it in after
   ~1 viewport of scroll and out again near the top. Navy disc, gold arrow
   and ring in the brand system; soft gold glow at dusk. Opacity/transform
   only — compositor-safe, no repaint properties animated.
   Icon only, no visible text (Brad) — "Back to top" is the aria-label.
   Raised to bottom: 92px (Brad, live): at 20px his Windows taskbar covered
   it; 92px floats it clear of OS/browser furniture at every size. */
.back-to-top {
	position: fixed;
	right: calc(20px + env(safe-area-inset-right, 0px));
	bottom: calc(92px + env(safe-area-inset-bottom, 0px));
	z-index: 900; /* below the lightbox (9999) */
	width: 46px;
	height: 46px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(201, 162, 75, 0.65);
	background: linear-gradient(to bottom, #1b2338, #0d1220);
	color: #E9C766;
	box-shadow: 0 10px 26px rgba(8, 8, 14, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s, box-shadow 0.25s ease;
}
.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
	transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s, box-shadow 0.25s ease;
}
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
html[data-theme="dusk"] .back-to-top {
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), 0 0 18px rgba(240, 166, 60, 0.38), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
/* Never fight the lightbox — it owns the screen while open. */
body:has(.bma-lightbox.is-open) .back-to-top {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
	.back-to-top { transition: none; }
}
