/* ==========================================================================
   MeerCAD Studio — site styles
   --------------------------------------------------------------------------
   1. Fonts            5. Header & navigation     9.  Forms
   2. Design tokens    6. Footer                  10. Portfolio & lightbox
   3. Base             7. Shared components       11. Utilities
   4. Layout           8. Page sections           12. Motion & print

   Colors: Espresso #463325 and Sand #CDB78F are taken directly from the
   logo. Neutrals are tints/shades of the same warm hue. Every text/background
   pair used below passes WCAG AA (4.5:1) — Sand is never used for text on a
   light background (1.85:1); use --bronze for sand-colored text instead.
   ========================================================================== */

/* 1. Fonts (self-hosted, latin subset) ------------------------------------ */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans-var-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

/* 2. Design tokens --------------------------------------------------------- */
:root {
  /* Brand — exact logo colors */
  --espresso: #463325;
  --sand: #cdb78f;
  --umber: #3a2313;

  /* Neutrals derived from the logo hue */
  --ink: #2a1e15;        /* body text        15.4:1 on paper */
  --muted: #6a5848;      /* secondary text    6.4:1 on paper */
  --bronze: #7a6340;     /* sand-hued labels  5.4:1 on paper */
  --paper: #fbf9f5;      /* page background */
  --paper-2: #f4efe6;    /* alternate sections */
  --sand-100: #f1eadc;
  --sand-200: #e6dac3;
  --line: #ddd1bc;       /* decorative hairlines */
  --field: #8f7c64;      /* form borders      3.8:1 on paper */
  --night: #2c2018;      /* dark band */
  --white: #ffffff;
  --brass: #a88b57;      /* terrazzo divider strip (decorative) */

  /* Feedback */
  --error: #a33a22;
  --success: #2f6a3e;
  --ph-bg: #fff0b3;      /* placeholder highlight */

  /* Drafting grid */
  --grid-major: rgba(70, 51, 37, 0.075);
  --grid-minor: rgba(70, 51, 37, 0.035);

  /* Type */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-h1: clamp(2.25rem, 1.55rem + 3.1vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.35rem + 1.9vw, 2.75rem);
  --fs-h3: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --fs-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);

  /* Space & shape */
  --container: 76rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 2.8rem + 5vw, 7.5rem);
  --radius: 2px;
  --header-h: 4.25rem;
  --logo-h: 2.25rem;
  --shadow-sheet: 0 1px 0 rgba(44, 32, 24, 0.06), 0 24px 48px -28px rgba(44, 32, 24, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 30em) {
  :root { --logo-h: 2.75rem; }
}
@media (min-width: 62em) {
  :root {
    --header-h: 5.5rem;
    /* the logo is wide (about 3.7 : 1), so it eases down on narrower desktops to leave room for the centred links */
    --logo-h: clamp(3.25rem, 5.5vw, 4.25rem);
  }
}

/* 3. Base ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 62em) {
  body { font-size: 1.0625rem; }
}
main { flex: 1 0 auto; }

img,
svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--espresso);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em; font-weight: 780; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.012em; line-height: 1.25; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
strong { font-weight: 700; }

a {
  color: var(--espresso);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--umber); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--espresso);
  outline-offset: 3px;
}
.on-dark :focus-visible { outline-color: var(--sand); }

::selection { background: var(--sand); color: var(--night); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

[hidden] { display: none !important; }

/* 4. Layout ---------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--narrow { --container: 48rem; }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--paper-2); }
.section--tight { padding-block: calc(var(--section-y) * 0.7); }
.section--flush-top { padding-top: 0; }

/* Faint drafting grid, fading out toward the bottom */
.grid-bg { position: relative; isolation: isolate; }
.grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.split {
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
}
@media (min-width: 62em) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--sticky > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }
}

