/* muhammadikram.dev — dark terminal theme (design-system/muhammadikram-net/MASTER.md). Mobile-first; min-width queries add room. */

:root {
	color-scheme: dark;
	--bg: #09090B;
	--surface: #111114;
	--muted: #18181B;
	--line: #27272A;
	--line-2: #3F3F46;
	--strong: #FAFAFA;
	--on-strong: #09090B;
	--text: #FAFAFA;
	--text-2: #A1A1AA;
	--text-3: #8B8B95;
	--accent: #FB923C;
	--accent-bright: #EA580C;
	--accent-ink: #FDBA74;
	--accent-soft: rgba(234, 88, 12, 0.14);
	--accent-fill: #C2410C;
	--accent-fill-hover: #9A3412;
	--on-accent: #FFFFFF;
	--ok: #16A34A;
	--danger: #DC2626;
	--wa: #25D366;

	--display: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
	--sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

	--step--1: 0.875rem;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: clamp(1.4rem, 1.15rem + 1vw, 1.875rem);
	--step-3: clamp(1.875rem, 1.4rem + 2.2vw, 3.25rem);
	--step-4: clamp(2.5rem, 1.7rem + 4vw, 5rem);
	--step-5: clamp(2.75rem, 1.6rem + 6vw, 6.5rem);

	--gutter: 1rem;
	--radius: 10px;
	--radius-sm: 6px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--fast: 180ms;

	/* iOS notch / home indicator (viewport-fit=cover in top.php); 0 elsewhere */
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-right: env(safe-area-inset-right, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-left: env(safe-area-inset-left, 0px);
}
@media (min-width: 760px) { :root { --gutter: 2rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(6rem + var(--safe-top)); scroll-behavior: smooth; -webkit-tap-highlight-color: rgba(234, 88, 12, 0.18); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text-2);
	font: 400 var(--step-0)/1.65 var(--sans);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	overflow-wrap: break-word; /* long URLs and words wrap instead of widening the page on phones */
}
/* site.js also pins the body (position: fixed) while the menu is open, which is what stops iOS Safari scrolling behind it */
html.menu-open, body.menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--text); font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color var(--fast) var(--ease); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-fill); color: var(--on-accent); }
/* Former serif accent: now the accent colour in the heading face */
em.serif, .serif { font-style: normal; color: var(--accent-bright); }
ul, ol { padding-left: 1.2em; }

.wrap { width: 100%; max-width: 80rem; margin-inline: auto; padding-left: max(var(--gutter), var(--safe-left)); padding-right: max(var(--gutter), var(--safe-right)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--accent-fill); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius-sm); }
.skip:focus { top: 1rem; color: #fff; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
	min-height: 48px; padding: 0.7rem 1.3rem; border-radius: var(--radius-sm);
	font: 500 var(--step-0)/1 var(--sans); text-decoration: none; cursor: pointer;
	border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
	transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.btn:hover { border-color: var(--strong); color: var(--text); }
.btn--primary, .btn--lime { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.btn--primary:hover, .btn--lime:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn--wa .icon { color: var(--wa); }
.btn--large { min-height: 56px; padding-inline: 1.6rem; font-size: 1.0625rem; }
.btn .arrow { transition: transform var(--fast) var(--ease); }
@media (hover: hover) { .btn:hover .arrow { transform: translateX(3px); } }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Kept for any leftover markup: renders as a plain outline button */
.circle-btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; padding: 0.7rem 1.3rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; font-weight: 500; }
.circle-btn br { display: none; }
.circle-btn .arrow { margin-left: 0.4rem; }
.circle-btn:hover { border-color: var(--strong); color: var(--text); }

.text-link {
	display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); font-weight: 500;
	text-decoration: none; min-height: 44px;
}
.text-link::after { content: "\2192"; transition: transform var(--fast) var(--ease); }
.text-link:hover { color: var(--accent-ink); }
@media (hover: hover) { .text-link:hover::after { transform: translateX(3px); } }

/* ---------- Header ---------- */
.masthead { position: fixed; inset: 0 0 auto; z-index: 100; padding-top: var(--safe-top); background: rgba(9, 9, 11, 0.92); border-bottom: 1px solid transparent; transition: transform .3s var(--ease), border-color var(--fast); }
/* Safari before 18 only knows the prefixed property */
@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) { .masthead { background: rgba(9, 9, 11, 0.75); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); } }
.masthead.is-scrolled { border-color: var(--line); }
.masthead.is-hidden { transform: translateY(-100%); }
.masthead__bar { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: 1rem; }
.wordmark { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; color: var(--text); text-decoration: none; font: 600 1.05rem/1 var(--display); letter-spacing: -0.01em; }
.wordmark img { width: 36px; height: 36px; border-radius: 50%; }
.wordmark:hover { color: var(--text); }
.site-nav { display: none; }
.masthead__cta { display: none; }
.menu-toggle {
	display: inline-flex; align-items: center; gap: 0.5rem; height: 44px; padding: 0 0.9rem;
	border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
	font: 500 var(--step--1)/1 var(--sans); cursor: pointer;
}
.menu-toggle .icon { width: 20px; height: 20px; }

@media (min-width: 1000px) {
	.site-nav { display: block; }
	.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
	.site-nav a { position: relative; display: flex; align-items: center; min-height: 44px; padding: 0 0.85rem; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
	.site-nav a:hover { color: var(--text); }
	.site-nav a[aria-current="page"] { color: var(--text); }
	.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 4px; height: 2px; background: var(--accent-bright); }
	.masthead__cta { display: inline-flex; min-height: 42px; padding: 0.5rem 1.1rem; font-size: 0.9375rem; }
	.menu-toggle { display: none; }
}

