/* Layout: one centered column (max 1160px); sections alternate between page and band backgrounds.
   Light is the default. Dark only applies when the toggle sets data-theme="dark".
   Brand motif: the circuit traces and solder pads from the MAXVDL gear return in the hero backdrop,
   the section kickers, the process steps, the timeline and the case-study steps. */
:root {
  --bg: #f6f5f5;
  --surface: #ffffff;
  --band: #efecec;
  --fg: #1b1617;
  --muted: #625859;
  --line: #e2dbdb;
  --trace: #d4c7c7;
  --accent: #d42a2f;
  --accent-strong: #ae1d22;
  --accent-fg: #ffffff;
  --accent-soft: #fbe9e9;
  --ok: #2e9d4f;
  --shadow: 0 1px 2px rgb(27 22 23 / 0.04), 0 12px 32px -16px rgb(27 22 23 / 0.18);

  --font-display: "Saira", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --step-1: 1.25rem;
  --step-2: clamp(1.85rem, 1.35rem + 1.7vw, 2.6rem);
  --step-3: clamp(2.4rem, 1.5rem + 3.3vw, 4.25rem);

  --radius: 8px;
  --wrap: 1160px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #131011;
  --surface: #1c1718;
  --band: #181415;
  --fg: #f2ecec;
  --muted: #a99d9e;
  --line: #2f2728;
  --trace: #4a3c3d;
  --accent: #f0443f;
  --accent-strong: #ff6560;
  --accent-fg: #160e0f;
  --accent-soft: #2c1617;
  --ok: #3fbf68;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -16px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 30;
  height: env(safe-area-inset-top, 0px); background: var(--surface);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap {
  width: 100%; max-width: calc(var(--wrap) + 48px); margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
@media (max-width: 480px) {
  .wrap {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
}

.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }
.label {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted);
}
.kicker { display: inline-flex; align-items: center; gap: 0.6rem; }
.kicker::before { /* solder pad */
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  border: 2.5px solid var(--accent); flex: none;
}

/* Brand masks: the logo PNGs are masks, so they take any theme color */
.gear, .wordmark {
  display: block; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.gear { --src: url("assets/gear.svg"); aspect-ratio: 800 / 642; }
.wordmark { --src: url("assets/wordmark.svg"); aspect-ratio: 587.4 / 100; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; cursor: pointer;
  font: 600 0.9375rem/1 var(--font-body); padding: 0.95rem 1.35rem; border-radius: var(--radius);
  border: 1.5px solid var(--fg); color: var(--fg); background: transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-fg); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font: 500 0.75rem/1 var(--font-mono); padding: 0.45rem 0.6rem; border-radius: 4px;
  border: 1px solid var(--line); color: var(--fg); background: var(--surface);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 2rem; padding-block: 0.8rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--accent); flex: none; }
.brand .gear { width: 30px; color: var(--fg); transition: transform .5s ease; }
.brand:hover .gear { transform: rotate(-30deg); }
.brand .wordmark { width: 100px; }
.nav-links { display: flex; gap: 1.75rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav-links a {
  text-decoration: none; font-weight: 500; font-size: 0.9375rem; color: var(--muted);
  padding-block: 0.3rem; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--fg); border-bottom-color: var(--accent); }
.nav-tools { display: flex; gap: 0.5rem; }
.tool {
  font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.06em; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  min-width: 2.5rem; height: 2.375rem; padding: 0 0.65rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.tool:hover { border-color: var(--fg); }
.tool svg { width: 16px; height: 16px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.menu-toggle { display: none; }
@media (prefers-reduced-motion: reduce) { .brand .gear { transition: none; } }

@media (max-width: 860px) {
  .nav { gap: 1rem; }
  .nav-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 0.5rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px));
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; color: var(--fg); }
  .nav-links li:last-child a { border-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(3.5rem, 8vw, 6.5rem); background: var(--surface); }
.hero-traces {
  position: absolute; right: -20px; top: 24px; width: min(58vw, 780px); height: auto;
  color: var(--trace); pointer-events: none;
}
.hero-traces circle { fill: var(--surface); stroke-width: 3; }
.hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.65rem; margin-bottom: 1.5rem;
  font: 500 0.75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.eyebrow .gear { width: 22px; color: var(--accent); }
.hero h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.015em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .intro { margin-top: 1.5rem; font-size: 1.1875rem; line-height: 1.6; color: var(--muted); max-width: 58ch; }
.hero .intro strong { color: var(--fg); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

.datasheet { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.datasheet header { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); }
.datasheet dl { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.datasheet dt, .datasheet dd { padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); margin: 0; }
.datasheet dt { font: 500 0.75rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding-top: 0.95rem; }
.datasheet dd { font-weight: 500; }
.datasheet dl > :nth-last-child(-n+2) { border-bottom: 0; }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  margin-right: 0.5rem; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

.tools-row {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem;
  margin-top: clamp(3rem, 6vw, 4.5rem); padding-block: 1.4rem; border-top: 1px solid var(--line);
}
.tool-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; list-style: none; margin: 0; padding: 0; font: 500 0.875rem var(--font-mono); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-traces { display: none; }
}