/* 5. Header & navigation ---------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--espresso);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* background lives on a pseudo-element so the fixed mobile menu is not
   trapped by backdrop-filter creating a containing block */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(251, 249, 245, 0.94);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  backdrop-filter: saturate(1.1) blur(10px);
}
.site-header.is-scrolled,
.site-header.nav-open {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(44, 32, 24, 0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-h);
}
/* on very narrow phones the logo scales down (keeping its shape) rather than pushing the buttons off screen */
.brand { display: inline-flex; flex: 0 1 auto; min-width: 0; margin-right: auto; border-radius: var(--radius); }
.brand img { height: var(--logo-h); width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.header-cta,
.nav-toggle { flex: none; white-space: nowrap; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--espresso);
  border-radius: var(--radius);
  background: transparent;
  color: var(--espresso);
  font: 600 0.9375rem/1 var(--font-sans);
  cursor: pointer;
}
.nav-toggle__icon {
  position: relative;
  width: 18px;
  height: 12px;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after,
.nav-toggle__icon span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle__icon::before { top: 0; }
.nav-toggle__icon span { top: 5.25px; }
.nav-toggle__icon::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(5.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-5.25px) rotate(-45deg); }

.nav-menu { list-style: none; margin: 0; padding: 0; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 1rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { color: var(--espresso); }
.nav-link .chev { width: 14px; height: 14px; transition: transform 0.2s; }
.sub-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sub-label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font: 500 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.sub-menu { list-style: none; margin: 0; padding: 0; }
.sub-menu a {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  align-items: center;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}
.sub-menu a:hover { background: var(--sand-100); }
.sub-menu a[aria-current="page"] { background: var(--sand-100); }
.sub-menu .swatch {
  grid-row: span 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--espresso);
}
.sub-menu strong { font-weight: 700; color: var(--espresso); line-height: 1.3; }
.sub-menu small {
  font: 500 0.75rem/1.35 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Mobile menu (below 62em) */
@media (max-width: 61.99em) {
  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem var(--gutter) 2.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .nav-open .nav-menu { display: flex; }
  .nav-menu > li { border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
  .nav-menu > li:last-child { border-bottom: 0; padding-top: 1rem; }
  .nav-link { width: 100%; padding-inline: 0; font-size: 1.125rem; }
  .sub-toggle { display: none; }
  .nav-cta .btn { width: 100%; justify-content: center; }
  body.nav-locked { overflow: hidden; }
}
@media (max-width: 23.99em) {
  .nav-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header .header-cta { padding-inline: 0.8rem; }
}

/* Desktop navigation */
@media (min-width: 62em) {
  .nav-toggle,
  .sub-label,
  .site-header .header-cta { display: none; }
  .nav-menu { display: flex; align-items: center; gap: 0.15rem; }
  /* links sit in the centre of the header; the quote button stays at the right edge.
     The menu spans the whole header, so it lets clicks through to the logo underneath. */
  .header-inner { position: relative; }
  .nav-menu { position: absolute; inset: 0; justify-content: center; pointer-events: none; }
  .nav-menu > li { pointer-events: auto; }
  .nav-link::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.4rem;
    height: 1px;
    background: var(--espresso);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
  }
  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after,
  .has-sub.is-current > .nav-link::after { transform: scaleX(1); }
  .has-sub { position: relative; }
  .sub-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: -0.5rem;
    width: 22rem;
    padding: 0.5rem;
    display: none;
    background: var(--white);
    border: 1px solid var(--espresso);
    box-shadow: 0 24px 48px -24px rgba(44, 32, 24, 0.35);
  }
  /* small hover bridge so the menu stays open while the pointer moves down */
  .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -0.75rem; height: 0.75rem; }
  .sub-toggle[aria-expanded="true"] ~ .sub-menu { display: block; }
  .nav-cta { position: absolute; right: 0; }
}