/* Off-canvas menu */
.offcanvas {
	position: fixed; inset: 0; z-index: 150; background: var(--bg); display: flex; flex-direction: column;
	padding: calc(0.6rem + var(--safe-top)) max(var(--gutter), var(--safe-right)) calc(2rem + var(--safe-bottom)) max(var(--gutter), var(--safe-left));
	overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; /* short screens / landscape: the menu scrolls itself, not the page */
	opacity: 0; visibility: hidden; transform: translateY(-8px);
	transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.offcanvas.is-open { opacity: 1; visibility: visible; transform: none; }
.offcanvas__top { display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; }
.offcanvas__close { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.offcanvas__nav { list-style: none; margin: 1.5rem 0 auto; padding: 0; counter-reset: nav; border-top: 1px solid var(--line); }
.offcanvas__nav li { counter-increment: nav; border-bottom: 1px solid var(--line); }
.offcanvas__nav a { display: flex; align-items: baseline; gap: 1rem; padding: 0.9rem 0; color: var(--text); text-decoration: none; font: 600 clamp(1.75rem, 8vw, 2.5rem)/1.1 var(--display); letter-spacing: -0.02em; }
.offcanvas__nav a::before { content: "0" counter(nav); font: 500 var(--step--1)/1 var(--sans); color: var(--text-3); letter-spacing: 0; }
.offcanvas__nav a[aria-current="page"] { color: var(--accent); }
.offcanvas__foot { display: grid; gap: 1rem; padding-top: 2rem; }
.offcanvas__label { font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin: 0; }

/* ---------- Sections ---------- */
main { display: block; }
/* Site-wide background boil (site.js): fixed behind every page */
.bg-boil { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.section { padding-block: 4.5rem; }
.section--tight { padding-block: 3rem; }
.section--alt { background: rgba(17, 17, 20, 0.72); border-block: 1px solid var(--line); }
.section--line { border-top: 1px solid var(--line); }
@media (min-width: 760px) { .section { padding-block: 7rem; } .section--tight { padding-block: 4rem; } }

.sec-label { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; font: 500 0.8125rem/1 var(--mono); text-transform: lowercase; letter-spacing: 0.02em; color: var(--text-3); }
.sec-label::before { content: "//"; color: var(--accent-bright); }
.sec-title { font-size: var(--step-3); margin-bottom: 0.5em; }
.section__head { display: grid; gap: 1.25rem 3rem; margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.section__head .sec-title { margin: 0; max-width: 20ch; }
.section__head p { max-width: 34rem; margin: 0; }
@media (min-width: 900px) { .section__head { grid-template-columns: 1fr auto; align-items: end; } }
.lede { font-size: var(--step-1); line-height: 1.6; color: var(--text-2); max-width: 44rem; }

/* Perspective grid floor */
.page-head { position: relative; overflow: hidden; }
.page-head > .wrap { position: relative; z-index: 1; }
/* Header diorama (hero3d.js): its own column on desktop, a faint backdrop on phones */
.page-head__3d { position: absolute; z-index: 0; right: -20%; top: 4.5rem; width: 85%; height: 18rem; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease); }
.page-head__3d.is-live { opacity: .35; }
@media (min-width: 900px) {
	.page-head__3d { right: 0; top: 5rem; width: 48%; height: 30rem; }
	.page-head__3d.is-live { opacity: 1; }
	.page-head--3d h1, .page-head--3d .lede, .page-head--3d .topic-intro { max-width: min(100%, 36rem); }
	.page-head--3d .search { position: relative; z-index: 1; }
}
.page-head::before { content: ""; position: absolute; left: -50%; right: -50%; bottom: 0; height: 70%; pointer-events: none; transform: perspective(600px) rotateX(62deg); transform-origin: bottom; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 4rem 4rem; mask-image: linear-gradient(to top, #000, transparent 80%); -webkit-mask-image: linear-gradient(to top, #000, transparent 80%); opacity: .7; }
/* Card tilt (site.js adds .tilt on fine pointers) */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s var(--ease); will-change: transform; }
.tilt.is-tilting { transition: transform .08s linear; }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(251, 146, 60, .14), transparent 55%); opacity: 0; transition: opacity var(--fast); }
.tilt.is-tilting::after { opacity: 1; }
.service.tilt, .lifecycle__stage.tilt { position: relative; z-index: 0; }
.service.tilt.is-tilting, .lifecycle__stage.tilt.is-tilting { z-index: 1; box-shadow: 0 18px 40px -20px rgba(234, 88, 12, .35); }
.services, .lifecycle { overflow: visible; }
.services > :first-child, .lifecycle > :first-child { border-radius: var(--radius) var(--radius) 0 0; }
@media (min-width: 900px) { .lifecycle > :first-child { border-radius: var(--radius) 0 0 var(--radius); } .lifecycle > :last-child { border-radius: 0 var(--radius) var(--radius) 0; } }

/* ---------- Name strip ---------- */
.marquee-clip { overflow: hidden; }
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 1.25rem 0; background: rgba(17, 17, 20, 0.72); }
.marquee__label { display: block; margin-bottom: 0.9rem; font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.marquee__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
@media (hover: hover) { .marquee:hover .marquee__track { animation-play-state: paused; } }
.marquee__item { display: inline-flex; align-items: center; white-space: nowrap; font: 600 clamp(1.125rem, 1rem + 0.8vw, 1.5rem)/1 var(--display); letter-spacing: -0.01em; color: var(--text-2); }
.marquee__item::after { content: ""; width: 6px; height: 6px; margin: 0 1.75rem; background: var(--line-2); }
.marquee__item--muted { color: var(--text-3); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; flex-wrap: wrap; width: auto; row-gap: 0.75rem; } }

/* ---------- About intro ---------- */
.intro { display: grid; gap: 2rem; }
.intro__title { font-size: var(--step-3); line-height: 1.12; }
.intro__body { display: grid; gap: 1rem; align-content: start; font-size: 1.0625rem; }
.intro__body p { margin: 0; }
@media (min-width: 900px) { .intro { grid-template-columns: 1.4fr 1fr; gap: 5rem; } .intro__body { padding-top: 3.25rem; } }

/* ---------- Services (numbered cards) ---------- */
.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service { display: grid; gap: 0.9rem; align-content: start; padding: 1.75rem 1.5rem; background: var(--surface); transition: background var(--fast) var(--ease); }
.service:hover { background: var(--bg); }
.service__num { font: 600 0.875rem/1 var(--display); color: var(--accent); }
.service__title { font-size: var(--step-2); margin: 0; }
.service p { margin: 0; }
.service__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.5rem 0 0; padding: 0; }
@media (min-width: 760px) { .services { grid-template-columns: repeat(2, 1fr); } .service { padding: 2.25rem 2rem; } }