/* ---------- Now strip ---------- */
.now-strip { background: var(--fg); color: var(--bg); }
.now-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-block: 1.05rem; }
.now-pill {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem; border-radius: 999px;
  font: 500 0.75rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em;
  border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.now-inner p { flex: 1; min-width: min(100%, 18rem); color: color-mix(in srgb, var(--bg) 78%, transparent); }
.now-inner p strong { color: var(--bg); font-weight: 600; }
.arrow-link { color: var(--bg); font-weight: 600; font-size: 0.9375rem; text-underline-offset: 4px; }

/* ---------- Sections ---------- */
section.block { padding-block: clamp(4rem, 8vw, 7rem); }
.band { background: var(--band); }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem 4rem;
  align-items: end; margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.section-head h2 { font-size: var(--step-2); font-weight: 700; margin-top: 0.8rem; letter-spacing: -0.01em; }
.section-head > p { color: var(--muted); max-width: 56ch; font-size: 1.0625rem; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- What I do ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.pillar {
  display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.pillar-icon { width: 54px; height: 54px; padding: 11px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.pillar-icon svg { width: 100%; height: 100%; display: block; }
.pillar h3 { font-size: 1.375rem; font-weight: 600; }
.pillar > p { color: var(--muted); }
.pillar .examples { margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: 0.875rem; color: var(--muted); }
.pillar .examples a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 980px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .projects { grid-template-columns: 1fr; } }
.project {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.project:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .project, .project:hover { transition: none; transform: none; } }
.project-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.2rem 1.25rem 1.35rem; flex: 1; }
.project-meta { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--muted); }
.project h3 { font-size: var(--step-1); font-weight: 600; }
.project p { color: var(--muted); font-size: 0.9375rem; }
.project .chips { margin-top: auto; padding-top: 0.6rem; }
.project .more { font-weight: 600; font-size: 0.875rem; color: var(--accent); }
.project:hover .more { text-decoration: underline; text-underline-offset: 3px; }

/* Covers: dot grid + line icon in a pad, same family as the logo's gear */
.cover {
  position: relative; display: grid; place-items: center; max-width: 100%;
  background-color: var(--bg); color: var(--accent);
  background-image: radial-gradient(var(--trace) 1px, transparent 1.4px);
  background-size: 18px 18px; background-position: 9px 9px;
}
.project .cover { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); }
.cover-icon {
  width: 26%; max-width: 104px; padding: 6%; box-sizing: content-box;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
  transition: border-color .2s;
}
.project:hover .cover-icon { border-color: var(--accent); }
.cover-label {
  position: absolute; left: 0.9rem; bottom: 0.8rem; padding: 0.4rem 0.55rem;
  font: 500 0.6875rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- How I work ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; position: relative; }
.steps::before { content: ""; position: absolute; top: 10px; left: 10px; right: 10px; height: 2px; background: var(--trace); }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  content: ""; position: absolute; top: 0; left: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.step-num { font: 600 0.75rem/1 var(--font-mono); letter-spacing: 0.12em; color: var(--accent); }
.step h3 { font-size: 1.3rem; font-weight: 600; margin: 0.5rem 0 0.55rem; }
.step p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 1.75rem; }
  .steps::before { top: 10px; bottom: 10px; left: 10px; right: auto; width: 2px; height: auto; }
  .step { padding-top: 0; padding-left: 2.75rem; }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.about-text { display: grid; gap: 1.15rem; font-size: 1.0625rem; max-width: 62ch; align-content: start; }
.about-side { display: grid; gap: 1rem; align-content: start; }
.fact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.fact-card h3 { font: 600 0.9375rem/1.3 var(--font-body); margin-bottom: 0.7rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.plain-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: 0.45rem; }
.plain-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.plain-list li span:last-child { color: var(--muted); text-align: right; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Experience: circuit trace ---------- */
.trace { list-style: none; margin: 0; padding: 0; position: relative; }
.trace::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--trace); }
.trace li {
  position: relative; padding-left: 2.75rem; padding-bottom: 2.25rem;
  display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 0.25rem 2rem;
}
.trace li:last-child { padding-bottom: 0; }
.trace li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--trace);
}
.trace li::after { content: ""; position: absolute; left: 16px; top: 11px; width: 18px; height: 2px; background: var(--trace); }
.trace li.is-work::before { border-color: var(--accent); }
.trace li.is-now::before { background: var(--accent); border-color: var(--accent); }
.trace .when { color: var(--muted); padding-top: 0.1rem; font-variant-numeric: tabular-nums; }
.trace h3 { font-size: 1.15rem; font-weight: 600; }
.trace .org { color: var(--muted); font-size: 0.9375rem; }
.trace .desc { margin-top: 0.45rem; max-width: 64ch; }
.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--trace); display: inline-block; }
.legend i.w { border-color: var(--accent); }
@media (max-width: 620px) { .trace li { grid-template-columns: 1fr; } }

