/* ══════════════════════════════════════════════════════════════════
   EMENDARE v4 — "the site is a bid set that takes itself off"
   One component set, themed by tokens:
     body (default)        → Emendare parent: drafting paper / charcoal
                             ink / grease-pencil orange (drawing set)
     body.theme-luserne    → Luserne: same material world, product voice
     body.theme-testiphai  → TestiphAI: near-black / teal
   `.invert` on a section is the MATERIAL SWITCH: the night-shift sheet
   (charcoal ground, paper type). Flat fills. No gradients. Sharp corners.
   ══════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted, latin subsets) ─────────────────────────── */
@font-face { font-family:'Satoshi'; font-style:normal; font-weight:500; font-display:swap; src:url('assets/fonts/satoshi-500.woff2') format('woff2'); }
@font-face { font-family:'Satoshi'; font-style:normal; font-weight:700; font-display:swap; src:url('assets/fonts/satoshi-700.woff2') format('woff2'); }
@font-face { font-family:'Satoshi'; font-style:normal; font-weight:900; font-display:swap; src:url('assets/fonts/satoshi-900.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('assets/fonts/jbmono-400.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('assets/fonts/jbmono-500.woff2') format('woff2'); }

/* ── Theme tokens ───────────────────────────────────────────────── */
:root, body {
  /* Emendare parent: drafting paper ground, charcoal ink, one orange */
  --bg:        #F5F3EE;
  --tint:      #EDEAE2;
  --raised:    #FBFAF6;
  --recessed:  #EDEAE2;
  --fg:        #23262B;
  --fg-2:      #43464C;
  --fg-3:      #7C7F85;
  --line:      rgba(35,38,43,.22);
  --line-soft: rgba(35,38,43,.10);
  --accent:        #B4650A;   /* readable orange for text on paper */
  --accent-bright: #F7941D;   /* grease-pencil orange: fills, marks */
  --accent-fg:     #23262B;   /* text on orange fills */
  --flag:      #B3401E;
  --grid: rgba(35,38,43,.05);
}
.invert {
  /* the night-shift sheet: charcoal ground, paper type */
  --bg:        #1D2024;
  --tint:      #23262B;
  --raised:    #26292E;
  --recessed:  #17191D;
  --fg:        #F5F3EE;
  --fg-2:      rgba(245,243,238,.82);
  --fg-3:      rgba(245,243,238,.55);
  --line:      rgba(245,243,238,.22);
  --line-soft: rgba(245,243,238,.09);
  --accent:        #F7941D;
  --accent-bright: #F7941D;
  --accent-fg:     #23262B;
  --flag:      #F88C7A;
  --grid: rgba(245,243,238,.04);
}
body.theme-luserne {
  --bg:#F5F3EE; --tint:#EDEAE2; --raised:#FBFAF6; --recessed:#EDEAE2;
  --fg:#23262B; --fg-2:#43464C; --fg-3:#7C7F85;
  --line:rgba(35,38,43,.22); --line-soft:rgba(35,38,43,.10);
  --accent:#B4650A; --accent-bright:#F7941D; --accent-fg:#23262B;
  --flag:#B3401E; --grid:rgba(35,38,43,.05);
}
body.theme-luserne .invert {
  --bg:#1D2024; --tint:#23262B; --raised:#26292E; --recessed:#17191D;
  --fg:#F5F3EE; --fg-2:rgba(245,243,238,.82); --fg-3:rgba(245,243,238,.55);
  --line:rgba(245,243,238,.22); --line-soft:rgba(245,243,238,.09);
  --accent:#F7941D; --accent-bright:#F7941D; --accent-fg:#23262B;
  --flag:#F88C7A; --grid:rgba(245,243,238,.04);
}
body.theme-testiphai {
  --bg:#0E1518; --tint:#121B20; --raised:#18242B; --recessed:#0A1013;
  --fg:#EDF4F2; --fg-2:rgba(237,244,242,.82); --fg-3:rgba(237,244,242,.55);
  --line:rgba(237,244,242,.15); --line-soft:rgba(237,244,242,.06);
  --accent:#35E0C8; --accent-bright:#35E0C8; --accent-fg:#0E1518;
  --flag:#F88C7A; --grid:rgba(255,255,255,.03);
}
body.theme-testiphai .invert {
  --bg:#EDF4F2; --tint:#E0EAE7; --raised:#FFFFFF; --recessed:#D8E2DF;
  --fg:#0E1518; --fg-2:#26363c; --fg-3:#5b6d73;
  --line:rgba(14,21,24,.18); --line-soft:rgba(14,21,24,.08);
  --accent:#0A8F7B; --accent-bright:#0A8F7B; --accent-fg:#EDF4F2;
  --flag:#B3401E; --grid:rgba(14,21,24,.05);
}

:root {
  --sans: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: 'Satoshi', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --hand: 'Satoshi', system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --measure: 66ch;
}

/* ── Vertical accent utilities (legal / finance / construction) ──── */
.acc-legal        { --accent:#0A8F7B; --accent-bright:#0A8F7B; --accent-fg:#F5FFFC; }
.acc-finance      { --accent:#1E8A5B; --accent-bright:#1E8A5B; --accent-fg:#F3FFF7; }
.acc-construction { --accent:#B4650A; --accent-bright:#F7941D; --accent-fg:#231303; }
.invert .acc-legal        { --accent:#2BD9BF; --accent-bright:#2BD9BF; --accent-fg:#07211D; }
.invert .acc-finance      { --accent:#5BD98F; --accent-bright:#5BD98F; --accent-fg:#062A16; }
.invert .acc-construction { --accent:#F7941D; --accent-bright:#F7941D; --accent-fg:#231303; }

/* ── Reset-ish ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
}
img { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4 { margin: 0 0 .5em; line-height: 1.05; font-family: var(--disp); font-weight: 900; letter-spacing: -.01em; text-wrap: balance; color: var(--fg); }
p { margin: 0 0 1em; max-width: var(--measure); color: var(--fg-2); }
a { color: inherit; }
::selection { background: var(--accent-bright); color: var(--accent-fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Type utilities ─────────────────────────────────────────────── */
.kicker {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .18em;
  color: var(--accent); display: block; margin-bottom: .9rem;
}
.mono  { font-family: var(--mono); }
.small { font-size: .875rem; }
.muted { color: var(--fg-3); }
.lede  { font-size: clamp(1.15rem, 2.2vw, 1.35rem); line-height: 1.5; color: var(--fg-2); }
.h-display { font-size: clamp(2.2rem, 5.5vw, 3.9rem); text-transform: uppercase; letter-spacing: -.015em; }
.h-1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
.h-2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.h-3 { font-size: 1.25rem; font-family: var(--sans); font-weight: 700; }
.accent { color: var(--accent); }
.accent-bright { color: var(--accent-bright); }

/* ── Layout ─────────────────────────────────────────────────────── */
.wrap { max-width: 74rem; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; position: relative; color: var(--fg); }
.section + .section { border-top: 1px solid var(--line); }
.section.invert, .section.tinted {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
}
.section.tinted { background-image: none; background-color: var(--tint); }

.grid-2 { display: grid; gap: 2.5rem; }
.grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 820px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: start; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Section heading w/ index chip + rule ───────────────────────── */
.sec-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.sec-head .rule, .rule { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.sec-head .rule::after, .rule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sec-no {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-3); border: 1px solid var(--line); padding: .3rem .6rem;
  background: var(--raised); white-space: nowrap;
}

/* ── Ruler tick divider ─────────────────────────────────────────── */
.ruler {
  height: 14px; opacity: .45;
  background-image:
    repeating-linear-gradient(90deg, var(--fg) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, var(--fg) 0 1px, transparent 1px 50px);
  background-size: 100% 7px, 100% 14px;
  background-repeat: no-repeat;
  background-position: bottom left, bottom left;
}

/* ── Dimension line ─────────────────────────────────────────────── */
.dim {
  display: flex; align-items: center; gap: .8rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3);
  margin: 1.5rem 0;
}
.dim::before, .dim::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Cards ──────────────────────────────────────────────────────── */
.card { background: var(--raised); border: 1px solid var(--line); padding: clamp(1.4rem, 3vw, 2rem); position: relative; }
.card .corner {
  position: absolute; top: -1px; right: -1px; width: 14px; height: 14px;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg);
}
a.card { text-decoration: none; display: block; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { border-color: var(--accent-bright); transform: translateY(-3px); }

.brand-bar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.brand-bar img { height: 44px; width: auto; }
.brand-sub { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.logo-plate { background: #14181c; border: 1px solid var(--line); padding: .55rem .9rem; display: inline-flex; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .95rem 1.6rem;
  border: 2px solid var(--accent-bright);
  background: var(--accent-bright); color: var(--accent-fg);
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--fg); color: var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ── Stamp ──────────────────────────────────────────────────────── */
.stamp {
  display: inline-block;
  font-family: var(--mono); font-weight: 500; font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); border: 3px double var(--accent);
  padding: .55rem 1rem; transform: rotate(-4deg);
}
.stamp.red { color: var(--flag); border-color: var(--flag); }

/* ── Citations & sources ────────────────────────────────────────── */
.cite {
  font-family: var(--mono); font-size: .62em; font-weight: 500;
  vertical-align: super; line-height: 0;
  color: var(--accent); text-decoration: none; padding: 0 .15em;
}
.cite:hover { background: var(--accent-bright); color: var(--accent-fg); }
.sources {
  border: 1px solid var(--line); background: var(--raised);
  padding: 1.25rem 1.5rem; margin-top: 3rem;
  font-size: .875rem; color: var(--fg-2);
}
.sources h4 { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); margin-bottom: .8rem; }
.sources ol { margin: 0; padding-left: 1.4rem; }
.sources li { margin-bottom: .35rem; }
.sources li:target { outline: 2px solid var(--accent-bright); }

/* ── Spec tables / figures / tags ───────────────────────────────── */
.spec { width: 100%; border-collapse: collapse; font-size: .95rem; color: var(--fg-2); }
.spec th, .spec td { text-align: left; padding: .7rem .9rem; border: 1px solid var(--line); vertical-align: top; }
.spec th { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); background: var(--recessed); }
.spec td.num { font-family: var(--mono); font-weight: 500; white-space: nowrap; color: var(--fg); }
.table-scroll { overflow-x: auto; }

.fig-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .fig-row { grid-template-columns: repeat(4, 1fr); } .fig-row.two { grid-template-columns: repeat(2, 1fr); } }
.fig { background: var(--raised); padding: 1.4rem 1.2rem; }
.fig b { display: block; font-family: var(--disp); font-weight: 900; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1; letter-spacing: -.01em; color: var(--fg); }
.fig span { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); display: block; margin-top: .5rem; }
.fig .accent { color: var(--accent); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--fg); padding: .2rem .55rem; margin-right: .4rem; color: var(--fg);
}
.tag.verified { background: var(--fg); color: var(--bg); }
.tag.flagged  { border-color: var(--flag); color: var(--flag); }

/* ── Header / nav ───────────────────────────────────────────────── */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head .bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark {
  font-family: var(--disp); font-weight: 900; font-size: 1.35rem;
  letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center; gap: .1em; color: var(--fg);
}
.wordmark i { font-style: normal; color: var(--accent); }
.wordmark img { height: 44px; width: auto; }
.site-nav { display: none; align-items: center; gap: 1.5rem; }
.site-nav a {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; color: var(--fg-2);
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--fg); border-bottom-color: var(--accent-bright); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }
.site-nav a.btn { padding: .6rem 1.1rem; color: var(--accent-fg); border-bottom: 2px solid var(--accent-bright); }
.site-nav a.btn:hover { color: var(--bg); border-bottom-color: var(--fg); }
/* mega-menu */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > button {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--fg-2); background: none; border: 0; cursor: pointer;
  padding: .35rem 0; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: .45rem;
}
.nav-item > button::after {
  content: ''; width: .45em; height: .45em; margin-top: -.2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
.nav-item:hover > button, .nav-item.open > button { color: var(--fg); border-bottom-color: var(--accent-bright); }
.nav-item.open > button::after { transform: rotate(225deg); margin-top: .15em; }
.nav-item[aria-current] > button { color: var(--fg); border-bottom-color: var(--fg); }
.menu-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  width: 23rem; max-width: calc(100vw - 2rem); z-index: 60;
  background: var(--raised); border: 1px solid var(--line);
  border-top: 3px solid var(--fg);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  padding: .6rem; display: none;
}
.menu-panel::before { /* hover bridge so the panel doesn't close crossing the gap */
  content: ''; position: absolute; top: -15px; left: 0; right: 0; height: 15px;
}
.nav-item:hover .menu-panel, .nav-item:focus-within .menu-panel, .nav-item.open .menu-panel { display: block; }
.site-nav .menu-card, .menu-card {
  display: block; text-decoration: none; padding: .8rem .9rem;
  border-left: 3px solid var(--accent-bright);
  margin-bottom: .4rem;
  font-family: var(--sans); font-size: 1rem; font-weight: 400;
  text-transform: none; letter-spacing: normal;
  color: var(--fg); border-bottom: 0;
}
.site-nav .menu-foot { border-bottom: 0; }
.menu-card:last-of-type { margin-bottom: 0; }
.menu-card:hover { background: var(--recessed); }
.menu-card b {
  display: block; font-family: var(--disp); font-weight: 900; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: .02em; color: var(--fg);
}
.menu-card b em { font-style: normal; color: var(--accent); }
.menu-card span { display: block; font-size: .82rem; color: var(--fg-3); line-height: 1.4; margin-top: .15rem; }
.menu-card .status {
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.menu-foot {
  display: block; text-decoration: none; text-align: right;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3);
  border-top: 1px solid var(--line-soft); margin-top: .5rem; padding: .7rem .9rem 0;
}
.menu-foot:hover { color: var(--accent); }
.mobile-group {
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3);
  padding: 1rem 0 .3rem;
}
.mobile-nav a.sub { padding-left: 1rem; }