.tag { display: inline-block; padding: 0.25rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); font-size: 0.8125rem; line-height: 1.4; color: var(--text-2); white-space: nowrap; }
.tag--lime, .tag--accent { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Project cards ---------- */
.project-grid { display: grid; gap: 2.5rem 2rem; }
@media (min-width: 700px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .project-grid--three { grid-template-columns: repeat(3, 1fr); } }
.project-card { position: relative; display: grid; gap: 1rem; align-content: start; }
.project-card__thumb { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--muted); aspect-ratio: 16 / 10; }
.project-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s var(--ease); }
@media (hover: hover) { .project-card:hover .project-card__thumb img { transform: scale(1.03); } }
.project-card__view { position: absolute; right: 0.9rem; bottom: 0.9rem; padding: 0.45rem 0.8rem; border-radius: var(--radius-sm); background: var(--strong); color: var(--on-strong); font-weight: 500; font-size: 0.8125rem; opacity: 0; transform: translateY(4px); transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease); }
.project-card__view::after { content: " \2192"; }
.project-card:focus-within .project-card__view { opacity: 1; transform: none; }
@media (hover: hover) { .project-card:hover .project-card__view { opacity: 1; transform: none; } }
.project-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem; text-align: center; font: 600 var(--step-2)/1.1 var(--display); color: var(--text-3); background: repeating-linear-gradient(135deg, var(--muted) 0 12px, #1F1F23 12px 24px); }
.project-card__meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-card__title { font-size: var(--step-2); margin: 0; }
.project-card__title a { text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; }
.project-card:hover .project-card__title a { color: var(--accent); }
.project-card__summary { margin: 0; font-size: 0.9375rem; }
.project-card--compact .project-card__title { font-size: var(--step-1); }

/* Filters */
.filters { display: grid; gap: 1.25rem; margin-bottom: 3rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filters__group { display: grid; gap: 0.6rem; }
.filters__label { margin: 0; font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.filters__chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0.4rem 0.9rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: 500 0.875rem/1.3 var(--sans); text-decoration: none; cursor: pointer; transition: border-color var(--fast), background var(--fast), color var(--fast); }
.chip span { font-size: 0.75rem; color: var(--text-3); }
@media (pointer: coarse) { .chip { min-height: 44px; } }
.chip:hover { border-color: var(--strong); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.chip[aria-pressed="true"] span, .chip[aria-current="page"] span { color: var(--on-strong); opacity: .7; }
.filters__count { margin: 0; font-size: var(--step--1); color: var(--text-2); }
.filters__count strong { color: var(--accent); }
.is-filtered-out { display: none !important; }
.empty { padding: 3rem 0; text-align: center; }

/* ---------- Page heads + project detail ---------- */
.page-head { padding: calc(8rem + var(--safe-top)) 0 3rem; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 0.35em; }
.page-head--plain { border: 0; }
@media (min-width: 760px) { .page-head { padding: calc(10rem + var(--safe-top)) 0 4rem; } }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; font-size: 0.875rem; }
.crumbs a { color: var(--text-3); text-decoration: none; padding-block: 0.65rem; margin-block: -0.65rem; } /* 44px tap height, same layout */
.crumbs a:hover { color: var(--accent); }
.crumbs a + a::before, .crumbs a + span::before { content: "/"; margin-right: 0.5rem; color: var(--line-2); }
.crumbs span { color: var(--text); }

.project-hero { display: grid; gap: 2rem; align-items: end; }
.project-hero__title { font-size: var(--step-5); line-height: 0.98; letter-spacing: -0.04em; margin: 0; overflow-wrap: anywhere; }
@media (min-width: 900px) { .project-hero { grid-template-columns: 1fr auto; } }
.project-lede { margin: 2rem 0 0; }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 3rem 0 0; }
.facts > div { background: var(--surface); padding: 1.25rem; }
.facts dt { font-size: 0.8125rem; color: var(--text-3); margin-bottom: 0.35rem; }
.facts dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.facts dd a { text-decoration: none; color: var(--accent); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }

.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--muted); }
.shot__bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.65rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.shot__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.shot__bar span { margin-left: 0.75rem; font-size: 0.8rem; color: var(--text-3); }
.shot img { width: 100%; }

