/* ==========================================================================
   TAC Architects — tac.net.vn
   One family (Be Vietnam Pro), forest-green palette, light/dark themes.
   Theme is resolved before paint by the inline script in each page's <head>
   and applied as html[data-theme="light" | "dark"].
   ========================================================================== */

:root {
  --forest: #14482d;
  --forest-deep: #0d3320;
  --leaf: #489262;
  --paper: #f5f7f4;
  --ink: #17211b;
  --concrete: #5f6b65;

  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: #e9eee9;
  --text: var(--ink);
  --muted: var(--concrete);
  --line: #cfd8d1;
  --line-strong: #9fb0a5;
  --primary: var(--forest);
  --primary-contrast: #ffffff;
  --link: #1d6a41;
  --band-bg: var(--forest);
  --band-text: #e8f1eb;
  --band-muted: #a9c7b4;
  --band-line: rgba(232, 241, 235, 0.22);
  --focus: #2f8a57;
  --img-dim: none;

  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: clamp(2.4rem, 5.2vw, 4.25rem);

  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4rem, 9vw, 7rem);
  --radius: 4px;
  --header-h: 72px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0e1712;
  --surface: #142019;
  --surface-2: #1b2a21;
  --text: #e4ebe6;
  --muted: #9aaba1;
  --line: #26372d;
  --line-strong: #3d5446;
  --primary: #7cc49a;
  --primary-contrast: #0b1a11;
  --link: #8fd2aa;
  --band-bg: #10301f;
  --band-text: #e4ebe6;
  --band-muted: #93b8a1;
  --band-line: rgba(228, 235, 230, 0.16);
  --focus: #8fd2aa;
  --img-dim: brightness(0.92);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'tnum' 1;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); letter-spacing: -0.03em; line-height: 1.06; }
h2 { font-size: clamp(1.75rem, 3.4vw, var(--step-4)); }
h3 { font-size: var(--step-1); letter-spacing: -0.005em; }
p { max-width: 68ch; text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Brand mark (alpha mask, coloured per theme) ---------- */
.mark {
  display: inline-block;
  aspect-ratio: 591 / 240;
  background: currentColor;
  -webkit-mask: url('../images/brand/tac-mark.png') center / contain no-repeat;
  mask: url('../images/brand/tac-mark.png') center / contain no-repeat;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  margin-right: auto;
}
.brand .mark { height: 26px; }
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line-strong);
}
.brand-name small { color: var(--muted); font-weight: 400; font-size: 0.75rem; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  position: relative;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
}
.nav a:hover { color: var(--primary); }
.nav a[aria-current="page"] { color: var(--primary); }
.nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.2rem;
  height: 2px;
  background: currentColor;
}

.tools { display: flex; align-items: center; gap: 0.5rem; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
}
.lang-switch button {
  border: 0;
  background: none;
  padding: 0.2rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  cursor: pointer;
  color: var(--text);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn [data-icon] { display: none; }
.theme-btn[data-mode="system"] [data-icon="system"],
.theme-btn[data-mode="light"] [data-icon="light"],
.theme-btn[data-mode="dark"] [data-icon="dark"] { display: block; }

.menu-btn { display: none; }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0.5rem var(--gutter) 1.25rem;
  background: var(--bg);
}
.mobile-nav a {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.mobile-nav a[aria-current="page"] { color: var(--primary); }
.site-header.is-open .mobile-nav { display: block; }

@media (max-width: 1080px) {
  .brand-name { display: none; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.btn:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
html[data-theme="dark"] .btn:hover { background: #9dd6b4; border-color: #9dd6b4; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--surface-2); border-color: var(--primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head p { color: var(--muted); }
.section-head .more { justify-self: end; align-self: end; white-space: nowrap; font-weight: 600; }
@media (max-width: 800px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head .more { justify-self: start; }
}

.lead { font-size: var(--step-1); line-height: 1.55; color: var(--text); }
.muted { color: var(--muted); }
.source-note { font-size: var(--step--1); color: var(--muted); margin-top: 1.25rem; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3rem, 7vw, 5.5rem); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.hero h1 { max-width: 17ch; color: var(--text); }
.hero .lead { margin-top: 1.5rem; max-width: 52ch; color: var(--muted); }
.hero .btn-row { margin-top: 2rem; }

/* Title block — the metadata panel found on every architectural drawing */
.title-block {
  border: 1.5px solid var(--text);
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.4;
}
.title-block .tb-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-bottom: 1.5px solid var(--text);
  color: var(--primary);
}
.title-block .tb-head .mark { height: 30px; flex: none; }
.title-block .tb-head strong { color: var(--text); font-size: 0.9375rem; line-height: 1.3; }
.title-block dl { display: grid; grid-template-columns: 1fr 1fr; }
.title-block dl > div {
  padding: 0.65rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line-strong);
}
.title-block dl > div:nth-child(odd) { border-right: 1px solid var(--line-strong); }
.title-block dl > div.full { grid-column: 1 / -1; border-right: 0; }
.title-block dl > div:last-child,
.title-block dl > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.title-block dt { color: var(--muted); font-size: 0.75rem; }
.title-block dd { font-weight: 600; color: var(--text); }

.hero-sketch {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  height: clamp(110px, 17vw, 210px);
  color: var(--primary);
  background: currentColor;
  -webkit-mask: url('../images/brand/hq-sketch.png') right bottom / contain no-repeat;
  mask: url('../images/brand/hq-sketch.png') right bottom / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-sketch { animation: draw-in 2.2s cubic-bezier(0.6, 0, 0.2, 1) 0.2s both; }
}
@keyframes draw-in {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0); }
}
.hero-sketch-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  font-size: var(--step--1);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
}