.nav-toggle { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: .6rem; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--fg); display: block; }
.nav-toggle span:last-child { width: 16px; background: var(--accent-bright); }
.mobile-nav { display: none; flex-direction: column; gap: .2rem; padding: .5rem var(--gutter) 1.25rem; border-top: 1px solid var(--line-soft); }
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--fg-2); padding: .65rem 0;
  border-bottom: 1px solid var(--line-soft);
}
@media (min-width: 1080px) {
  .site-nav { display: flex; }
  .nav-toggle, .mobile-nav { display: none !important; }
}

/* ── Footer title block ─────────────────────────────────────────── */
.titleblock { border-top: 2px solid var(--fg); background: var(--recessed); color: var(--fg); }
.titleblock .cells { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
@media (min-width: 820px) { .titleblock .cells { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.titleblock .cell { padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.titleblock .cell:first-child { border-left: 0; }
@media (max-width: 819.9px) { .titleblock .cell:nth-child(odd) { border-left: 0; } }
.titleblock h5 { font-family: var(--mono); font-size: .64rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 .6rem; }
.titleblock a { text-decoration: none; }
.titleblock a:hover { color: var(--accent); }
.titleblock ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; color: var(--fg-2); }
.titleblock li { margin-bottom: .3rem; }
.titleblock .legal {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding: .8rem 1.4rem; border: 1px solid var(--line); border-top: 0;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--fg-3);
}
.titleblock .legal a { color: inherit; }

/* ── Hero strike-through + write-in (home) ──────────────────────── */
.hero-phrase { position: relative; display: inline-block; }
.hero-manual { white-space: nowrap; }
.strike-line {
  position: absolute; top: 52%; left: -2%;
  width: 0; height: .12em; border-radius: 3px;
  background: rgba(239, 68, 68, .8);
  transform: rotate(-1.5deg);
  animation: drawStrike 1.4s cubic-bezier(.25,.1,.25,1) 1.1s forwards;
}
@keyframes drawStrike { 0% { width: 0; } 70% { width: 98%; } 100% { width: 105%; } }
.hero-manual { animation: fadeManual .6s ease 2.4s forwards; }
@keyframes fadeManual { to { opacity: .35; } }
.hero-auto {
  display: inline-block; overflow: hidden; white-space: nowrap;
  width: 0; opacity: 0; vertical-align: bottom; max-width: 100%;
  font-family: var(--hand); font-weight: 700; color: var(--accent);
  font-size: 1.08em; line-height: 1; transform: rotate(-1deg);
  animation: writeIn 2s cubic-bezier(.22,.61,.36,1) 2.8s forwards;
}
@keyframes writeIn { 0% { width: 0; opacity: 1; } 100% { width: 100%; opacity: 1; } }

/* ── Video-ready hero (solutions pages) ─────────────────────────── */
.hero-video { position: relative; overflow: hidden; }
.hero-video .hero-media {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--recessed);
}
.hero-video .hero-media video {
  width: 100%; height: 100%; object-fit: cover; opacity: .28; display: block;
}
.hero-video .hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 60%);
  opacity: .85;
}
.hero-video .wrap { position: relative; z-index: 1; }

