/* ============================================================
 * Blurr — theme styles
 *
 * Design tokens are declared in `theme.json` (palette, fontSizes,
 * spacingSizes, shadow presets, custom properties for radii / easing /
 * durations / blur). WordPress emits them as `--wp--preset--*` and
 * `--wp--custom--*` CSS custom properties.
 *
 * The :root block below declares short-name aliases for those tokens
 * so the rest of this file can read like the original design while
 * theme.json remains the single source of truth.
 * ============================================================ */

:root {
	/* ============================================================
	 * Design tokens — mirrors the static-HTML site's :root so the
	 * theme can use the same names. WordPress-resident tokens
	 * (palette, fontSizes, spacingSizes, custom radii / motion / blur /
	 * shadows) come from theme.json via --wp--preset--* / --wp--custom--*;
	 * everything below is exposed under the local short names.
	 * ============================================================ */

	/* ---------- Colors ---------- */
	/* Base surfaces */
	--color-bg:                #09090B;
	--color-bg-darker:         #06060A;
	--color-bg-elev-1:         #131316;
	--color-bg-elev-2:         #17171B;
	--color-bg-light:          #FAFAFA;

	/* Overlays — translucent whites for layering on dark surfaces */
	--color-overlay-1:         rgba(255, 255, 255, 0.02);
	--color-overlay-2:         rgba(255, 255, 255, 0.03);
	--color-overlay-3:         rgba(255, 255, 255, 0.04);
	--color-overlay-4:         rgba(255, 255, 255, 0.06);
	--color-overlay-5:         rgba(255, 255, 255, 0.08);
	/* Inverse overlays — translucent darks for layering on light surfaces */
	--color-overlay-inverse-1: rgba(9, 9, 11, 0.02);
	--color-overlay-inverse-2: rgba(9, 9, 11, 0.03);
	--color-overlay-inverse-3: rgba(9, 9, 11, 0.04);
	--color-overlay-inverse-4: rgba(9, 9, 11, 0.06);
	--color-overlay-inverse-5: rgba(9, 9, 11, 0.08);

	/* Text */
	--color-fg:                #FAFAFA;
	--color-fg-muted:          #A1A1AA;
	--color-fg-dim:            #71717A;
	--color-fg-faint:          rgba(255, 255, 255, 0.35);
	--color-fg-white:          #FFFFFF;

	/* Inverted text */
	--color-fg-inverse:        #09090B;
	--color-fg-inverse-muted:  rgba(9, 9, 11, 0.65);
	--color-fg-inverse-dim:    rgba(9, 9, 11, 0.35);
	--color-fg-inverse-faint:  rgba(9, 9, 11, 0.18);

	/* Borders */
	--color-border:            rgba(255, 255, 255, 0.08);
	--color-border-strong:     rgba(255, 255, 255, 0.14);
	--color-border-subtle:     rgba(255, 255, 255, 0.04);
	--color-border-inverse:    rgba(9, 9, 11, 0.08);
	--color-border-inverse-strong: rgba(9, 9, 11, 0.18);

	/* Buttons — light pair is aliased to the existing theme.json accent pair
	 * so a single source of truth (palette) drives both names. */
	--color-btn-light:         var(--wp--preset--color--accent);
	--color-btn-light-hover:   var(--wp--preset--color--accent-hover);
	--color-btn-dark:          var(--wp--preset--color--btn-dark);
	--color-btn-dark-hover:    var(--wp--preset--color--btn-dark-hover);

	/* Brand & status */
	--color-accent-brand:      var(--wp--preset--color--accent-brand);
	--color-success:           #34D399;
	--color-success-glow:      rgba(52, 211, 153, 0.15);
	--color-warning:           #FBBF24;
	--color-warning-soft:      #FACC15;
	--color-error:             #EF4444;
	--color-info:              #4ADE80;

	/* Decoration */
	--color-grid-line:         #25252A;
	--color-grid-dot:          rgba(255, 255, 255, 0.85);

	/* Channel accents */
	--color-whatsapp:          #25D366;
	--color-whatsapp-hover:    #1FB055;

	/* ---------- Typography ---------- */
	--font-display:            'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-body:               'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-mono:               'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--font-primary:            var(--wp--preset--font-family--primary);

	--text-h1:                 clamp(56px, 9vw, 112px);
	--text-h2:                 clamp(40px, 5.4vw, 64px);
	--text-h3:                 clamp(28px, 3vw, 36px);
	--text-h4:                 22px;
	--text-h5:                 18px;
	--text-h6:                 16px;
	--text-body:               16px;
	--text-body-lg:            19px;
	--text-sm:                 14px;
	--text-xs:                 13px;
	--text-2xs:                12px;
	--text-caption:            11px;

	--leading-tight:           1.02;
	--leading-snug:            1.1;
	--leading-normal:          1.5;
	--leading-relaxed:         1.55;
	--leading-loose:           1.6;

	--tracking-tighter:        -0.045em;
	--tracking-tight:          -0.03em;
	--tracking-snug:           -0.02em;
	--tracking-normal:         -0.01em;
	--tracking-wide:           0;
	--tracking-wider:          0.04em;
	--tracking-widest:         0.16em;

	--weight-regular:          400;
	--weight-medium:           500;
	--weight-semibold:         600;
	--weight-bold:             700;

	/* ---------- Spacing ---------- */
	--space-2xs:               4px;
	--space-xs:                8px;
	--space-sm:                12px;
	--space-md:                16px;
	--space-lg:                24px;
	--space-xl:                32px;
	--space-2xl:               48px;
	--space-3xl:               64px;
	--space-4xl:               96px;
	--space-5xl:               128px;

	--section-py:              100px;
	--section-py-mobile:       64px;
	--section-px:              24px;
	--section-px-mobile:       16px;

	--container-max:           1280px;
	--container-padding:       24px;

	/* ---------- Radius (theme.json scale: xs 4, sm 8, md 10, lg 12, xl 14, 2-xl 16, 3-xl 24, full 999) ---------- */
	--radius-xs:               var(--wp--custom--radius--xs);
	--radius-sm:               var(--wp--custom--radius--sm);
	--radius-md:               var(--wp--custom--radius--md);
	--radius-lg:               var(--wp--custom--radius--lg);
	--radius-xl:               var(--wp--custom--radius--xl);
	--radius-2xl:              var(--wp--custom--radius--2-xl);
	--radius-3xl:              var(--wp--custom--radius--3-xl);
	--radius-full:             var(--wp--custom--radius--full);
	--radius-pill:             var(--wp--custom--radius--pill); /* alias of -full */
	--radius:                  var(--radius-2xl);

	/* ---------- Shadows ---------- */
	--shadow-inset:            0 1px 0 rgba(255, 255, 255, 0.04) inset;
	--shadow-sm:               0 2px 8px -2px rgba(0, 0, 0, 0.3);
	--shadow-md:               0 10px 30px -12px rgba(0, 0, 0, 0.6);
	--shadow-lg:               0 20px 50px -20px rgba(0, 0, 0, 0.8);
	--shadow-glow-success:     0 0 0 4px var(--color-success-glow);
	--shadow-nav:              var(--wp--preset--shadow--nav);
	--shadow-card:             var(--wp--preset--shadow--card);

	/* ---------- Motion ---------- */
	--duration-fast:           var(--wp--custom--duration--fast);
	--duration-base:           var(--wp--custom--duration--base);
	--duration:                var(--duration-base);
	--duration-slow:           0.4s;
	--duration-slower:         0.7s;

	--ease:                    var(--wp--custom--easing--out);
	--ease-out:                cubic-bezier(0, 0, 0.2, 1);
	--ease-in:                 cubic-bezier(0.4, 0, 1, 1);

	--transition-fast:         all var(--duration-fast) var(--ease);
	--transition-base:         all var(--duration-base) var(--ease);
	--transition-slow:         all var(--duration-slow) var(--ease);

	/* ---------- Effects ---------- */
	--blur-nav:                var(--wp--custom--blur--nav);

	/* ---------- Breakpoints (reference; can't be used in @media) ---------- */
	--bp-sm:                   480px;
	--bp-md:                   760px;
	--bp-lg:                   1024px;
	--bp-xl:                   1280px;

	/* ---------- Short-name aliases (long-standing theme convention) ---------- */
	--bg:                      var(--wp--preset--color--bg);
	--bg-elev:                 var(--wp--preset--color--bg-elev);
	--bg-elev-hover:           var(--wp--preset--color--bg-elev-hover);
	--fg:                      var(--wp--preset--color--fg);
	--fg-muted:                var(--wp--preset--color--fg-muted);
	--fg-dim:                  var(--wp--preset--color--fg-dim);
	--border:                  var(--wp--preset--color--border);
	--border-strong:           var(--wp--preset--color--border-strong);
	--accent:                  var(--wp--preset--color--accent);
	--accent-hover:            var(--wp--preset--color--accent-hover);
	--accent-brand:            var(--color-accent-brand);
	--btn-dark:                var(--color-btn-dark);
	--btn-dark-hover:          var(--color-btn-dark-hover);
	--success:                 var(--wp--preset--color--success);
	--warning:                 var(--wp--preset--color--warning);
	--max:                     var(--container-max);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* No CSS scroll-behavior/scroll-padding on <html>: Lenis (smooth-scroll.js)
 * owns smooth scrolling and anchor offset. Native scroll-behavior:smooth
 * conflicts with Lenis and causes snapping. */

body {
	/* font-family / font-size / line-height / color / background come from theme.json */
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

body::before {
	content: '';
	position: fixed;
	inset: 0;
	background-image:
		radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,255,255,0.04), transparent),
		linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
	background-size: 100% 100%, 64px 64px, 64px 64px;
	pointer-events: none;
	z-index: 0;
}

