/* TechCore design system — graphite and gold, editorial and architectural.
   Tokens first, then base, layout, components, sections and responsive rules. */

@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("../fonts/michroma-400.woff2") format("woff2"); font-display: swap; }

:root {
  /* Colour */
  --bg: #08090b;
  --surface: #0f1114;
  --surface-2: #15181c;
  --surface-3: #1c2025;
  --line: rgba(242, 236, 222, .11);
  --line-strong: rgba(242, 236, 222, .22);
  --text: #f2eee6;
  --text-2: #bdb8ae;
  --muted: #8f8b82;
  --gold: #d6a84f;
  --gold-bright: #f3d48a;
  --gold-deep: #8a5f1f;
  --gold-tint: rgba(214, 168, 79, .12);
  --ice: #9cc7e0;
  --success: #8dbf86;
  --warning: #e3b55b;
  --danger: #ef8f80;
  --gold-gradient: linear-gradient(135deg, #f6dc98 0%, #d6a84f 50%, #9b6c27 100%);

  /* Type */
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Michroma", var(--sans);
  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.4rem, 1.2rem + .8vw, 1.75rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.4vw, 5.1rem);

  /* Space and shape */
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 9vw, 128px);
  --radius: 4px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: var(--step-0); line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 500; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: -.05em; line-height: 1; }