/* ── Takeoff animation panel (Luserne pages) ────────────────────── */
.takeoff-panel { border: 1px solid var(--line); background: var(--raised); padding: 1rem; position: relative; }
.takeoff-panel .panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3);
  border-bottom: 1px solid var(--line-soft); padding: 0 .25rem .6rem; margin-bottom: .75rem;
}
.takeoff-panel svg { width: 100%; height: auto; display: block; }
.plan-room { fill: transparent; stroke: var(--fg); stroke-width: 1; opacity: .45; }
.plan-wall { stroke: var(--fg); stroke-width: 1; opacity: .45; }
.plan-label { font-family: var(--mono); font-size: 6.5px; fill: var(--fg-3); }
.plan-shade { fill: var(--accent-bright); opacity: 0; }
.plan-count { font-family: var(--mono); font-size: 7px; font-weight: 500; fill: var(--accent); opacity: 0; }
.plan-verify { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-dasharray: 3 2; opacity: 0; }
.plan-flag-box { fill: var(--bg); stroke: var(--flag); stroke-width: 1; opacity: 0; }
.plan-flag-text { font-family: var(--mono); font-size: 6px; font-weight: 500; fill: var(--flag); opacity: 0; }
@keyframes shadeIn { to { opacity: .85; } }
@keyframes markIn  { to { opacity: 1; } }
@keyframes verifyIn { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: .35; } }
.takeoff-panel.run .plan-shade  { animation: shadeIn .35s ease forwards; }
.takeoff-panel.run .plan-count  { animation: markIn .3s ease forwards; }
.takeoff-panel.run .plan-verify { animation: verifyIn 1.4s ease forwards; }
.takeoff-panel.run .plan-flag-box,
.takeoff-panel.run .plan-flag-text { animation: markIn .35s ease forwards; }
.takeoff-readout {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid var(--line-soft); margin-top: .75rem; padding: .7rem .25rem 0;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3);
}
.takeoff-readout .count { font-size: 1.5rem; letter-spacing: 0; color: var(--fg); }
.takeoff-readout .count b { color: var(--accent); font-weight: 500; }
.takeoff-stamp { position: absolute; right: 1.1rem; bottom: 3.6rem; opacity: 0; }
.takeoff-stamp.show { animation: markIn .4s ease forwards; }