/* 6. Footer ------------------------------------------------------------------ */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding-top: clamp(3rem, 6vw, 4.5rem);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.footer-brand { grid-column: 1 / -1; max-width: 26rem; }
.footer-brand img { width: 11.5rem; height: auto; margin-bottom: 1.25rem; }
.footer-brand p { color: var(--muted); }
.footer-title {
  margin-bottom: 1rem;
  font: 500 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer-list a { color: var(--ink); text-decoration: none; }
.footer-list a:hover { color: var(--espresso); text-decoration: underline; }
.footer-contact { grid-column: 1 / -1; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.contact-list li { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.65rem; align-items: start; }
.contact-list svg { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; color: var(--bronze); }
.contact-list span.k {
  display: block;
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bronze);
}
.contact-list a { word-break: break-word; }
@media (min-width: 48em) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-contact { grid-column: auto; }
}
@media (min-width: 62em) {
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr 1.3fr; }
  .footer-brand { grid-column: auto; }
}

/* Footer title block strip */
.footer-tb {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  border: 1px solid var(--espresso);
  background: var(--paper);
  font-family: var(--font-mono);
}
.footer-tb > div {
  padding: 0.6rem 0.85rem 0.65rem;
  border-right: 1px solid var(--espresso);
  border-bottom: 1px solid var(--espresso);
  min-width: 0;
}
.footer-tb > div:nth-child(2n) { border-right: 0; }
.footer-tb > div:nth-last-child(-n + 2) { border-bottom: 0; }
.footer-tb dt,
.tb dt {
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.footer-tb dd,
.tb dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--espresso);
}
.footer-tb a { color: var(--espresso); }
.footer-tb dd { overflow-wrap: anywhere; }
@media (min-width: 62em) {
  .footer-tb { grid-template-columns: 1.4fr 1.6fr 0.7fr 1.3fr; }
  .footer-tb > div { border-bottom: 0; border-right: 1px solid var(--espresso); }
  .footer-tb > div:nth-child(2n) { border-right: 1px solid var(--espresso); }
  .footer-tb > div:last-child { border-right: 0; }
}

/* 7. Shared components -------------------------------------------------------- */

/* Mono label */
.label {
  margin: 0 0 0.75rem;
  font: 500 0.75rem/1.35 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* Dimension-line accent for section headings:
   text sits above a dimension line with oblique ticks and extension lines */
.dim {
  --dim-line: var(--espresso);
  position: relative;
  display: inline-block;
  min-width: 11rem;
  margin: 0 0 1.25rem;
  padding: 0 2rem 1.1rem;
  font: 500 0.75rem/1.35 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--bronze);
}
.dim::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 7px;
  height: 1px;
  background: var(--dim-line);
}
.dim::after {
  --t: linear-gradient(45deg, transparent calc(50% - 0.75px), var(--dim-line) calc(50% - 0.75px), var(--dim-line) calc(50% + 0.75px), transparent calc(50% + 0.75px));
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15px;
  background:
    var(--t) left 0 top 3px / 9px 9px no-repeat,
    var(--t) right 0 top 3px / 9px 9px no-repeat,
    linear-gradient(var(--dim-line), var(--dim-line)) left 4px top 0 / 1px 100% no-repeat,
    linear-gradient(var(--dim-line), var(--dim-line)) right 4px top 0 / 1px 100% no-repeat;
}
.on-dark .dim { --dim-line: var(--sand); color: var(--sand); }

.sec-head { max-width: 46rem; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head h2 { margin-bottom: 0.4em; }
.lede { font-size: var(--fs-lede); line-height: 1.6; color: var(--muted); }
.sec-head .lede { margin-bottom: 0; }

/* Title block label (sheet / scale / rev.) */
.tb {
  display: inline-flex;
  margin: 0;
  border: 1px solid var(--espresso);
  background: var(--paper);
  font-family: var(--font-mono);
}
.tb > div { padding: 0.4rem 0.75rem 0.45rem; border-left: 1px solid var(--espresso); }
.tb > div:first-child { border-left: 0; }
.tb--float { position: absolute; right: 0.75rem; bottom: 0.75rem; box-shadow: 0 8px 20px -14px rgba(44, 32, 24, 0.6); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 650 1rem/1.2 var(--font-sans);
  letter-spacing: 0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--espresso); color: var(--paper); }