.detail { display: grid; gap: 3rem; }
.detail__block h2 { font-size: var(--step-2); }
.detail__block + .detail__block { padding-top: 3rem; border-top: 1px solid var(--line); }
.detail aside { display: grid; gap: 2rem; align-content: start; }
.detail aside h2 { font: 500 0.8125rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 0.9rem; }
.stack { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.checks li { position: relative; padding-left: 1.75rem; color: var(--text); }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 0.9rem; height: 0.5rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
@media (min-width: 900px) {
	.detail { grid-template-columns: 1fr 22rem; gap: 5rem; }
	.detail aside { position: sticky; top: 6rem; }
}

.nextprev { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.nextprev a { display: grid; gap: 0.4rem; padding: 2.25rem var(--gutter); background: var(--surface); text-decoration: none; transition: background var(--fast); }
.nextprev a:hover { background: var(--bg); color: var(--text); }
.nextprev small { font-size: 0.8125rem; color: var(--text-3); }
.nextprev strong { font: 600 var(--step-2)/1.1 var(--display); letter-spacing: -0.02em; color: var(--text); }
.nextprev a:hover strong { color: var(--accent); }
.nextprev a:last-child { text-align: right; }
@media (min-width: 760px) { .nextprev { grid-template-columns: 1fr 1fr; } }

/* ---------- Lifecycle (CRM case studies) ---------- */
.lifecycle { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: stage; }
.lifecycle__stage { counter-increment: stage; background: var(--surface); }
.lifecycle__stage a { position: relative; display: grid; gap: 0.4rem; height: 100%; padding: 1.5rem; text-decoration: none; transition: background var(--fast); }
.lifecycle__stage a::before { content: "0" counter(stage); font: 600 0.875rem/1 var(--display); color: var(--accent); }
.lifecycle__stage a:hover { background: var(--bg); }
.lifecycle__stage.is-current a { background: var(--accent-soft); }
.lifecycle__name { font: 600 var(--step-1)/1.15 var(--display); letter-spacing: -0.01em; color: var(--text); }
.lifecycle__desc { font-size: 0.9rem; color: var(--text-2); }
.lifecycle__stage a:hover .lifecycle__name, .lifecycle__stage.is-current .lifecycle__name { color: var(--accent-ink); }
@media (min-width: 900px) {
	.lifecycle { grid-template-columns: repeat(5, 1fr); }
	.lifecycle__stage:not(:last-child) a::after { content: "\2192"; position: absolute; right: 1rem; top: 1.35rem; color: var(--line-2); }
}

.case-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.case-row { display: grid; gap: 0.5rem 3rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
.case-row__stage { margin: 0; color: var(--accent); font-weight: 500; font-size: var(--step--1); }
.case-row__title { font-size: var(--step-2); margin: 0; }
.case-row__title a { text-decoration: none; }
.case-row p { margin: 0; }
.case-row__context { font-size: 0.9rem; color: var(--text-3); }
@media (min-width: 900px) { .case-row { grid-template-columns: 12rem 1fr; } .case-row > *:not(.case-row__stage) { grid-column: 2; } }
.case-context { color: var(--text-3); }
.next-case { display: grid; gap: 0.5rem; }
.next-case p { margin: 0; font-weight: 500; font-size: var(--step--1); color: var(--accent); }
.next-case__link { font: 600 var(--step-3)/1.08 var(--display); letter-spacing: -0.03em; text-decoration: none; }

/* ---------- Blog cards ---------- */
.post-grid { display: grid; gap: 2.5rem 2rem; }
@media (min-width: 700px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { position: relative; display: grid; gap: 0.9rem; align-content: start; }
.post-card__thumb { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; background: var(--muted); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
@media (hover: hover) { .post-card:hover .post-card__thumb img { transform: scale(1.03); } }
.post-card__badge { position: absolute; left: 0.9rem; top: 0.9rem; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 4px; background: var(--surface); color: var(--text); font-size: 0.75rem; font-weight: 500; }
.post-card__badge .icon { width: 1em; height: 1em; color: var(--accent); }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; margin: 0; font-size: 0.8125rem; color: var(--text-3); }
.post-card__meta a, .post-card__topic { color: var(--accent); font-weight: 500; text-decoration: none; position: relative; z-index: 1; }
.post-card__title { font-size: var(--step-1); line-height: 1.3; margin: 0; }
.post-card__title a { text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card__title a { color: var(--accent); }
.post-card__excerpt { margin: 0; font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__more { font-size: 0.875rem; font-weight: 500; color: var(--accent); }

/* Text-only cover when a post has no image */
.type-cover { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 1.5rem; font: 600 var(--step-2)/1.15 var(--display); letter-spacing: -0.02em; color: var(--text); background: var(--muted); }
.type-cover::before { content: ""; position: absolute; top: 1.5rem; left: 1.5rem; width: 10px; height: 10px; background: var(--accent-bright); }
.type-cover--video { background: var(--accent-soft); }

/* Featured post */
.featured { position: relative; display: grid; gap: 2rem; padding-bottom: 3.5rem; margin-bottom: 3.5rem; border-bottom: 1px solid var(--line); }
.featured__thumb { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; background: var(--muted); }
.featured__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
@media (hover: hover) { .featured:hover .featured__thumb img { transform: scale(1.02); } }
.featured__body { display: grid; gap: 1.25rem; align-content: center; }
.featured__title { font-size: var(--step-3); line-height: 1.08; margin: 0; }
.featured__title a { text-decoration: none; }
.featured__title a::after { content: ""; position: absolute; inset: 0; }
.featured:hover .featured__title a { color: var(--accent); }
.featured__body p { margin: 0; font-size: var(--step-1); line-height: 1.6; }
@media (min-width: 900px) { .featured { grid-template-columns: 1fr 1.1fr; gap: 4rem; } }

/* Blog toolbar: search + topics */
.blog-tools { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.search { display: flex; align-items: center; gap: 0.5rem; max-width: 34rem; padding: 0.3rem 0.3rem 0.3rem 1rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 400 var(--step-0)/1.4 var(--sans); padding: 0.6rem 0; }
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; }
.search button { flex: none; min-height: 44px; padding: 0.5rem 1.2rem; border: 0; border-radius: 4px; background: var(--accent-fill); color: var(--on-accent); font: 500 0.9375rem/1 var(--sans); cursor: pointer; }
.search button:hover { background: var(--accent-fill-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.result-note { margin: 0 0 2.5rem; color: var(--text-2); }
.result-note strong { color: var(--text); }

.topic-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; list-style: none; margin: 0; padding: 0; }
.topic-grid a { position: relative; display: grid; gap: 0.6rem; height: 100%; padding: 1.75rem 1.5rem; background: var(--surface); text-decoration: none; transition: background var(--fast); }
.topic-grid a:hover { background: var(--bg); color: inherit; }
.topic-grid__name { font: 600 var(--step-2)/1.1 var(--display); letter-spacing: -0.02em; color: var(--text); }
.topic-grid a:hover .topic-grid__name { color: var(--accent); }
.topic-grid__desc { font-size: 0.9375rem; }
.topic-grid__count { font-size: 0.8125rem; font-weight: 500; color: var(--accent); }
.topic-intro { max-width: 44rem; font-size: var(--step-1); }
@media (min-width: 700px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .topic-grid { grid-template-columns: repeat(3, 1fr); } }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pager a { display: inline-flex; align-items: center; min-height: 48px; padding: 0.5rem 1.3rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; font-weight: 500; }
.pager a:hover { border-color: var(--strong); color: var(--text); }
.pager__count { font-size: 0.875rem; color: var(--text-3); }

/* ---------- Article ---------- */
.progress { position: fixed; inset: var(--safe-top) 0 auto; z-index: 120; height: 3px; background: var(--accent-bright); transform-origin: left; transform: scaleX(0); }
.post__head { padding-top: calc(8rem + var(--safe-top)); padding-bottom: 2.5rem; max-width: 60rem; }
.post__title { font-size: var(--step-4); line-height: 1.05; }
.post__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; font-size: 0.875rem; color: var(--text-3); }
.post__meta > * { display: inline-flex; align-items: center; gap: 0.5rem; }
.post__meta > * + *::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); margin-right: 0.5rem; }
@media (min-width: 760px) { .post__head { padding-top: calc(10rem + var(--safe-top)); } }

.prose { max-width: 44rem; font-size: 1.0625rem; line-height: 1.75; }
.prose p, .prose li { color: var(--text-2); }
.prose h2 { font-size: var(--step-2); margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); }
.prose blockquote { margin: 2em 0; padding: 0.25em 0 0.25em 1.5rem; border-left: 3px solid var(--accent); font: 500 var(--step-2)/1.35 var(--display); letter-spacing: -0.015em; color: var(--text); }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose ul li::marker, .prose ol li::marker { color: var(--accent); }
.prose code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--muted); font-size: 0.9em; overflow-wrap: anywhere; }
/* Imported post HTML: keep wide blocks inside the column on phones */
.prose a { overflow-wrap: anywhere; }
.prose pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 1rem; border-radius: var(--radius-sm); background: var(--muted); font-size: 0.875rem; }
.prose pre code { padding: 0; background: none; overflow-wrap: normal; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose iframe, .prose video, .prose embed, .prose object { max-width: 100%; }
.prose iframe[src*="youtube"], .prose iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose-narrow { max-width: 44rem; }

.gallery { max-width: 44rem; margin: 0 0 3rem; }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); border: 1px solid var(--line); }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; background: var(--muted); }
.gallery__slide img { width: 100%; }
.gallery__controls { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin-top: 1rem; }
.gallery__btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer; transition: border-color var(--fast); }
.gallery__btn:hover:not(:disabled) { border-color: var(--strong); }
.gallery__btn:disabled { opacity: .35; cursor: default; }
.gallery__count { font-size: 0.875rem; color: var(--text-2); min-width: 4.5rem; text-align: center; }