/* ── Reveal on scroll ───────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── Steps / checks / ledger ────────────────────────────────────── */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 2rem 3.6rem; border-left: 1px solid var(--line); margin-left: 1.15rem; }
.steps > li:last-child { padding-bottom: .25rem; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: -1.2rem; top: 0;
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  background: var(--raised); border: 1px solid var(--fg); color: var(--fg);
}
.steps > li.hot::before { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--accent-fg); }

.checks { list-style: none; margin: 0 0 1.25rem; padding: 0; color: var(--fg-2); }
.checks li { position: relative; padding: .45rem 0 .45rem 1.9rem; }
.checks li::before {
  content: ''; position: absolute; left: 0; top: .78em;
  width: .85em; height: .45em;
  border-left: 3px solid var(--accent-bright); border-bottom: 3px solid var(--accent-bright);
  transform: rotate(-45deg);
}

.ledger { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .ledger { grid-template-columns: 1fr 1fr; } }
.ledger > div { background: var(--raised); padding: 1.5rem 1.6rem; }
.ledger > div.hot { background: var(--recessed); outline: 1px solid var(--accent-bright); outline-offset: -1px; }
.ledger h4 { font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 1rem; color: var(--fg-3); }
.ledger > div.hot h4 { color: var(--accent); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .form-grid.cols { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
label { font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); display: block; margin-bottom: .4rem; }
input, select, textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--fg);
  background: var(--recessed); border: 1px solid var(--line);
  padding: .8rem .9rem; border-radius: 0;
}
textarea { min-height: 8.5rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bright); outline-offset: 0; }