/* ---- Dashed side rails ----
 * Two pairs of full-viewport-height dashed vertical lines pinned to the
 * container edges. Mirrors the mockup's `body::after` + `html::after`
 * pattern: the OUTER pair aligns with the container's outer edge (1280px
 * max minus viewport padding), the INNER pair aligns with the container's
 * inner edge (24px inside the outer pair) and only shows on wide viewports.
 */
body::after {
	content: "";
	position: fixed;
	top: 0;
	bottom: 0;
	left: 50%;
	width: min(var(--container-max), calc(100vw - 48px));
	transform: translateX(-50%);
	pointer-events: none;
	z-index: 0;
	background-image:
		linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px);
	background-repeat: repeat-y, repeat-y;
	background-size: 1px 24px, 1px 24px;
	background-position: 0 0, 100% 0;
}

html::after {
	content: "";
	position: fixed;
	top: 0;
	bottom: 0;
	left: 50%;
	width: calc(min(var(--container-max), calc(100vw - 48px)) - 48px);
	transform: translateX(-50%);
	pointer-events: none;
	z-index: 0;
	background-image:
		linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px);
	background-repeat: repeat-y, repeat-y;
	background-size: 1px 24px, 1px 24px;
	background-position: 0 0, 100% 0;
}
@media (max-width: 1327px) {
	html::after { display: none; }
}