.transcript { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.transcript summary { padding: 1rem 1.25rem; cursor: pointer; color: var(--text); font-weight: 500; }
.transcript section { padding: 0 1.25rem 1rem; }
.transcript__label { font: 500 0.8125rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin: 1rem 0 0.4rem; }

.post__foot { max-width: 44rem; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); display: grid; gap: 2rem; }
.post__foot-label { font: 500 0.8125rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin: 0 0 0.9rem; }
.post__topics { margin: 0; }
.post__topics a { color: var(--accent); }
.author { display: flex; gap: 1.25rem; align-items: center; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.author img { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author p { margin: 0; }
.author__name { color: var(--text); font: 600 var(--step-1)/1.2 var(--display); margin-bottom: 0.25rem !important; }
.author a { color: var(--accent); }
.pager--post { margin-top: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 0; }
.pager--post a { display: grid; gap: 0.35rem; min-height: 0; padding: 1.25rem; border: 0; border-radius: 0; background: var(--surface); color: var(--text); }
.pager--post a span { font-size: 0.8125rem; color: var(--text-3); }
.pager--post a:hover { background: var(--bg); color: var(--accent); }
@media (min-width: 700px) { .pager--post { grid-template-columns: 1fr 1fr; } .pager--post a[rel="prev"] { text-align: right; } }

.social { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.social a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.5rem 0.9rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; font-size: 0.875rem; font-weight: 500; color: var(--text); transition: border-color var(--fast); }
.social a:hover { border-color: var(--strong); color: var(--text); }
.social .icon { width: 1.05em; height: 1.05em; }

/* ---------- About ---------- */
.about-head { display: grid; gap: 2.5rem; align-items: end; }
.about-head__visual { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1 / 0.85; }
.about-head__visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s var(--ease); }
.about-head__visual canvas.is-live { opacity: 1; }
.about-head__photo { position: absolute; left: 0; bottom: 4%; width: 26%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line), 0 0 40px -8px rgba(234, 88, 12, .55); }
/* No WebGL or reduced motion: the portrait stands on its own */
.about-head__visual:not(:has(.is-live)) { aspect-ratio: auto; }
.about-head__visual:not(:has(.is-live)) .about-head__photo { position: static; width: 100%; max-width: 300px; }
@media (min-width: 900px) { .about-head { grid-template-columns: 1fr 480px; } .about-head__visual { order: 2; } }
.principles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: p; }
.principles > div { counter-increment: p; background: var(--surface); padding: 2rem 1.5rem; }
.principles > div::before { content: "0" counter(p); display: block; margin-bottom: 1.25rem; font: 600 0.875rem/1 var(--display); color: var(--accent); }
.principles p { margin: 0; }
@media (min-width: 900px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline__item { display: grid; gap: 0.3rem 3rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.timeline__item p { margin: 0; }
.timeline__dates { color: var(--text-3); font-size: 0.875rem; font-weight: 500; }
.timeline__role { margin: 0; font-size: var(--step-2); }
.timeline__org { color: var(--accent-ink); font-weight: 500; }
@media (min-width: 900px) { .timeline__item { grid-template-columns: 14rem 1fr; } .timeline__item > *:not(.timeline__dates) { grid-column: 2; } }

/* ---------- Forms ---------- */
.form-wrap { max-width: 44rem; }
.form { display: grid; gap: 1.5rem; }
.field { display: grid; gap: 0.45rem; }
.field label { color: var(--text); font-size: 0.9375rem; font-weight: 500; }
.field__hint { font-weight: 400; color: var(--text-3); }
.field input, .field select, .field textarea {
	width: 100%; min-height: 48px; padding: 0.75rem 0.9rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
	background: var(--surface); color: var(--text); font: 400 var(--step-0)/1.4 var(--sans); transition: border-color var(--fast), box-shadow var(--fast);
}
.field select { appearance: none; padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { margin: 0; color: var(--danger); font-size: 0.9rem; }
.field--trap { position: absolute; left: -9999px; }
.notice { padding: 1.5rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); margin-bottom: 2rem; }
.notice--ok { border-left-color: var(--ok); }
.notice--error { border-left-color: var(--danger); }
.notice h2 { font-size: var(--step-2); }
.notice p:last-child { margin: 0; }
.contact-grid { display: grid; gap: 3rem; }
.contact-card { display: grid; gap: 1rem; align-content: start; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact-card h2 { font-size: var(--step-2); margin: 0; }
.contact-card p { margin: 0; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 22rem; gap: 5rem; } }

/* ---------- CTA + footer ---------- */
.cta { padding-block: 4.5rem; }
.cta__box { display: grid; gap: 2rem; padding: 2.5rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(circle at 90% 0%, rgba(234, 88, 12, .28), transparent 55%), var(--surface); color: var(--text-2); }
.cta__title { font-size: var(--step-4); color: var(--text); margin: 0 0 1.25rem; letter-spacing: -0.04em; line-height: 1; }
.cta__title .serif { color: var(--accent-bright); }
.cta p { max-width: 34rem; margin: 0; }
.cta .actions { margin: 0; align-self: end; }
@media (min-width: 900px) { .cta { padding-block: 7rem; } .cta__box { grid-template-columns: 1.4fr 1fr; padding: 4rem; gap: 3rem; } .cta .actions { justify-content: flex-end; } }

.site-footer { background: rgba(17, 17, 20, 0.8); border-top: 1px solid var(--line); padding: 4rem 0 calc(2rem + var(--safe-bottom)); }
.site-footer__grid { display: grid; gap: 2.5rem; }
.site-footer__name { margin: 0 0 0.75rem; font: 600 var(--step-2)/1.1 var(--display); letter-spacing: -0.02em; color: var(--text); }
.site-footer__role { margin: 0; max-width: 22rem; }
.site-footer h2 { font: 500 0.8125rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin: 0 0 1.1rem; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; }
.site-footer__links a:hover { color: var(--accent); }
.site-footer__legal { margin: 3.5rem auto 0; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--text-3); }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 3rem; } }