h2 { font-size: var(--step-3); }
h3, .h3-size { font-size: var(--step-2); letter-spacing: -.025em; line-height: 1.2; }
p { margin: 0 0 1em; }
::selection { background: var(--gold); color: #120f09; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.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; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 50; background: var(--gold); color: #120f09; padding: 10px 16px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.serif-accent { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--gold-bright); }
.lead { font-size: var(--step-1); color: var(--text-2); max-width: 62ch; line-height: 1.6; }

.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 20px;
  font: var(--step--1)/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.eyebrow-line { display: inline-block; width: 28px; height: 1px; background: currentColor; }

/* ---------- Buttons and links ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 48px; padding: 0 22px;
  font-size: .875rem; font-weight: 600; letter-spacing: .01em; border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.button-primary { background: var(--gold-gradient); color: #140f07; }
.button-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-outline { border-color: rgba(214, 168, 79, .55); color: var(--text); background: transparent; }
.button-outline:hover { border-color: var(--gold-bright); background: var(--gold-tint); }
.button-block { width: 100%; margin-top: 12px; }
.text-link { display: inline-flex; gap: 10px; font-size: .9rem; color: var(--text-2); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.text-link span { color: var(--gold); }
.text-link:hover { color: var(--text); border-bottom-color: var(--gold); }

/* ---------- Header ---------- */
.announcement { background: var(--gold-tint); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--gold-bright); }
.announcement p { margin: 0; padding: 8px 0; text-align: center; }
.site-header {
  position: sticky; top: 0; z-index: 30; background: rgba(8, 9, 11, .86);
  backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line);
}
.header-inner { min-height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 58px; height: 40px; object-fit: contain; }
.brand-word {
  font: 400 1rem/1 var(--display); letter-spacing: .16em;
  background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-o { position: relative; }
.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.site-nav ul a { font-size: .875rem; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.site-nav ul a:hover { color: var(--text); }
.site-nav ul a[aria-current="page"] { color: var(--gold-bright); border-bottom-color: var(--gold); }
.nav-cta { min-height: 40px; padding: 0 16px; font-size: .8125rem; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); background: transparent; border-radius: var(--radius); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 1.5px; background: var(--text); margin: auto; position: relative; transition: transform .25s var(--ease), background .2s; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 32px; min-height: min(78vh, 720px); padding-block: 56px 72px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -10% auto auto -20%; width: 620px; height: 620px; pointer-events: none;
  background: radial-gradient(circle, rgba(214, 168, 79, .1), transparent 65%);
}
.hero-copy, .hero-art { position: relative; min-width: 0; }
.hero-intro { max-width: 46ch; color: var(--text-2); font-size: var(--step-1); margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.hero-art { margin: 0; }
.circuit { width: 100%; overflow: visible; }
.circuit .grid-lines path { stroke: rgba(242, 236, 222, .045); stroke-width: 1; fill: none; }
.circuit .traces path { fill: none; stroke: rgba(214, 168, 79, .5); stroke-width: 1.5; }
.circuit .traces-flow path { stroke: var(--gold-bright); stroke-width: 2; stroke-dasharray: 14 220; animation: flow 4.5s linear infinite; }
.circuit .traces-flow path:nth-child(2) { animation-delay: -1.5s; }
.circuit .traces-flow path:nth-child(3) { animation-delay: -3s; }
.circuit .nodes circle { fill: var(--bg); stroke: var(--gold); stroke-width: 1.5; }
.circuit .node-labels text, .circuit .coord { font: 10px var(--mono); letter-spacing: .14em; fill: var(--muted); }
.circuit .orbit ellipse { fill: none; stroke: rgba(156, 199, 224, .18); stroke-dasharray: 3 6; }
.circuit .core { transform-origin: 350px 240px; animation: pulse 6s ease-in-out infinite; }
@keyframes flow { to { stroke-dashoffset: -234; } }
@keyframes pulse { 50% { transform: scale(1.06); filter: drop-shadow(0 0 18px rgba(243, 212, 138, .55)); } }

.intro-band {
  display: grid; grid-template-columns: 1fr 2.4fr 1fr; align-items: center; gap: 32px;
  padding-block: 64px; border-block: 1px solid var(--line);
}
.intro-band .eyebrow { margin: 0; }
.intro-statement { margin: 0; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); line-height: 1.3; letter-spacing: -.03em; }
.intro-statement em { font-family: var(--serif); color: var(--gold-bright); font-size: 1.12em; }
.intro-aside { margin: 0; text-align: right; font: var(--step--1)/1.8 var(--mono); color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-tight { padding-block: 32px var(--section); }
.section-tint { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; }
.section-heading h2 { margin: 0; }
.heading-note { max-width: 34ch; color: var(--muted); font-size: .9375rem; margin: 0; }
.section-more { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; }
.section-subtitle { margin-bottom: 28px; }

.page-hero { padding-block: clamp(48px, 7vw, 96px) 40px; }
.page-hero h1 { max-width: 18ch; }
.article-hero h1 { max-width: 24ch; font-size: var(--step-3); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; font: var(--step--1) var(--mono); color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.breadcrumbs a:hover { color: var(--gold-bright); }
.byline { font: var(--step--1) var(--mono); color: var(--muted); letter-spacing: .04em; }

/* ---------- Disciplines ---------- */
.discipline-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.discipline-card { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.discipline-card a { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 300px; padding: 32px; transition: background .3s var(--ease); }
.discipline-card a::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--gold-gradient); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.discipline-card a:hover { background: var(--surface); }
.discipline-card a:hover::after { transform: scaleX(1); }
.discipline-card h3, .discipline-card h2 { margin-top: auto; padding-top: 40px; font-size: 1.3rem; }
.discipline-card p { color: var(--text-2); font-size: .9375rem; }
.card-index { font: var(--step--1) var(--mono); color: var(--muted); }
.discipline-code { position: absolute; top: 28px; right: 32px; font: 1.1rem var(--display); letter-spacing: .1em; color: var(--gold); opacity: .8; }

.maturity, .availability, .stage {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 4px 10px;
  font: 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 99px;
}
.maturity::before, .availability::before, .stage::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.maturity-established, .availability-available, .stage-completed { color: var(--success); }
.maturity-developing, .availability-limited, .stage-in_development { color: var(--gold-bright); }
.maturity-exploratory, .availability-planned, .stage-planned { color: var(--ice); }
.stage-experimental { color: #c9a8ef; }

/* ---------- Cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project-card-large { grid-column: span 2; grid-row: span 2; }
.template-grid, .article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.promo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s var(--ease), transform .3s var(--ease); }
.card:hover { border-color: rgba(214, 168, 79, .45); transform: translateY(-3px); }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.project-card-large .card-media { aspect-ratio: auto; flex: 1; min-height: 320px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-media .stage { position: absolute; left: 16px; top: 16px; background: rgba(8, 9, 11, .8); backdrop-filter: blur(6px); }
.card-placeholder { display: grid; place-items: center; height: 100%; background: radial-gradient(circle at 70% 30%, var(--gold-tint), transparent 60%), var(--surface-2); }
.card-placeholder span { font: 2rem var(--display); color: var(--gold); letter-spacing: .1em; }
.card-body { padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 0 0 6px; font: 11px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 1.25rem; margin: 0 0 6px; }
.card-text { color: var(--text-2); font-size: .9375rem; margin: 0; }
.card-more { margin-top: auto; padding-top: 20px; font-size: .875rem; color: var(--gold); }
.article-card .card-link { padding: 28px; }
.demo-badge { display: inline-block; width: fit-content; margin-top: 12px; padding: 2px 8px; font: 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--warning); border: 1px dashed currentColor; border-radius: 2px; }

.template-media { aspect-ratio: 16 / 11; }
.template-wire { position: relative; height: 100%; padding: 18px; display: grid; grid-template-rows: 10px 1fr 26px; gap: 12px; background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); }
.template-wire i { display: block; border-radius: 2px; background: rgba(242, 236, 222, .07); }
.template-wire i:first-child { width: 60%; }
.template-wire i:nth-child(2) { background: radial-gradient(circle at 75% 40%, rgba(214, 168, 79, .28), transparent 55%), rgba(242, 236, 222, .04); }
.template-wire i:nth-child(3) { width: 35%; background: var(--gold-gradient); opacity: .7; }
.template-wire b { position: absolute; right: 18px; top: 14px; width: 32px; height: 12px; border: 1px solid var(--line-strong); border-radius: 2px; }
.template-wire-large { min-height: 420px; border-radius: var(--radius); }

.promo-card .card-link { flex-direction: row; gap: 20px; padding: 22px; align-items: flex-start; }
.promo-image { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); flex: none; }
.promo-label { display: inline-block; padding: 1px 7px; border: 1px solid rgba(214, 168, 79, .5); border-radius: 2px; color: var(--gold); font: 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Approach ---------- */
.approach { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.approach-visual { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; display: grid; place-items: center; }
.ring { position: absolute; border-radius: 50%; border: 1px solid var(--line-strong); }
.ring-outer { inset: 0; border-style: dashed; animation: spin 80s linear infinite; }
.ring-inner { inset: 18%; border-color: rgba(214, 168, 79, .4); }
.approach-symbol { font-size: 4rem; color: var(--gold-bright); text-shadow: 0 0 40px rgba(214, 168, 79, .5); }
.approach-caption { position: absolute; font: 11px var(--mono); letter-spacing: .16em; color: var(--muted); background: var(--bg); padding: 4px 8px; }
.cap-1 { top: 6%; left: 50%; transform: translateX(-50%); } .cap-2 { bottom: 20%; left: -2%; } .cap-3 { bottom: 20%; right: -2%; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { margin: 32px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps li > span { font: var(--step--1) var(--mono); color: var(--gold); padding-top: 4px; }
.steps h3 { font-size: 1.125rem; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--text-2); font-size: .9375rem; }

/* ---------- Services ---------- */
.service-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.service-list > li { border-bottom: 1px solid var(--line); }
.service-list > li:nth-child(odd) { border-right: 1px solid var(--line); }
.service-list a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 32px; transition: background .3s; }
.service-list a:hover { background: var(--surface); }
.service-list h3, .service-list h2 { margin: 0; font-size: 1.35rem; }
.service-list p { color: var(--text-2); margin: 0 0 8px; }
.service-list .availability { margin-top: auto; }

.process-band { margin-top: 64px; padding: clamp(28px, 4vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.process-band > p { color: var(--text-2); max-width: 60ch; }
.process-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 28px 0 32px; padding: 0; list-style: none; }
.process-steps b { display: block; font: var(--step--1) var(--mono); color: var(--gold); }
.process-steps span { display: block; font-weight: 600; margin: 6px 0; }
.process-steps p { margin: 0; color: var(--text-2); font-size: .9rem; }

/* ---------- Chips, filters, tabs ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip-list li, .chip-list a { font: 12px/1.5 var(--mono); color: var(--text-2); }
.chip-list > li { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 99px; }
.chip-list > li:has(a) { padding: 0; }
.chip-list a { display: block; padding: 4px 10px; border-radius: 99px; }
.chip-list a:hover, .chip-list a[aria-current] { color: var(--gold-bright); background: var(--gold-tint); }
.tag-cloud { margin-bottom: 24px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; font-size: .9rem; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--gold-bright); border-bottom-color: var(--gold); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.filter-bar input[type="search"] { flex: 1 1 260px; }
.filter-bar select { flex: 0 1 220px; }
.result-count { font: var(--step--1) var(--mono); color: var(--muted); }
.empty-state { padding: 64px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-2); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 48px; font: var(--step--1) var(--mono); color: var(--muted); }
.pagination a { color: var(--gold-bright); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--text); transition: border-color .2s, background .2s;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: rgba(242, 236, 222, .35); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: var(--surface-3); box-shadow: 0 0 0 3px rgba(214, 168, 79, .2); }
[aria-invalid="true"] { border-color: var(--danger); }
::placeholder { color: #6f6b64; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
label { display: block; margin-bottom: 8px; font-size: .875rem; font-weight: 500; color: var(--text-2); }
.field { margin-bottom: 22px; }
.field-error { margin: 8px 0 0; color: var(--danger); font-size: .875rem; }
.form-note { margin-top: 16px; font-size: .8125rem; color: var(--muted); }
.alert { padding: 14px 16px; margin-bottom: 24px; border-radius: var(--radius); border: 1px solid; font-size: .9375rem; }
.alert-success { border-color: rgba(141, 191, 134, .5); background: rgba(141, 191, 134, .08); color: #c9e6c5; }
.alert-error { border-color: rgba(239, 143, 128, .5); background: rgba(239, 143, 128, .08); color: #f6c4bc; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 14px 18px; border-left: 2px solid var(--warning); background: rgba(227, 181, 91, .07); color: #f0d9a8; font-size: .9375rem; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); padding-block: clamp(48px, 7vw, 96px) var(--section); align-items: start; }
.contact h1 { font-size: var(--step-3); }
.contact-points { margin: 40px 0 0; padding: 0; list-style: none; display: grid; gap: 20px; color: var(--text-2); }
.contact-points .eyebrow { margin-bottom: 4px; }
.contact-points a { color: var(--gold-bright); }
.contact-form { padding: clamp(24px, 4vw, 44px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.contact-form::before { content: ""; position: absolute; top: -1px; left: 24px; right: 24px; height: 1px; background: var(--gold-gradient); }

/* ---------- Detail pages ---------- */
.detail-cover { margin-block: 0 48px; }
.detail-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 6vw, 80px); padding-bottom: var(--section); align-items: start; }
.detail-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 28px; }
.aside-block { padding-top: 20px; border-top: 1px solid var(--line); }
.aside-title { font: 11px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.tick-list, .link-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--text-2); font-size: .9375rem; }
.tick-list li { padding-left: 22px; position: relative; }
.tick-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 1px; background: var(--gold); }
.link-list a { color: var(--gold-bright); }
.link-list a:hover { text-decoration: underline; }
.facts { margin: 0; display: grid; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts div { display: grid; gap: 4px; }
.facts dt { font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
.facts a { color: var(--gold-bright); }
.article-body { max-width: 760px; padding-bottom: var(--section); }

/* Long-form typography for Markdown rendered by the API */
.prose { color: var(--text-2); font-size: 1.0625rem; line-height: 1.75; }
.prose-long { font-size: 1.125rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { color: var(--text); font-size: 1.6rem; margin: 2em 0 .6em; }
.prose h3 { color: var(--text); font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose section:first-child h2, .prose > h2:first-child { margin-top: 0; }
.prose strong { color: var(--text); }
.prose a { color: var(--gold-bright); text-decoration: underline; text-decoration-color: rgba(214, 168, 79, .5); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--gold); color: var(--text); font-style: normal; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; color: var(--gold-bright); }
.prose pre { margin: 1.6em 0; padding: 20px 22px; overflow-x: auto; background: #0c0e11; border: 1px solid var(--line); border-radius: var(--radius); font-size: .875rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: #d9d4ca; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--text); font-weight: 600; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---------- CTA and footer ---------- */
.cta-band { padding-block: var(--section); background: radial-gradient(ellipse at 80% 20%, rgba(214, 168, 79, .12), transparent 55%), var(--surface); border-top: 1px solid var(--line); }
.cta-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; }
.cta-inner h2 { margin: 0; }

.site-footer { border-top: 1px solid var(--line); padding-top: 72px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 56px; }
.footer-brand p { margin-top: 20px; color: var(--muted); font-size: .9rem; max-width: 30ch; }
.footer-heading { font: 11px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: .9rem; color: var(--text-2); }
.footer-col a:hover { color: var(--gold-bright); }
.footer-promos { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 20px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--text-2); }
.footer-promos .eyebrow { margin: 0; }
.footer-promos a:hover { color: var(--gold-bright); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-block: 24px; border-top: 1px solid var(--line); font: var(--step--1) var(--mono); color: var(--muted); }
.back-top:hover { color: var(--gold-bright); }

.error-page { padding-block: clamp(80px, 12vw, 160px); text-align: center; }
.error-page .lead { margin-inline: auto; }
.error-page p:last-child { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 32px; }
.error-code { font: clamp(4rem, 12vw, 9rem)/1 var(--display); background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85; }

/* ---------- Reveal on scroll (enabled only by JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .site-nav { gap: 20px; }
  .site-nav ul { gap: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 40px; }
  .hero-art { max-width: 520px; width: 100%; margin-inline: auto; order: -1; }
  .intro-band { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .intro-aside { text-align: left; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 16px; }
  .discipline-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .template-grid, .article-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card-large { grid-column: span 2; grid-row: auto; }
  .approach, .contact, .cta-inner, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .approach-visual { max-width: 320px; margin-inline: auto; }
  .detail-aside { position: static; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }

  /* Collapsible navigation, only when JavaScript is available to toggle it. */
  .js .menu-toggle { display: grid; place-items: center; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%; display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 24px; background: rgba(8, 9, 11, .98); border-bottom: 1px solid var(--line);
  }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .js .nav-cta { margin-top: 20px; min-height: 48px; }
  /* Without JavaScript the navigation stays visible and wraps. */
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .site-nav { flex-wrap: wrap; gap: 12px; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; gap: 6px 18px; }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; }
  .brand-mark { width: 46px; height: 32px; }
  .brand-word { font-size: .85rem; }
  .discipline-grid, .project-grid, .template-grid, .article-grid, .promo-grid, .service-list { grid-template-columns: 1fr; }
  .project-card-large { grid-column: auto; }
  .service-list > li:nth-child(odd) { border-right: 0; }
  .discipline-card a { min-height: 0; padding: 24px; }
  .discipline-card h3, .discipline-card h2 { padding-top: 24px; }
  .process-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .steps li { grid-template-columns: 40px 1fr; }
  .hero-actions { gap: 20px; }
  .promo-card .card-link { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Admin preview banner on public templates */
.preview-bar { position: sticky; top: 0; z-index: 40; background: var(--warning); color: #1a1408; font-size: .875rem; }
.preview-bar p { margin: 0; padding: 10px 0; }
.preview-bar a { text-decoration: underline; font-weight: 600; margin-left: 8px; }

/* ---------- Header controls ordering ---------- */
.brand { order: 1; }
.site-nav { order: 2; margin-left: auto; }
.theme-toggle { order: 3; }
.menu-toggle { order: 4; }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text-2);
}
.theme-toggle:hover { color: var(--gold-bright); border-color: var(--gold); }
.theme-icon { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset -5px -3px 0 0 currentColor; }
[data-theme="light"] .theme-icon { box-shadow: none; background: currentColor; outline: 2px dotted currentColor; outline-offset: 3px; transform: scale(.7); }

/* ---------- WhatsApp ---------- */
.whatsapp-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 35; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px 12px 12px; border-radius: 99px; background: #1f9d55; color: #fff; font-weight: 600; font-size: .875rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .2s var(--ease), background .2s;
}
.whatsapp-float:hover { background: #188a49; transform: translateY(-2px); }

/* ---------- Testimonials ---------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.testimonial { margin: 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 18px; }
.testimonial blockquote { margin: 0; font-size: 1.0625rem; line-height: 1.65; color: var(--text); }
.testimonial blockquote p::before { content: "“"; font-family: var(--serif); font-size: 2.2em; line-height: 0; vertical-align: -.4em; margin-right: 4px; color: var(--gold); }
.testimonial figcaption { margin-top: auto; display: flex; gap: 12px; align-items: center; font-size: .875rem; }
.testimonial figcaption img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.rating { margin: 0; color: var(--gold-bright); letter-spacing: .15em; }
.rating-off { color: var(--line-strong); }

/* ---------- Contact quote fields ---------- */
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 24px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.kind-option { position: relative; margin: 0; cursor: pointer; }
.kind-option input { position: absolute; opacity: 0; }
.kind-option span { display: block; padding: 10px; text-align: center; border-radius: 3px; font-size: .875rem; color: var(--text-2); }
.kind-option input:checked + span { background: var(--gold-tint); color: var(--gold-bright); font-weight: 600; }
.kind-option input:focus-visible + span { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.quote-fields { margin: 0 0 22px; padding: 18px 18px 0; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.quote-fields legend { padding: 0 6px; font-size: .875rem; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Footer newsletter ---------- */
.footer-newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; align-items: center; padding-block: 28px; border-top: 1px solid var(--line); }
.footer-newsletter p { margin: 0; color: var(--muted); font-size: .9rem; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-form input { flex: 1; }
.newsletter-eyebrow { justify-content: center; }

@media (max-width: 920px) {
  .testimonial-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-newsletter { grid-template-columns: minmax(0, 1fr); }
  .js .theme-toggle { margin-left: auto; }
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .newsletter-form { flex-direction: column; }
  .whatsapp-label { display: none; }
  .whatsapp-float { padding: 12px; }
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --surface-3: #e9e5dc;
  --line: rgba(20, 22, 26, .12);
  --line-strong: rgba(20, 22, 26, .24);
  --text: #15171b;
  --text-2: #43464d;
  --muted: #64676e;
  --gold: #8a5d14;
  --gold-bright: #7a5210;
  --gold-tint: rgba(154, 106, 28, .1);
  --ice: #2c6a8d;
  --success: #2c7537;
  --warning: #8c5f00;
  --danger: #b0372a;
  color-scheme: light;
}
[data-theme="light"] .site-header { background: rgba(246, 244, 239, .9); }
[data-theme="light"] .brand-word { background: linear-gradient(135deg, #b8862f, #6f4a0e); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .brand-mark { filter: drop-shadow(0 0 1px rgba(0, 0, 0, .5)); }
[data-theme="light"] .card-media .stage { background: rgba(255, 255, 255, .9); }
[data-theme="light"] .circuit .grid-lines path { stroke: rgba(20, 22, 26, .06); }
[data-theme="light"] .circuit .shield-inner { fill: rgba(255, 255, 255, .7); }
[data-theme="light"] .circuit .traces-flow path { stroke: #b8862f; }
[data-theme="light"] .alert-success { color: #1f5a29; background: rgba(44, 117, 55, .08); }
[data-theme="light"] .alert-error { color: #8c2a1f; background: rgba(176, 55, 42, .07); }
[data-theme="light"] .notice { color: #6b4800; }
[data-theme="light"] .error-code, [data-theme="light"] .stat-value { background: linear-gradient(135deg, #b8862f, #6f4a0e); -webkit-background-clip: text; background-clip: text; }
@media (max-width: 920px) {
  .js[data-theme="light"] .site-nav { background: rgba(246, 244, 239, .98); }
}