.container {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 24px;
	position: relative;
	z-index: 1;
}

/* ---- Type ---- */
h1, h2, h3, h4 {
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-snug);
	line-height: var(--leading-snug);
	color: var(--color-fg);
	text-wrap: balance;
}
h1 {
	font-size: var(--text-h1);
	font-weight: var(--weight-medium);
	letter-spacing: var(--tracking-tighter);
	line-height: var(--leading-tight);
}
h2 {
	font-size: var(--text-h2);
	font-weight: var(--weight-regular);
	letter-spacing: var(--tracking-tight);
}
h3 {
	font-size: var(--text-h3);
	font-weight: var(--weight-regular);
	letter-spacing: var(--tracking-normal);
}
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-h5); font-weight: var(--weight-medium); }
h6 { font-size: var(--text-h6); font-weight: var(--weight-medium); }
p { color: var(--color-fg-muted); text-wrap: pretty; }

.eyebrow {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	color: var(--fg-dim);
	letter-spacing: 0.02em;
}

a { color: inherit; }

/* ---- Buttons ---- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: var(--radius-md);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	letter-spacing: -0.005em;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	transition: all var(--duration) var(--ease);
	white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.22); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Header template-part wrapper ---- */
/* The first template-part inside .wp-site-blocks is the header (the nav).
 * Collapse its <header class="wp-block-template-part"> wrapper out of the
 * layout so the nav's position:sticky is contained by .wp-site-blocks
 * (full page height) instead of the small wrapper around it. */