.wa-float { position: fixed; right: calc(1rem + var(--safe-right)); bottom: calc(1rem + var(--safe-bottom)); z-index: 90; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); transition: transform var(--fast) var(--ease); }
.wa-float:hover { color: #fff; }
@media (hover: hover) { .wa-float:hover { transform: scale(1.06); } }
.wa-float .icon { width: 28px; height: 28px; }

.to-top { position: fixed; right: calc(1.1rem + var(--safe-right)); bottom: calc(5.25rem + var(--safe-bottom)); z-index: 90; width: 48px; height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; opacity: 0; visibility: hidden; transition: opacity var(--fast), visibility var(--fast), border-color var(--fast); }
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { border-color: var(--strong); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-lines > * { display: block; overflow: hidden; padding-bottom: 0.06em; }
.reveal-lines > * > span { display: block; transform: translateY(105%); transition: transform .6s var(--ease); }
.reveal-lines.is-in > * > span { transform: none; }
.reveal-lines.is-in > *:nth-child(2) > span { transition-delay: .06s; }
.reveal-lines.is-in > *:nth-child(3) > span { transition-delay: .12s; }
.reveal-lines.is-in > *:nth-child(4) > span { transition-delay: .18s; }
.no-js .reveal, .no-js .reveal-lines > * > span { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.reveal, .reveal-lines > * > span { opacity: 1 !important; transform: none !important; transition: none !important; }
}
.spacer { height: 2.5rem; }

/* ---------- Video ---------- */
.watch { display: grid; gap: 1.5rem; align-items: end; margin-bottom: 3rem; }
.watch__video { width: 100%; max-width: 380px; aspect-ratio: 9 / 16; border-radius: var(--radius); border: 1px solid var(--line); background: #000; object-fit: cover; }
.watch-notice { max-width: 44rem; margin-bottom: 2.5rem; }
@media (min-width: 760px) { .watch { grid-template-columns: 380px 1fr; gap: 2.5rem; } }

/* ---------- Carousel slides rendered as HTML (content studio posts) ---------- */
.story { display: grid; gap: 1.25rem; max-width: 52rem; margin-top: 3rem; counter-reset: step; }
.story-slide { position: relative; padding: 1.75rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.story-slide:first-child { border-top: 3px solid var(--accent); }
@media (min-width: 760px) { .story-slide { padding: 2.5rem 2.75rem; } }
.story-slide__meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; font-size: 0.8125rem; color: var(--text-3); }
.story-slide__meta span + span { color: var(--accent); font-weight: 500; }
.story-slide .grow > * + * { margin-top: 1.25rem; }
.story-slide p { margin: 0; color: var(--text-2); }
.story-slide strong { color: var(--text); }
.story-slide em { font-style: normal; color: var(--accent); }
.story .eyebrow { font-size: 0.8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.story .title, .story .hook { margin: 0; font-size: var(--step-2); line-height: 1.15; }
.story .hook { font-size: var(--step-3); }
.story .sub, .story .body { font-size: var(--step-1); line-height: 1.6; }
.story .question { font: 500 var(--step-2)/1.3 var(--display); color: var(--text); }
.story .insight { padding: 1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.story .insight p { color: var(--text); font-weight: 500; }
.story .note, .story .sources { font-size: 0.85rem; color: var(--text-3); }
.story h3 { margin: 0 0 0.3rem; font-size: var(--step-1); }
.story ul { margin: 0; padding-left: 1.1em; }
.story li { margin: 0.3rem 0; color: var(--text-2); }
.story li::marker { color: var(--accent); }
.story .cta-actions { display: none; }

.story .checklist { display: grid; gap: 0.75rem; }
.story .check { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.story .check p { color: var(--text); font-weight: 500; }
.story .check small { color: var(--text-2); }
.story .box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 0; border: 1px solid var(--line-2); }
.story .box::before { content: "\2713"; font-size: 0.9rem; color: var(--ok); }
.story .check.bad .box, .story .check.no .box { border-color: rgba(220, 38, 38, .4); }
.story .check.bad .box::before, .story .check.no .box::before { content: "\2715"; color: var(--danger); }
.story .check.yes .box { border-color: var(--ok); }

.story .flow { display: grid; gap: 0.6rem; }
.story .step { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.story .step .n { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 0.9rem/1 var(--display); color: var(--text); }
.story .step.hot { border-color: var(--accent); }
.story .step.hot .n { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.story .step p { color: var(--text-2); }

.story .kpis { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.story .kpi, .story .stat-hero { display: grid; gap: 0.35rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.story .num { font: 700 var(--step-3)/1 var(--display); letter-spacing: -0.03em; color: var(--accent); }
.story .stat-hero .num { font-size: var(--step-5); }
.story .label { color: var(--text); }
.story .delta { font-size: 0.85rem; color: var(--text-2); }
.story .delta.down, .story .red { color: var(--danger); }
.story .delta.up, .story .teal { color: var(--ok); }

.story .compare, .story .three { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .story .compare { grid-template-columns: 1fr 1fr; } .story .three { grid-template-columns: repeat(3, 1fr); } }
.story .col { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.story .col.b { border-color: var(--accent); background: var(--accent-soft); }
.story .col.b h3 { color: var(--accent-ink); }

.story .table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: 0.95rem; }
.story .table th, .story .table td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--text-2); }
.story .table th { color: var(--text); font: 500 0.8125rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; }
.story .table td:first-child { color: var(--text); font-weight: 500; }
.story .table .yes { color: var(--ok); }
.story .table .no, .story .table .bad { color: var(--danger); }

.story .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.story .chip { min-height: 0; padding: 0.35rem 0.8rem; border: 1px solid var(--line-2); border-radius: 4px; font-size: 0.875rem; color: var(--text-2); cursor: default; }
.story .chip.on, .story .chip.hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.story .arrow { color: var(--text-3); }

.story .bars { display: grid; gap: 0.8rem; }
.story .bar { display: grid; grid-template-columns: minmax(5rem, 9rem) 1fr auto; gap: 0.9rem; align-items: center; }
.story .bar .name { font-size: 0.9rem; color: var(--text-2); }
.story .track { display: block; height: 10px; border-radius: 100px; background: var(--muted); overflow: hidden; }
.story .fill { display: block; height: 100%; border-radius: 100px; background: var(--accent); }
.story .val { font: 600 0.95rem/1 var(--display); color: var(--text); }

.story .logos { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.story .logo { padding: 0.6rem 1.1rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: 600 var(--step-0)/1 var(--display); color: var(--text); }

.story__original { margin-top: 1.5rem; max-width: 52rem; }
.story__gallery { padding: 0 1.25rem 1.25rem; }
/* One reading column for studio posts: header, caption, slides and footer line up */
.post__head, .post .post__body, .post__foot, .post .story, .post .story__original, .post .watch, .post .watch-notice { max-width: 52rem; margin-inline: auto; }
.post .gallery { margin-inline: auto; }

/* ---------- Home ---------- */
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--strong); color: var(--text); }
.v4-hero { position: relative; overflow: hidden; color: var(--text-2); padding-top: calc(4.25rem + var(--safe-top)); }
.v4-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 3rem 3rem; mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 75%); pointer-events: none; }
.v4-hero__grid { position: relative; display: grid; gap: 1rem; padding-block: 3.5rem 2rem; }
.v4-prompt { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 1.5rem; font: 500 0.9375rem/1 var(--mono); color: var(--text); }
.v4-prompt span:first-child { color: var(--accent-bright); }
.v4-caret { width: 0.6em; height: 1.1em; background: var(--accent-bright); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .v4-caret { animation: none; } }
.v4-title { font-size: clamp(2.5rem, 1.3rem + 4.6vw, 5.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--text); margin: 0; }
.v4-title .serif { color: var(--accent-bright); }
.v4-sub { margin: 1.25rem 0 0; max-width: 34rem; font-size: var(--step-1); font-weight: 600; line-height: 1.4; color: var(--accent-bright); }
.v4-sub + .v4-lede { margin-top: 0.75rem; }
.v4-lede { margin: 1.5rem 0 0; max-width: 34rem; font-size: var(--step-1); line-height: 1.55; color: var(--text-2); }
.v4-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.v4-stack li { padding: 0.3rem 0.6rem; border: 1px solid var(--line-2); border-radius: 4px; font: 500 0.8125rem/1.3 var(--mono); color: var(--text-2); }
.v4-stack li:first-child { border-color: var(--accent-bright); color: var(--accent); }
.v4-hero .btn--wa .icon { color: var(--wa); }
/* Phones: keep both hero buttons side by side on one line */
@media (max-width: 599px) {
	.v4-hero .actions { flex-wrap: nowrap; gap: 0.5rem; }
	.v4-hero .actions .btn { flex: 1 1 0; min-width: 0; min-height: 52px; padding-inline: 0.75rem; gap: 0.4rem; font-size: 0.9375rem; white-space: nowrap; }
}
.v4-hero__visual { position: relative; min-height: 20rem; }
.v4-hero__visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.v4-ticker { position: relative; border-top: 1px solid var(--line); }
.v4-ticker__row { display: grid; grid-template-columns: repeat(2, 1fr); }
.v4-ticker p { margin: 0; padding: 1.25rem 0; font: 700 var(--step-2)/1 var(--display); letter-spacing: -0.03em; color: var(--text); }
.v4-ticker small { display: block; margin-top: 0.4rem; font: 400 0.8125rem/1.3 var(--sans); letter-spacing: 0; color: var(--text-2); }
@media (min-width: 1000px) {
	.v4-hero { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; }
	.v4-hero__grid { grid-template-columns: 1.1fr 1fr; align-items: center; padding-block: 4rem; }
	/* Headline scales with viewport height too, so the copy fits short screens */
	.v4-title { font-size: clamp(2.5rem, 1.3rem + 4.6vw, min(5.5rem, 9.5vh)); font-size: clamp(2.5rem, 1.3rem + 4.6vw, min(5.5rem, 9.5svh)); }
	/* 3D scene: anchored to the top of the hero and sized to the visible screen, so it is never cut off below the fold */
	.v4-hero__visual { align-self: start; position: sticky; top: calc(4.25rem + var(--safe-top) + 1rem); min-height: 0; height: clamp(22rem, 100vh - 12rem, 38rem); height: clamp(22rem, 100svh - 12rem, 38rem); }
	.v4-ticker__row { grid-template-columns: repeat(4, 1fr); }
	.v4-ticker p + p { padding-left: 1.5rem; border-left: 1px solid var(--line); }
}

/* ---------- Dev windows (partials/devwin.php, typed by site.js) ---------- */
.devwin { position: relative; container-type: inline-size; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #0D0D10; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02) inset; }
.devwin__bar { display: flex; align-items: center; gap: 0.75rem; min-height: 38px; padding: 0 0.9rem; border-bottom: 1px solid var(--line); background: var(--muted); font: 400 0.75rem/1 var(--mono); color: var(--text-3); }
.devwin__dots { display: inline-flex; gap: 6px; }
.devwin__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3F3F46; }
.devwin__dots i:first-child { background: #F87171; }
.devwin__dots i:nth-child(2) { background: #FBBF24; }
.devwin__dots i:nth-child(3) { background: #4ADE80; }
.devwin__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.devwin__meta { flex: none; margin-left: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); }
.devwin__meta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 8px #4ADE80; }
.devwin__body { display: grid; }
@media (max-width: 480px) { .devwin__code { font-size: 0.75rem; } .devwin__meta { display: none; } }
.devwin__code { margin: 0; padding: 1rem 1rem 1.25rem; overflow: hidden; font: 400 0.8125rem/1.75 var(--mono); color: #D4D4D8; tab-size: 4; counter-reset: ln; }
.devwin__line { display: block; min-height: 1.75em; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 2ch; text-indent: -2ch; }
.devwin__line.is-pending { visibility: hidden; }
.devwin__line.is-active::after { content: ""; display: inline-block; width: 0.55em; height: 1.1em; margin-left: 1px; vertical-align: -0.2em; background: var(--accent-bright); animation: caret 1s steps(1) infinite; }
.devwin--editor .devwin__line { counter-increment: ln; padding-left: 4.5ch; text-indent: -4.5ch; }
.devwin--editor .devwin__line::before { content: counter(ln); display: inline-block; width: 3ch; margin-right: 1.5ch; text-indent: 0; text-align: right; color: #52525B; }
.devwin--terminal .devwin__code { color: #A1A1AA; }

/* Syntax colours */
.devwin .k { color: #FB923C; }
.devwin .s { color: #86EFAC; }
.devwin .c { color: #71717A; font-style: italic; }
.devwin .f { color: #93C5FD; }
.devwin .n { color: #FCA5A5; }
.devwin .v { color: #F0ABFC; }
.devwin .p { color: var(--accent-bright); font-weight: 500; }
.devwin .ok { color: #4ADE80; }
.devwin .w { color: #FAFAFA; }

/* Design window: CSS on the left, a live preview restyled line by line */
.devwin__preview { display: grid; place-items: center; min-height: 14rem; padding: 1.5rem; border-top: 1px solid var(--line); background: radial-gradient(circle, #1A1A1F 1px, transparent 1px) 0 0 / 16px 16px, #0B0B0E; }
@container (min-width: 760px) {
	.devwin--design .devwin__body { grid-template-columns: 1.2fr 1fr; }
	.devwin--design .devwin__preview { border-top: 0; border-left: 1px solid var(--line); }
}
.pv-card, .pv-slide, .pv-btn { transition: all .45s var(--ease); }
.pv-card { width: 100%; max-width: 15rem; padding: var(--p-pad, 0.75rem); border: var(--p-border, 1px dashed #3F3F46); border-radius: var(--p-radius, 0); background: var(--p-bg, transparent); box-shadow: var(--p-shadow, none); font-family: var(--sans); }
.pv-card__img { height: 6.5rem; border-radius: calc(var(--p-radius, 0px) * .6); background: var(--p-img, #27272A); transition: inherit; }
.pv-card__name { margin: 0.75rem 0 0.2rem; font: 600 var(--p-size, 0.875rem)/1.2 var(--display); color: var(--p-color, #A1A1AA); transition: inherit; }
.pv-card__price { margin: 0 0 0.75rem; font-size: 0.8125rem; color: #A1A1AA; }
.pv-btn { display: block; width: 100%; padding: 0.6rem; border: 0; border-radius: var(--p-btn-radius, 0); background: var(--p-btn, #3F3F46); color: #fff; font: 600 0.8125rem/1 var(--sans); text-align: center; }
.pv-slide { position: relative; display: grid; align-content: end; gap: 0.5rem; width: 100%; max-width: 15rem; aspect-ratio: 1; padding: 1.25rem; border: var(--p-border, 1px dashed #3F3F46); border-top: var(--p-top, 1px dashed #3F3F46); border-radius: var(--p-radius, 0); background: var(--p-bg, transparent); box-shadow: var(--p-shadow, none); overflow: hidden; }
.pv-slide__kicker { font: 500 0.6875rem/1 var(--mono); color: var(--p-accent, #71717A); text-transform: uppercase; transition: inherit; }
.pv-slide__title { margin: 0; font: 700 var(--p-size, 1rem)/1.05 var(--display); letter-spacing: -0.03em; color: var(--p-color, #A1A1AA); transition: inherit; }
.pv-slide__title b { color: var(--p-accent, inherit); font-weight: inherit; transition: inherit; }

/* Section layouts that hold windows */
.desk { display: grid; gap: 1.25rem; }
@media (min-width: 1000px) { .desk { grid-template-columns: 1fr 1fr; align-items: start; } }
.split { display: grid; gap: 2.5rem; align-items: center; }
.split__copy p { margin: 0 0 1rem; }
.split__copy .sec-title { margin-bottom: 0.4em; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.25fr; gap: 4rem; } .split--flip > :first-child { order: 2; } }