/* ── Report / callouts ──────────────────────────────────────────── */
.report-sheet { background: var(--raised); border: 1px solid var(--fg); box-shadow: 6px 6px 0 var(--line); padding: clamp(1.5rem, 4vw, 3rem); }
.report-sheet .sheet-meta {
  display: flex; flex-wrap: wrap; gap: .6rem 1.6rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3);
  border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.75rem;
}
.flag-callout { border: 1px solid var(--flag); background: var(--raised); padding: 1.4rem 1.6rem; margin: 2rem 0; position: relative; }
.flag-callout::before {
  content: 'FLAG'; position: absolute; top: -0.7em; left: 1rem;
  font-family: var(--mono); font-size: .66rem; font-weight: 500; letter-spacing: .2em;
  background: var(--flag); color: var(--raised); padding: .15rem .6rem;
}
.quote-mark {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; letter-spacing: -.01em;
  border-left: 4px solid var(--accent-bright); padding-left: 1.25rem; margin: 1.5rem 0; color: var(--fg);
}
.img-slot {
  border: 1px dashed var(--fg-3); background: var(--recessed);
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3);
  text-align: center; padding: 1rem;
}

/* ── A11y & modes ───────────────────────────────────────────────── */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--fg); color: var(--bg); padding: .8rem 1.2rem;
  font-family: var(--mono); text-transform: uppercase; font-size: .75rem; letter-spacing: .12em;
}
.skip:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .plan-shade { opacity: .85; } .plan-count { opacity: 1; } .plan-verify { opacity: .35; }
  .plan-flag-box, .plan-flag-text { opacity: 1; } .takeoff-stamp { opacity: 1; }
  .strike-line { width: 105%; }
  .hero-manual { opacity: .35; }
  .hero-auto { width: 100%; opacity: 1; }
  .hero-video .hero-media video { display: none; }
}