.btn--primary:hover { background: var(--umber); color: var(--paper); }
.btn--ghost { border-color: var(--espresso); background: transparent; color: var(--espresso); }
.btn--ghost:hover { background: var(--espresso); color: var(--paper); }
.btn--sand { background: var(--sand); color: var(--night); }
.btn--sand:hover { background: var(--sand-200); color: var(--night); }
.btn--sm { min-height: 40px; padding: 0.55rem 0.95rem; font-size: 0.9375rem; }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--espresso);
  text-decoration: none;
}
.link-arrow svg { width: 1.05rem; height: 1.05rem; transition: transform 0.25s var(--ease); }
a.link-arrow:hover { text-decoration: underline; }
a.link-arrow:hover svg,
.card-link:hover .link-arrow svg { transform: translateX(3px); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Tick list */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.85rem;
  height: 1px;
  background: var(--espresso);
}
.ticks li::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: calc(0.62em - 3px);
  width: 7px;
  height: 7px;
  background: linear-gradient(45deg, transparent calc(50% - 0.75px), var(--espresso) calc(50% - 0.75px), var(--espresso) calc(50% + 0.75px), transparent calc(50% + 0.75px));
}

/* Trade textures (CSS/SVG stand-ins until real photos are added) */
.texture { background-color: var(--sand-100); }
.texture--tile { background: url("/assets/img/textures/tile.svg") 0 0 / 160px 160px; }
.texture--stone { background: url("/assets/img/textures/stone.svg") center / cover; }
.texture--terrazzo {
  background:
    linear-gradient(118deg, transparent 0 58%, var(--brass) 58% calc(58% + 1.5px), rgba(70, 51, 37, 0.07) calc(58% + 1.5px)),
    url("/assets/img/textures/terrazzo.svg") 0 0 / 220px 220px;
}

/* Cards */
.card-grid { display: grid; gap: 1.25rem; }
@media (min-width: 48em) { .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62em) { .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }

.trade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.trade-card:hover { border-color: var(--espresso); box-shadow: var(--shadow-sheet); transform: translateY(-2px); }
.trade-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--line);
}
.trade-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.5rem 1.6rem; }
.trade-card h3 { margin-bottom: 0.6rem; }
.trade-card h3 a { color: inherit; text-decoration: none; }
.trade-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.trade-card h3 a:focus-visible { outline: none; }
.trade-card h3 a:focus-visible::after { outline: 2px solid var(--espresso); outline-offset: 4px; }
.trade-card p { color: var(--muted); }
.trade-card .ticks { margin-bottom: 1.5rem; font-size: 0.9375rem; }
.trade-card .link-arrow { margin-top: auto; }

/* Spec strip (title-block style facts) */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  border: 1px solid var(--espresso);
  background: var(--paper);
}
.spec-strip > div {
  min-width: 0;
  padding: 0.85rem 1rem 0.9rem;
  border-right: 1px solid var(--espresso);
  border-bottom: 1px solid var(--espresso);
}
.spec-strip > div:nth-child(2n) { border-right: 0; }
.spec-strip > div:nth-last-child(-n + 2) { border-bottom: 0; }
.spec-strip dt {
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.3rem;
}
.spec-strip dd { margin: 0; font-weight: 650; line-height: 1.4; color: var(--espresso); font-size: 0.9375rem; }
@media (min-width: 62em) {
  .spec-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .spec-strip > div { border-bottom: 0; border-right: 1px solid var(--espresso); }
  .spec-strip > div:nth-child(2n) { border-right: 1px solid var(--espresso); }
  .spec-strip > div:last-child { border-right: 0; }
}