/* ---------- Services (ruled rows) ---------- */
.service-list { border-top: 1.5px solid var(--text); }
.service {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 0.7fr);
  gap: 1rem 2.5rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--line-strong);
}
.service h3 { font-size: var(--step-1); }
.service p { color: var(--muted); }
.service .grade { font-size: var(--step--1); color: var(--primary); font-weight: 600; }
@media (max-width: 800px) {
  .service { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------- Works mosaic (home) ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.works .work:first-child { grid-column: span 2; grid-row: span 2; }
.work { margin: 0; }
.work-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-2);
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--radius);
}
.work-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: var(--img-dim);
  transition: transform 400ms ease;
}
.works .work:first-child .work-media img { aspect-ratio: auto; height: 100%; min-height: 100%; }
.works .work:first-child .work-media { height: calc(100% - 4.5rem); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .work-media:hover img { transform: scale(1.025); }
}
.work figcaption { padding-top: 0.7rem; font-size: 0.9375rem; line-height: 1.45; }
.work figcaption strong { display: block; font-weight: 600; }
.work figcaption span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 800px) {
  .works { grid-template-columns: 1fr 1fr; }
  .works .work:first-child { grid-column: 1 / -1; grid-row: auto; }
  .works .work:first-child .work-media { height: auto; }
  .works .work:first-child .work-media img { aspect-ratio: 16 / 10; height: auto; }
}
@media (max-width: 520px) {
  .works { grid-template-columns: 1fr; }
}