.wp-site-blocks > .wp-block-template-part:first-child {
	display: contents;
}

/* Navbar block CSS has moved to blocks/menu/menu.css. */

/* ---- Reveal ---- */
.reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
	/* No permanent will-change: it promotes a GPU layer per .reveal that is
	 * never released, accumulating as you scroll a long page and causing
	 * progressive scroll lag. A one-shot opacity/transform transition is
	 * cheap enough without it. */
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; }
	.ticker-track { animation: none; }
	.speed-bar { animation: none; }
	html { scroll-behavior: auto; }
}


/* ---- Logo (shared utility — used by .blk-menu and the footer template-part) ---- */
.logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--color-fg);
	transition: opacity var(--duration-fast) var(--ease);
}
.logo:hover { opacity: 0.7; }
.logo img { display: block; height: 24px; width: auto; }

/* ---- Footer ---- */
footer {
	border-top: 1px solid var(--border);
	padding: 72px 0 36px;
	margin-top: 80px;
	position: relative;
	z-index: 1;
}
/* Footer layout (.foot-grid / .foot-brand / .foot-col / .news-form /
 * .foot-bottom / .foot-legal) lived here for the static-HTML mockup. The
 * footer is now the acf/footer block, which emits .blk-footer__* classes
 * styled in blocks/footer/footer.css — those legacy rules matched nothing
 * and were removed. */

/* ---- Sitemap post list ([blurr_post_list]) ---- */
.blk-sitemap-list {
	list-style: none;
	margin: 32px 0 0;
	padding: 0;
	display: grid;
	gap: 10px;
}
.blk-sitemap-list a {
	color: var(--fg-muted);
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease);
}
.blk-sitemap-list a:hover { color: var(--fg); }

/* ---- 404 page ---- */
.blk-404 {
	position: relative;
	overflow: hidden;
	min-height: calc(100svh - 180px);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 120px 24px;
}
/* Giant "404" behind the content: gradient fill fading from light at the top
 * to dark at the bottom, kept at low opacity so it reads as a backdrop. */