/* Sheet index (what's in a drawing set) */
.sheet-index { border: 1px solid var(--espresso); background: var(--white); }
.sheet-index__head {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--espresso);
  background: var(--paper-2);
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.sheet-index ol { list-style: none; margin: 0; padding: 0; }
.sheet-index li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.sheet-index li:last-child { border-bottom: 0; }
.sheet-index .no {
  font: 500 0.875rem/1.6 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--espresso);
}
.sheet-index h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; }
.sheet-index p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.note-box {
  border: 1px solid var(--espresso);
  background: var(--paper);
  padding: 1.25rem 1.35rem;
}
.note-box h3 { font-size: 1.0625rem; margin-bottom: 0.75rem; }
.note-box .ticks { font-size: 0.9375rem; }
.note-box + .note-box { margin-top: 1rem; }

/* Process steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 0 0 2rem 3.5rem;
}
.step::before {
  /* vertical rail on mobile */
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 2.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--line);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step__no {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid var(--espresso);
  border-radius: 50%;
  background: var(--paper);
  font: 500 0.8125rem/1 var(--font-mono);
  color: var(--espresso);
}
.section--alt .step__no { background: var(--paper-2); }
.step h3 { margin: 0.3rem 0 0.4rem; font-size: 1.125rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 62em) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; }
  .step { padding: 3.25rem 0 0; }
  .step::before {
    left: 2.6rem;
    right: -1.5rem;
    top: 1.07rem;
    bottom: auto;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, var(--espresso) 0 50%, transparent 0) 0 0 / 8px 1px repeat-x;
  }
  .step:last-child::before { display: none; }
}