/* ---------- Contact band ---------- */
.contact-band { background: var(--accent); color: var(--accent-fg); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contact-band .label { color: color-mix(in srgb, var(--accent-fg) 80%, transparent); }
.contact-band .kicker::before { border-color: var(--accent-fg); }
.contact h2 { font-size: var(--step-3); font-weight: 700; margin-top: 0.8rem; letter-spacing: -0.015em; }
.contact .lead { margin-top: 1rem; font-size: 1.125rem; max-width: 42ch; color: color-mix(in srgb, var(--accent-fg) 88%, transparent); }
.contact-lines { display: grid; gap: 0.85rem; margin-top: 2.25rem; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.85rem; }
.contact-line .label { width: 6.5rem; }
.contact-line .value { font-weight: 600; font-size: 1.0625rem; word-break: break-all; color: inherit; }
.contact-line .value[id] { user-select: all; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  font: 600 0.875rem var(--font-body); text-decoration: underline; text-underline-offset: 3px;
}
form {
  display: grid; gap: 1rem; background: var(--surface); color: var(--fg);
  border-radius: calc(var(--radius) + 4px); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow);
}
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.875rem; }
.field input, .field textarea {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.75rem 0.9rem; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field textarea { min-height: 9rem; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-status { font-size: 0.9375rem; color: var(--muted); min-height: 1.5em; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(3rem, 6vw, 4rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 2rem 4rem; align-items: center; }
.footer-lockup { display: block; width: 100%; max-width: 300px; text-decoration: none; }
.footer-lockup img { display: block; width: 100%; height: auto; }
.footer-lockup .logo-dark { display: none; }
:root[data-theme="dark"] .footer-lockup .logo-light { display: none; }
:root[data-theme="dark"] .footer-lockup .logo-dark { display: block; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: flex-end; }
.footer-nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.footer-nav a:hover { color: var(--fg); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.8125rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
  .footer-lockup { max-width: 220px; }
}

/* ---------- Case study ---------- */
.case { padding-block: clamp(2rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem); }
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none;
  font-weight: 600; font-size: 0.9375rem; color: var(--muted);
}
.back-link:hover { color: var(--accent); }
.case-top { display: grid; gap: 1.1rem; margin-top: 2rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.case-top .eyebrow { margin: 0; }
.case h1 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.015em; line-height: 1.04; max-width: 20ch; }
.case-lead { font-size: 1.1875rem; color: var(--muted); max-width: 62ch; }
.case-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.case-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0.75rem 0 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.case-meta > div { padding: 1rem 1.2rem; border-left: 1px solid var(--line); min-width: 0; }
.case-meta > div:first-child { border-left: 0; }
.case-meta dt { font: 500 0.6875rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.case-meta dd { margin: 0.4rem 0 0; font-weight: 500; }
.case-meta .chips { margin-top: 0.1rem; }
.case-cover { aspect-ratio: 21 / 8; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: clamp(1rem, 3vw, 2rem); }
.case-cover .cover-icon { width: clamp(64px, 10vw, 120px); max-width: none; padding: clamp(18px, 2.5vw, 30px); }
.case-section {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 0.75rem 3rem;
  padding-block: clamp(1.75rem, 3vw, 2.5rem); border-top: 1px solid var(--line);
}
.case-section h2 { font-size: 1.35rem; font-weight: 600; }
.case-content { display: grid; gap: 1.1rem; max-width: 66ch; font-size: 1.0625rem; }
.case-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.15rem; position: relative; }
.case-steps::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: var(--trace); }
.case-steps li { position: relative; padding-left: 2.4rem; }
.case-steps li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.checks li { position: relative; padding-left: 2rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft);
}
.checks li::after {
  content: ""; position: absolute; left: 7px; top: calc(0.2em + 4px); width: 5px; height: 10px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
.case-nav a {
  display: grid; gap: 0.3rem; padding: 1.15rem 1.3rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s;
}
.case-nav a:hover { border-color: var(--accent); }
.case-nav .next { text-align: right; }
.case-nav strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
@media (max-width: 860px) {
  .case-meta { grid-template-columns: 1fr 1fr; }
  .case-meta > div { border-left: 0; border-top: 1px solid var(--line); }
  .case-meta > div:nth-child(-n+2) { border-top: 0; }
  .case-meta > div:nth-child(even) { border-left: 1px solid var(--line); }
  .case-section { grid-template-columns: 1fr; }
  .case-cover { aspect-ratio: 16 / 9; }
}
@media (max-width: 520px) { .case-nav { grid-template-columns: 1fr; } .case-nav .next { text-align: left; } }

/* ---------- Test site label (only on maxvdl.nl) ---------- */
.is-test body::after {
  content: "TESTOMGEVING · maxvdl.nl"; position: fixed; z-index: 50;
  left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px));
  font: 600 0.6875rem/1 var(--font-mono); letter-spacing: 0.12em; padding: 0.55rem 0.75rem; border-radius: 6px;
  background: var(--fg); color: var(--bg); box-shadow: var(--shadow); pointer-events: none;
}