@media print {
  .site-head, .titleblock .cells, .btn, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
}

/* ══════════════════════════════════════════════════════════════════
   v4 BID-SET COMPONENTS
   ══════════════════════════════════════════════════════════════════ */

/* ── Hero: scroll-scrubbed film (image-as-canvas, text bottom-left) ─ */
.hero-scrub { position: relative; height: 260vh; }
@media (max-width: 700px) { .hero-scrub { height: 180vh; } }
.hero-scrub .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero-scrub canvas, .hero-scrub .hero-still {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #A99F8D;
}
.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0 var(--gutter) clamp(1.5rem, 5vh, 3.5rem);
}
.hero-copy .plate {
  max-width: 34rem; background: rgba(245,243,238,.92);
  border: 1px solid var(--line); border-left: 4px solid var(--accent-bright);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.hero-copy h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); letter-spacing: -.02em; margin-bottom: .35em; }
.hero-copy .lede { margin-bottom: 1.25rem; }
.hero-scrub .scroll-cue {
  position: absolute; right: var(--gutter); bottom: 1.25rem; z-index: 2;
  font-family: var(--mono); font-size: .62rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2);
  writing-mode: vertical-rl; display: flex; align-items: center; gap: .6rem;
}
.hero-scrub .scroll-cue::after { content: ''; width: 1px; height: 3.2rem; background: var(--fg-2); }