/* Feature grid (why choose us) */
.features {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.feature {
  padding: 1.75rem 1.5rem 1.85rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.feature svg { width: 2.25rem; height: 2.25rem; color: var(--espresso); margin-bottom: 1.1rem; }
.feature h3 { font-size: 1.125rem; margin-bottom: 0.45rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 40em) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62em) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Deliverables list (trade pages) */
.deliverables {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.deliverable {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.25rem 1rem;
  padding: 1.35rem 1.35rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
}
.deliverable .code {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--espresso);
  border-radius: 50%;
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--espresso);
  background:
    linear-gradient(var(--espresso), var(--espresso)) center / 100% 1px no-repeat,
    var(--paper);
}
.deliverable .code span { display: block; padding: 0.15rem; background: var(--paper); }
.deliverable h3 { margin: 0.2rem 0 0.3rem; font-size: 1.0625rem; }
.deliverable p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 48em) { .deliverables { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Audience chips */
.for-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.for-line li {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--espresso);
}
.for-line li.k {
  border: 0;
  background: none;
  padding-left: 0;
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* Info table (about page, title-block style) */
.info-table { margin: 0; border: 1px solid var(--espresso); background: var(--white); }
.info-table > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.info-table > div:last-child { border-bottom: 0; }
.info-table dt {
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.info-table dd { margin: 0; font-weight: 600; color: var(--ink); }
@media (min-width: 40em) {
  .info-table > div { grid-template-columns: 11rem 1fr; gap: 1rem; align-items: baseline; }
}

/* Sample sheet cards (home / trade pages) */
.sheet-card {
  position: relative;
  display: block;
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
}
a.sheet-card:hover { border-color: var(--espresso); box-shadow: var(--shadow-sheet); transform: translateY(-2px); color: inherit; }
.sheet-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.sheet-card figcaption,
.sheet-card .cap { display: grid; gap: 0.2rem; padding: 1rem 1.15rem 1.15rem; }
.cap-trade {
  font: 500 0.6875rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.cap-title { font-weight: 700; color: var(--espresso); line-height: 1.35; }
.cap-meta { font-size: 0.875rem; color: var(--muted); }

/* Page hero (inner pages) */
.page-hero { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(3rem, 2.5rem + 3vw, 5rem); }
.page-hero__grid { display: grid; gap: 2.5rem; align-items: center; }
.page-hero h1 { max-width: 18ch; }
.page-hero .lede { max-width: 40rem; }
.page-hero .actions { margin-top: 2rem; }
.page-hero__media {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--espresso);
  box-shadow: var(--shadow-sheet);
}
.page-hero__media::before {
  /* inner sheet border */
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px solid rgba(70, 51, 37, 0.55);
  pointer-events: none;
}
@media (min-width: 62em) {
  .page-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4rem; }
  .page-hero--plain .page-hero__grid { grid-template-columns: minmax(0, 1fr); }
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  font: 500 0.75rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.breadcrumb li + li::before { content: "/"; margin-right: 0.35rem; color: var(--bronze); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--espresso); }
.breadcrumb [aria-current="page"] { color: var(--espresso); }

/* Placeholder highlight (added by main.js; disappears once text is replaced) */
mark.ph {
  padding: 0.05em 0.3em;
  border: 1px dashed #9a7a00;
  border-radius: 2px;
  background: var(--ph-bg);
  color: var(--espresso);
  font-weight: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Prose (privacy policy etc.) */
.prose { max-width: 46rem; }
.prose h2 { font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem); margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* FAQ */
.faq { border-top: 1px solid var(--espresso); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  display: block;
  padding: 1.2rem 3rem 1.2rem 0;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--espresso);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: var(--espresso);
  transition: transform 0.25s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--umber); }
.faq .answer { padding: 0 0 1.4rem; color: var(--ink); max-width: 46rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* 8. Page sections ---------------------------------------------------------- */

/* Home hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4.5vw, 5.5rem) clamp(1rem, 0.5rem + 2vw, 2rem); }
.hero__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.15rem, 1.5rem + 2.6vw, 3.4rem); max-width: 18ch; letter-spacing: -0.026em; }
.hero .lede { max-width: 36rem; margin-bottom: 0; }
.hero .actions { margin-top: 2rem; }
.hero__note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
@media (min-width: 62em) {
  .hero__grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
}

.hero-sheet { position: relative; margin: 0 0.5rem 0.5rem 0; }
.hero-sheet::before,
.hero-sheet::after {
  /* sheets stacked behind: a drawing *set* */
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(70, 51, 37, 0.4);
  background: var(--white);
}
.hero-sheet::before { transform: translate(10px, 10px); opacity: 0.6; }
.hero-sheet::after { transform: translate(5px, 5px); }
.hero-sheet__svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  background: var(--white);
  box-shadow: var(--shadow-sheet);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-sheet__svg .hs-anno { animation: fade-in 1.2s 0.35s var(--ease) both; }
  .hero-sheet { animation: rise 0.9s var(--ease) both; }
}

/* CTA band */
.cta-band {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  background: var(--night);
  color: var(--sand-200);
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(205, 183, 143, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205, 183, 143, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(205, 183, 143, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205, 183, 143, 0.04) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 80% 50%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 80% 50%, #000 20%, transparent 75%);
}
.cta-band__inner { display: grid; gap: 2rem; align-items: end; }
.cta-band h2 { color: var(--paper); max-width: 22ch; }
.cta-band p { color: var(--sand-200); max-width: 38rem; }
.cta-band a:not(.btn) { color: var(--sand); }
.cta-band a:not(.btn):hover { color: var(--paper); }
.cta-band .actions { gap: 1rem 1.5rem; }
.cta-band .alt { margin: 0; font-size: 0.9375rem; }
.cta-band mark.ph { color: var(--night); }
@media (min-width: 62em) {
  .cta-band__inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4rem; }
  .cta-band .actions { justify-content: flex-end; }
}