.blk-404__bg {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	font-size: clamp(260px, 52vw, 720px);
	font-weight: var(--weight-bold);
	line-height: 0.85;
	letter-spacing: -0.06em;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
	z-index: 0;
	/* Dotted fill clipped to the glyphs, faded dark (bottom) -> light (top). */
	background-image: radial-gradient(rgba(255, 255, 255, 0.9) 1.3px, transparent 1.6px);
	background-size: 15px 15px;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	opacity: 0.45;
	-webkit-mask-image: linear-gradient(to top, transparent 0%, #000 90%);
	        mask-image: linear-gradient(to top, transparent 0%, #000 90%);
}
.blk-404__inner {
	position: relative;
	z-index: 1;
	max-width: 600px;
}
.blk-404 h2 { margin-bottom: 12px; }
.blk-404 p { color: var(--color-fg-muted); margin-bottom: 28px; }
.blk-404__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ---- Blog post (single) heading sizes ----
 * The theme h2 scale (clamp 40–64px) is tuned for landing-page section heads.
 * On single blog posts the post title and in-content h2s should read smaller.
 * Scoped to body.single-post so landing pages keep the large scale. */
body.single-post .wp-block-post-title {
	font-size: clamp(30px, 3.5vw, 42px);
	line-height: 1.15;
	padding-top: 14px;
}

/* ---- Blog post breadcrumb (top of the article) ---- */
body.single-post .blk-breadcrumb {
	/* Top breathing room / clears the sticky nav (moved here from the title). */
	padding-top: clamp(40px, 5vw, 72px);
}
body.single-post .blk-breadcrumb ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}
body.single-post .blk-breadcrumb li {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--color-fg-dim);
	min-width: 0;
}
body.single-post .blk-breadcrumb li:not(:first-child)::before {
	content: "/";
	color: var(--color-fg-dim);
	opacity: 0.6;
}
body.single-post .blk-breadcrumb a {
	color: var(--color-fg-muted);
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease);
}
body.single-post .blk-breadcrumb a:hover { color: var(--color-fg); }
body.single-post .blk-breadcrumb [aria-current="page"] {
	color: var(--color-fg);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 40ch;
}

/* Post titles (single posts AND listings). The actual text wraps INSIDE the
 * inline-block title link, which inherits the theme's `text-wrap: balance`
 * from the h1–h4 rule — that evens the two lines and leaves space on line 1.
 * Target the link directly (inheritance into the inline-block is what we're
 * overriding) and use the longhand `text-wrap-style: auto` so it works even
 * where the `text-wrap` shorthand reset doesn't. */
.wp-block-post-title,
.wp-block-post-title a {
	text-wrap-style: auto !important;
	text-wrap: wrap !important;
}
/* Core block CSS makes the title link `display: inline-block`, which is
 * shrink-to-fit: on wide screens the box sizes to a narrower width and leaves
 * space on line 1 instead of filling the container. Force it to a full-width
 * block so its greedy line-breaking fills the available width. */
body.single-post .wp-block-post-title a {
	display: block;
}

/* On the single post the title and featured image link back to the same post
 * (redundant). Keep the markup but make them non-clickable. Scoped to
 * single posts so the blog listing keeps its links. */
body.single-post .wp-block-post-title a,
body.single-post .wp-block-post-featured-image a {
	pointer-events: none;
	cursor: default;
}

/* In-content links on blog posts: a 1px bottom-border underline with a little
 * padding for breathing room, plus a light hover fade. Excludes button links. */
body.single-post .entry-content a:not(.wp-block-button__link) {
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	transition: opacity var(--duration-fast) var(--ease);
}
body.single-post .entry-content a:not(.wp-block-button__link):hover {
	opacity: 0.7;
}
body.single-post .entry-content h2.wp-block-heading {
	font-size: clamp(22px, 2.4vw, 30px);
}

/* ---- Blog post (single) column width ----
 * Use an 800px container for the whole single-post column (title, featured
 * image, body, meta) — a touch wider than the theme's 720px contentSize. */
body.single-post main.is-layout-constrained {
	--wp--style--global--content-size: 800px;
}

/* ---- Scroll-out fade ----
 * As a top-level content block leaves the top of the viewport, fade it out.
 * Scroll-driven (compositor-timeline) so it stays smooth and adds no
 * main-thread / Lenis cost; pairs with the .reveal fade-in. Applied to the
 * outer ACF block so it never fights the inner .reveal opacity. Progressive
 * enhancement — browsers without scroll-driven animations keep blocks opaque,
 * and reduced-motion users opt out entirely. */
@keyframes blk-scroll-out {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(-24px); }
}
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.entry-content > [class*="wp-block-acf-"] {
			animation: blk-scroll-out linear both;
			animation-timeline: view();
			animation-range: exit 40% exit 100%;
		}
	}
}