/* ── CTA garment 1: corner-bracket viewfinder ("Send us your set") ── */
.cta-view {
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 1rem 1.7rem; text-decoration: none; cursor: pointer;
  background: var(--fg); color: var(--bg); border: 0;
}
.cta-view i {
  position: absolute; width: 11px; height: 11px; font-style: normal;
  border: 0 solid var(--accent-bright); transition: transform .18s ease;
  pointer-events: none;
}
.cta-view i:nth-child(1) { top: -5px; left: -5px; border-top-width: 3px; border-left-width: 3px; transform: translate(-6px,-6px); }
.cta-view i:nth-child(2) { top: -5px; right: -5px; border-top-width: 3px; border-right-width: 3px; transform: translate(6px,-6px); }
.cta-view i:nth-child(3) { bottom: -5px; left: -5px; border-bottom-width: 3px; border-left-width: 3px; transform: translate(-6px,6px); }
.cta-view i:nth-child(4) { bottom: -5px; right: -5px; border-bottom-width: 3px; border-right-width: 3px; transform: translate(6px,6px); }
.cta-view:hover i, .cta-view:focus-visible i { transform: translate(0,0); }

/* ── CTA garment 2: takeoff-row ("Read the case study") ──────────── */
.cta-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: 1.2rem; width: 100%; max-width: 44rem;
  border: 1px solid var(--fg); background: var(--raised);
  padding: .95rem 1.3rem; text-decoration: none;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg);
  position: relative; overflow: hidden;
}
.cta-row::before {
  content: ''; position: absolute; inset: 0; background: var(--accent-bright);
  transform: scaleX(0); transform-origin: left center; transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.cta-row > * { position: relative; z-index: 1; }
.cta-row .row-no { color: var(--fg-3); }
.cta-row .row-label { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-row .row-count { font-weight: 500; }
.cta-row .row-arrow { transition: transform .2s ease; }
.cta-row:hover::before, .cta-row:focus-visible::before { transform: scaleX(1); }
.cta-row:hover, .cta-row:focus-visible { color: var(--accent-fg); }
.cta-row:hover .row-no, .cta-row:focus-visible .row-no { color: var(--accent-fg); }
.cta-row:hover .row-arrow { transform: translateX(4px); }

/* ── CTA garment 3: approval-stamp press ("Book a scoping call") ─── */
.btn-stamp {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  padding: .9rem 1.5rem; text-decoration: none; cursor: pointer;
  color: var(--accent); background: transparent;
  border: 3px double var(--accent);
  transition: transform .08s ease, background .12s ease, color .12s ease;
}
.btn-stamp:hover, .btn-stamp:focus-visible { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--accent-fg); }
.btn-stamp:active { transform: scale(.96) rotate(-2deg); }

/* ── Nav: mono sheet-number slides in on hover ──────────────────── */
.site-nav a[data-sheet], .nav-item > button[data-sheet] { position: relative; }
.site-nav a[data-sheet]::before, .nav-item > button[data-sheet]::before {
  content: attr(data-sheet);
  font-family: var(--mono); font-size: .58rem; font-weight: 500;
  letter-spacing: .08em; color: var(--accent);
  position: absolute; top: -.85em; left: 0;
  opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.site-nav a[data-sheet]:hover::before, .site-nav a[data-sheet]:focus-visible::before,
.nav-item > button[data-sheet]:hover::before, .nav-item:focus-within > button[data-sheet]::before,
.site-nav a[data-sheet][aria-current="page"]::before { opacity: 1; transform: translateY(0); }

/* ── Proof band: oversized takeoff tally (use inside .invert) ────── */
.tally { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .tally { grid-template-columns: repeat(4, 1fr); } }
.tally .row { background: var(--bg); padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.2rem, 2.5vw, 1.8rem); position: relative; }
.tally .row b {
  display: block; font-family: var(--disp); font-weight: 900;
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .95; letter-spacing: -.02em;
  color: var(--fg); font-variant-numeric: tabular-nums;
}
.tally .row b em { font-style: normal; color: var(--accent-bright); }
.tally .row .unit {
  display: block; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); margin-top: .7rem;
}
.tally .row .src {
  display: block; font-family: var(--mono); font-size: .62rem;
  letter-spacing: .06em; color: var(--fg-3); margin-top: .35rem;
}