/* ---------- Timeline ---------- */
.timeline { border-top: 1.5px solid var(--text); }
.timeline li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.timeline time { font-size: var(--step-2); font-weight: 700; color: var(--primary); line-height: 1.1; }
.timeline h3 { font-size: var(--step-0); font-weight: 600; margin-bottom: 0.2rem; }
.timeline p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ---------- Green band (laboratory) ---------- */
.band {
  background: var(--band-bg);
  color: var(--band-text);
  padding-block: var(--section);
}
.band h2, .band h3 { color: #fff; }
html[data-theme="dark"] .band h2, html[data-theme="dark"] .band h3 { color: var(--band-text); }
.band p { color: var(--band-muted); }
.band a:not(.btn) { color: #fff; }
.band .btn { background: #fff; border-color: #fff; color: var(--forest); }
.band .btn:hover { background: #dcebe1; border-color: #dcebe1; }
.band .btn-ghost { background: transparent; color: #fff; border-color: var(--band-line); }
.band .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; }
.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.band .lead { color: var(--band-text); margin-top: 1rem; }
.band .btn-row { margin-top: 2rem; }
.group-list { border-top: 1px solid var(--band-line); }
.group-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--band-line);
}
.group-list b { font-weight: 700; color: #fff; white-space: nowrap; }
html[data-theme="dark"] .group-list b { color: var(--band-text); }
@media (max-width: 900px) {
  .band-grid { grid-template-columns: 1fr; }
}

/* ---------- Awards ---------- */
.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem 1.5rem;
}
.award .work-media { background: var(--surface); border: 1px solid var(--line); padding: 0.75rem; }
.award .work-media img { aspect-ratio: 4 / 3; object-fit: contain; }
.award figcaption { padding-top: 0.75rem; font-size: 0.875rem; line-height: 1.5; }
.award time { display: block; font-weight: 700; color: var(--primary); font-size: var(--step-0); }

/* ---------- Split (image + text) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split img { border-radius: var(--radius); filter: var(--img-dim); }
.split .photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.split .photo-pair img { aspect-ratio: 4 / 3; object-fit: cover; }
.split .photo-pair img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.split h2 + p, .split p + p { margin-top: 1rem; }
.split blockquote {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary);
  font-size: var(--step-1);
  font-weight: 600;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  border-top: 1.5px solid var(--text);
  padding-top: 2rem;
}
.contact-list > div { padding-block: 0.9rem; border-bottom: 1px solid var(--line); }
.contact-list dt { font-size: var(--step--1); color: var(--muted); }
.contact-list dd { font-size: var(--step-1); font-weight: 600; }
.contact-list dd a { color: var(--text); text-decoration: none; }
.contact-list dd a:hover { color: var(--primary); text-decoration: underline; }
.contact-note { color: var(--muted); }
.contact-grid .btn-row { margin-top: 1.5rem; }
@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 20ch; }
.page-head .lead { margin-top: 1.25rem; color: var(--muted); max-width: 60ch; }
.page-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.page-head-meta div span { display: block; color: var(--muted); font-size: 0.8125rem; }
.page-head-meta div strong { font-weight: 600; }

.facts { border-top: 1.5px solid var(--text); }
.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 0.5rem 2rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--muted); font-size: 0.9375rem; }
.facts dd { font-weight: 500; }
@media (max-width: 640px) {
  .facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
}

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.person { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.person img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; filter: var(--img-dim); }
.person .initials {
  width: 96px; height: 96px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 700;
  font-size: var(--step-2);
}
.person h3 { font-size: var(--step-1); }
.person p { color: var(--muted); font-size: 0.9375rem; margin-top: 0.25rem; }

/* Licence table */
.table-wrap { overflow-x: auto; border-top: 1.5px solid var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.8rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
thead th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 600; }
td.grade { font-weight: 700; color: var(--primary); white-space: nowrap; }
td.code, td.std { white-space: nowrap; color: var(--muted); }
td.std { white-space: normal; min-width: 11rem; }
tr.group-row th {
  padding-top: 1.75rem;
  font-size: var(--step-0);
  color: var(--primary);
  border-bottom: 1.5px solid var(--line-strong);
}
.num { color: var(--muted); width: 2.5rem; }

/* Documents */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.doc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.doc h3 { font-size: var(--step-0); }
.doc p { color: var(--muted); font-size: 0.9375rem; }
.doc .doc-actions { margin-top: auto; padding-top: 0.75rem; display: flex; gap: 1.25rem; font-weight: 600; font-size: 0.9375rem; }

.cert-figure { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.cert-figure .work-media { border: 1px solid var(--line-strong); background: #fff; }
.cert-figure .work-media img { aspect-ratio: auto; object-fit: contain; filter: none; }
@media (max-width: 860px) { .cert-figure { grid-template-columns: 1fr; } }

.policy { counter-reset: p; border-top: 1.5px solid var(--text); }
.policy li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.policy li::before { content: counter(p); font-weight: 700; color: var(--primary); }

/* ---------- Projects page ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.filters button {
  border: 1px solid var(--line-strong);
  background: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.filters button:hover { border-color: var(--primary); color: var(--primary); }
.filters button[aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.filters button span { opacity: 0.7; margin-left: 0.3rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem 1.5rem;
}
.gallery .work figcaption span { display: block; }

.research-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem 2rem; }
.research-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 1rem; align-items: start; }
.research-item img { width: 84px; border: 1px solid var(--line); filter: var(--img-dim); }
.research-item p { font-size: 0.9375rem; }
.research-item time { color: var(--muted); font-size: var(--step--1); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1200px, 94vw);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(6, 14, 9, 0.88); }
.lightbox figure { margin: 0; display: grid; gap: 0.75rem; justify-items: center; }
.lightbox img { max-height: 80vh; width: auto; max-width: 100%; border-radius: var(--radius); background: #fff; }
.lightbox figcaption { text-align: center; max-width: 70ch; font-size: 0.9375rem; color: #e4ebe6; }
.lightbox .lb-close {
  position: fixed;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}
.lightbox .lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
}
.lightbox .lb-prev { left: 1rem; }
.lightbox .lb-next { right: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 3rem 2rem;
  border-top: 1.5px solid var(--text);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
}
.site-footer .mark { height: 34px; color: var(--primary); }
.site-footer h2 { font-size: var(--step-0); margin-bottom: 0.6rem; }
.site-footer p, .site-footer li { color: var(--muted); }
.site-footer li + li { margin-top: 0.35rem; }
.site-footer a { color: var(--text); }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 404 ---------- */
.not-found { padding-block: clamp(5rem, 12vw, 9rem); }
.not-found .mark { height: 48px; color: var(--primary); margin-bottom: 2rem; }

@media print {
  .site-header, .site-footer, .hero-sketch, .filters, .btn-row { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Spacing helpers for section sequences ---------- */
.page-head + .section { padding-top: 0; }
.split-top { align-items: start; }
.band .lead + p { margin-top: 1rem; }
.footer-grid .mark + p { margin-top: 1rem; }
.not-found .btn-row { margin-top: 2rem; }
.research-item .work-media { width: 84px; cursor: zoom-in; }
.research-item .work-media img { aspect-ratio: auto; width: 84px; }
.cert-figure .doc-grid { grid-template-columns: 1fr; }
@media (max-width: 640px) {
  .hero-sketch-caption { flex-direction: column; gap: 0.25rem; }
}