/* Trade intro */
.intro-band {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--espresso);
  background: var(--white);
}
@media (min-width: 48em) { .intro-band { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* About principles */
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; }
.principles li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.principles li:last-child { border-bottom: 0; padding-bottom: 0; }
.principles .no { font: 500 0.875rem/1.7 var(--font-mono); color: var(--bronze); }
.principles h3 { font-size: 1.125rem; margin-bottom: 0.35rem; }
.principles p { margin: 0; color: var(--muted); }

.story p { font-size: var(--fs-lede); }

/* 404 */
.notfound { text-align: center; }
.notfound .nf-sheet { width: min(100%, 26rem); margin: 0 auto 2rem; }
.notfound h1 { margin-inline: auto; }
.notfound .lede { margin-inline: auto; max-width: 34rem; }
.notfound .actions { justify-content: center; margin-top: 2rem; }
.notfound-links { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; }

/* 9. Forms ------------------------------------------------------------------- */
.quote-layout { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 62em) {
  .quote-layout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
  .quote-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

.form-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--espresso);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}
.form-card__tb { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.form-intro { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.quote-form fieldset { margin: 0 0 2rem; padding: 0; border: 0; min-width: 0; }
.quote-form legend {
  display: block;
  width: 100%;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  font: 500 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}
.form-grid { display: grid; gap: 1.25rem; }
@media (min-width: 40em) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--full { grid-column: 1 / -1; }
}
.field { display: grid; gap: 0.4rem; align-content: start; min-width: 0; }
.field > label,
.field-group-label { font-weight: 650; font-size: 0.9375rem; color: var(--ink); }
.req { color: var(--error); margin-left: 0.15rem; }
.hint { margin: 0; font-size: 0.875rem; color: var(--muted); }

.quote-form input:not([type="checkbox"]),
.quote-form select,
.quote-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quote-form textarea { min-height: 9rem; resize: vertical; }
.quote-form select {
  appearance: none;
  padding-right: 2.5rem;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23463325' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 0.9rem center / 14px no-repeat;
}
.quote-form input:hover,
.quote-form select:hover,
.quote-form textarea:hover { border-color: var(--espresso); }
.quote-form input:focus-visible,
.quote-form select:focus-visible,
.quote-form textarea:focus-visible {
  outline: 2px solid var(--espresso);
  outline-offset: 1px;
  border-color: var(--espresso);
}
.quote-form [aria-invalid="true"]:not([type="checkbox"]) {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}
.quote-form ::placeholder { color: #8a7a6a; opacity: 1; }

.choices { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-weight: 650;
  color: var(--espresso);
  transition: border-color 0.15s, background-color 0.15s;
}
.choice:hover { border-color: var(--espresso); }
.choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--espresso); }
.choice .swatch { display: none; }
.choice:has(input:checked) { border-color: var(--espresso); background: var(--sand-100); box-shadow: inset 0 0 0 1px var(--espresso); }
.choice:has(input:focus-visible) { outline: 2px solid var(--espresso); outline-offset: 2px; }
@media (min-width: 30em) {
  .choice { grid-template-columns: auto 2rem 1fr; }
  .choice .swatch { display: block; width: 2rem; height: 2rem; border: 1px solid var(--espresso); }
}
.quote-form .choices-group { margin: 0; }
.quote-form .choices-group legend {
  margin-bottom: 0.4rem;
  padding: 0;
  border: 0;
  font: 650 0.9375rem/1.4 var(--font-sans);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.choices-group .hint { margin-bottom: 0.6rem; }
.choices-group .field-error { margin-top: 0.6rem; }
.choices-group.is-invalid .choice { border-color: var(--error); }

.field-error {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--error);
}
.field-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--error);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}
.field-error[hidden] { display: none; }

.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error-summary,
.form-status {
  margin-bottom: 1.75rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--error);
  border-left-width: 4px;
  background: #fbf0ec;
  color: var(--ink);
}
.error-summary h2 { font-size: 1.0625rem; margin-bottom: 0.5rem; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.1rem; }
.error-summary a { color: var(--error); font-weight: 600; }
.error-summary:focus { outline: 2px solid var(--error); outline-offset: 2px; }
.form-status { margin: 1.25rem 0 0; }
.form-status:empty { display: none; }
.form-status a { color: var(--error); font-weight: 700; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.form-footer p { margin: 0; font-size: 0.875rem; color: var(--muted); max-width: 26rem; }
.btn .spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: none;
}
.btn[aria-busy="true"] .spinner { display: inline-block; animation: spin 0.8s linear infinite; }
.btn[aria-busy="true"] svg { display: none; }