/* ── How-we-work hover accordion slices ─────────────────────────── */
.slices { display: grid; border: 1px solid var(--fg); background: var(--raised); }
.slice {
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start;
  padding: clamp(1.3rem, 3vw, 1.9rem); position: relative; text-align: left;
  border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer;
  font: inherit; color: inherit; width: 100%;
}
.slice:first-child { border-top: 0; }
.slice .sl-no {
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  color: var(--fg-3); padding-top: .35rem;
}
.slice h3 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.7rem); }
.slice .sl-body { grid-column: 2; max-height: 0; overflow: hidden; transition: max-height .32s cubic-bezier(.4,0,.2,1); }
.slice .sl-body p { margin: .8rem 0 .2rem; }
.slice::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent-bright); transform: scaleY(0); transform-origin: top;
  transition: transform .22s ease;
}
.slice:hover::after, .slice.open::after { transform: scaleY(1); }
.slice.open .sl-body { max-height: 14rem; }
.slice:hover h3, .slice.open h3 { color: var(--accent); }

/* ── Products diptych (asymmetric: Luserne dominant) ────────────── */
.diptych { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .diptych { grid-template-columns: 3fr 2fr; } }
.diptych .panel { background: var(--raised); padding: clamp(1.6rem, 4vw, 2.6rem); display: flex; flex-direction: column; gap: 1rem; position: relative; text-decoration: none; color: var(--fg); }
.diptych .panel:hover { background: var(--bg); }
.diptych .panel .plate-img { border: 1px solid var(--line); margin-bottom: .4rem; }
.diptych .panel .plate-img img { width: 100%; }
.diptych .panel h3 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.diptych .panel .go {
  margin-top: auto; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.diptych .panel:hover .go { text-decoration: underline; text-underline-offset: 4px; }

/* ── Icon tiles (sliced sheet, paper ground baked in) ───────────── */
.icon-tile { width: 56px; height: 56px; mix-blend-mode: multiply; }
.invert .icon-tile { mix-blend-mode: normal; border: 1px solid var(--line); }

/* ── Image plates: hairline frame + sheet caption ───────────────── */
.plate-fig { border: 1px solid var(--line); background: var(--raised); margin: 0; }
.plate-fig img { width: 100%; }
.plate-fig figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3);
  border-top: 1px solid var(--line); padding: .55rem .8rem;
}

/* ── Etymology thread ───────────────────────────────────────────── */
.etym { border-left: 1px solid var(--line); padding-left: clamp(1.2rem, 3vw, 2rem); }
.etym .word { font-family: var(--disp); font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.01em; }
.etym .gloss { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; color: var(--fg-3); text-transform: uppercase; margin: .3rem 0 1rem; }

/* ── v4 motion prefs ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-scrub .pin { position: relative; height: auto; min-height: 70vh; }
  .hero-scrub canvas { display: none; }
  .slice .sl-body { max-height: none; }
}
@media (max-width: 640px) {
  .cta-row { grid-template-columns: auto 1fr auto; }
  .cta-row .row-count { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   v5 FIRM-FRONT COMPONENTS
   The homepage steps back from the bid set: Emendare is the firm,
   the verticals are the rooms. Same materials, neutral voice.
   ══════════════════════════════════════════════════════════════════ */

/* ── Practice triptych: three rooms, equal billing ───────────────── */
.triptych { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 820px) { .triptych { grid-template-columns: repeat(3, 1fr); } }
.triptych .panel {
  background: var(--raised); padding: clamp(1.4rem, 3vw, 2rem);
  display: flex; flex-direction: column; gap: .9rem;
  text-decoration: none; color: var(--fg); position: relative;
  border-top: 4px solid var(--accent-bright);
}
.triptych .panel:hover { background: var(--bg); }
.triptych .panel .plate-img { border: 1px solid var(--line); }
.triptych .panel .plate-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.triptych .panel h3 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.7rem); text-transform: uppercase; }
.triptych .panel .go {
  margin-top: auto; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.triptych .panel:hover .go { text-decoration: underline; text-underline-offset: 4px; }

/* ── Image in the video-ready hero media slot ────────────────────── */
.hero-video .hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .22; display: block; }