.form-success {
  background: var(--white);
  border: 1px solid var(--success);
  border-left-width: 4px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.form-success h2 { color: var(--success); font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); }
.form-success h2:focus { outline: none; }
.form-success .stamp {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--success);
  font: 600 0.75rem/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success);
}

.aside-block { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.aside-block:first-child { padding-top: 0; border-top: 0; }
.aside-block h2 { font-size: 1.125rem; margin-bottom: 0.85rem; }
.aside-block ol { padding-left: 1.2rem; margin: 0; display: grid; gap: 0.45rem; color: var(--muted); }
.aside-block ol li::marker { font-family: var(--font-mono); color: var(--bronze); }

/* 10. Portfolio & lightbox ------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--espresso);
  font: 500 0.8125rem/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.filter-btn:hover { border-color: var(--espresso); }
.filter-btn[aria-pressed="true"] { background: var(--espresso); border-color: var(--espresso); color: var(--paper); }
.filter-btn .count { opacity: 0.75; margin-left: 0.25rem; }

.portfolio-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 40em) { .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62em) { .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.portfolio-grid > li[hidden] { display: none; }
.pf-card { margin: 0; height: 100%; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); transition: border-color 0.2s, box-shadow 0.25s; }
.pf-card:hover,
.pf-card:focus-within { border-color: var(--espresso); box-shadow: var(--shadow-sheet); }
.pf-link { position: relative; display: block; border-bottom: 1px solid var(--line); overflow: hidden; }
.pf-link img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-2); transition: transform 0.5s var(--ease); }
.pf-link:hover img { transform: scale(1.02); }
.pf-link .zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--espresso);
  background: var(--paper);
  color: var(--espresso);
}
.pf-link .zoom svg { width: 1.1rem; height: 1.1rem; }
.pf-card figcaption { display: grid; gap: 0.2rem; padding: 1rem 1.15rem 1.2rem; }

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sand-200);
}
.lightbox::backdrop { background: rgba(28, 20, 14, 0.9); }
.lightbox[open] { display: grid; }
.lb-inner {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100%;
  padding: 0.75rem;
}
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lb-count { font: 500 0.8125rem/1 var(--font-mono); letter-spacing: 0.12em; color: var(--sand); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0.75rem 0; }
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--white);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
.lb-caption { margin: 0 auto; max-width: 48rem; text-align: center; color: var(--sand-200); font-size: 0.9375rem; }
.lb-caption strong { color: var(--paper); }
.lb-btn {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgba(205, 183, 143, 0.6);
  border-radius: var(--radius);
  background: rgba(44, 32, 24, 0.85);
  color: var(--sand);
  cursor: pointer;
}
.lb-btn:hover { background: var(--espresso); color: var(--paper); border-color: var(--sand); }
.lb-btn svg { width: 1.25rem; height: 1.25rem; }
.lb-bottom { display: grid; gap: 0.6rem; }
.lb-nav { display: flex; justify-content: center; gap: 0.75rem; }
.lightbox :focus-visible { outline-color: var(--sand); }
@media (min-width: 62em) {
  .lb-inner { padding: 1.25rem 1.5rem; }
  .lb-stage { padding: 1rem 4.5rem; }
  .lb-nav { position: absolute; inset: 50% 1.5rem auto 1.5rem; justify-content: space-between; padding: 0; transform: translateY(-50%); pointer-events: none; }
  .lb-nav .lb-btn { pointer-events: auto; }
}

/* 11. Utilities ---------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.more-link { margin-top: 2.5rem; }

/* 12. Motion & print ------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .nav-toggle,
  .cta-band,
  .skip-link,
  .filters { display: none !important; }
  body { background: #fff; }
  .grid-bg::before { display: none; }
  a { text-decoration: underline; }
}
