/* Ironstack — seal identity site
   Palette (locked, no accent): ink / cream / paper / reversed / muted / rule */
:root {
  --ink: #17150F;
  --cream: #F6F3EC;
  --paper: #FBF8F1;
  --rev: #EAE3D2;
  --muted: #8A8374;
  --muted-d: #9C947F;
  --rule: #DCD5C4;
  --body: #3F3A2F;
  --serif: 'Fraunces', serif;
  --garamond: 'EB Garamond', serif;
  --sans: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ---------- page transitions (cross-document view transitions) ----------
   Browsers without support (Firefox) simply navigate instantly.
   One continuous cross-fade, the new page settling up a touch. No dead gap
   (a blank beat reads as a flicker) and no large transforms (two full-page
   snapshots at different scroll depths smear when they fly). main.js skips
   the transition on back/forward, where it would fight scroll restoration. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms ease-out both vt-out; }
::view-transition-new(root) { animation: 360ms cubic-bezier(.16, .7, .25, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
/* the nav transitions as its own group: identical on both pages, so it appears to stay put */
.nav { view-transition-name: site-nav; }
::view-transition-old(site-nav), ::view-transition-new(site-nav) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-group(*) { animation: none; }
}
html, body { overflow-x: hidden; overflow-x: clip; }
/* iOS Safari paints the status-bar / Dynamic Island area from the html background; without this it falls back to white.
   body must stay transparent: an opaque body background paints over the z-index:-1 seal watermarks */
html { background: var(--cream); }
body { background: transparent; color: var(--ink); font-family: var(--sans); line-height: 1.7; font-size: 16px; }

/* ---------- background texture (seal watermarks) ---------- */
.hero, #method, #proof, #contact, .legal { position: relative; }
.bg-mark { position: absolute; pointer-events: none; z-index: -1; background-repeat: no-repeat; background-size: contain; aspect-ratio: 1; }
.bg-seal-hero { width: min(74vw, 960px); right: max(-30vw, -400px); top: -130px; background-image: url('../assets/ironstack-seal-full-ink.svg'); opacity: 0.05; }
.bg-seal-method { width: 820px; left: -400px; bottom: -140px; background-image: url('../assets/ironstack-seal-full-ink.svg'); opacity: 0.045; }
.bg-seal-contact { width: 900px; right: -430px; bottom: -280px; background-image: url('../assets/ironstack-seal-full-ink.svg'); opacity: 0.05; }
.bg-diamond { position: absolute; pointer-events: none; z-index: -1; width: 22px; aspect-ratio: 10 / 13; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M5 0 L10 6.5 L5 13 L0 6.5 Z" fill="%2317150F"/></svg>') no-repeat center/contain; opacity: 0.08; }
@media (max-width: 860px) {
  .bg-seal-method, .bg-seal-contact { display: none; }
  .bg-seal-hero { width: 120vw; right: -60vw; top: -80px; opacity: 0.04; }
}
img { max-width: 100%; }
a { color: inherit; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 64px);
  /* with viewport-fit=cover the page extends behind the Dynamic Island; push
     the nav's own (theme-reactive) background up to fill that strip while
     keeping the logo and links clear of it */
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 21px; }
.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 30px); font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--body); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { border: 1px solid var(--ink); border-radius: 10px; padding: 7px 16px; color: var(--ink) !important; }
.nav-cta:hover { background: var(--ink); color: var(--rev) !important; }
.switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; background: transparent;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); cursor: pointer; transition: border-color .18s ease, color .18s ease; }
.switch:hover { border-color: var(--ink); }
.switch .on { color: var(--ink); font-weight: 500; }
.switch .sep { font-size: 6px; opacity: .55; transform: translateY(-0.5px); }
.switch-icon { font-size: 12.5px; padding: 5px 11px; line-height: 1.2; }
.switch-icon:hover { color: var(--ink); }
.nav-burger { display: none; position: relative; width: 42px; height: 42px; padding: 0; border: none; background: none; cursor: pointer; color: var(--ink); }
/* three engraved lines that fold into a closing mark; the whole icon turns as it does */
.nav-burger .burger { position: absolute; inset: 0; transition: transform .5s cubic-bezier(.2, .6, .2, 1); }
.nav-burger .burger span {
  position: absolute; left: 50%; top: 50%; width: 21px; height: 1.6px;
  background: currentColor; border-radius: 2px;
  transition: transform .42s cubic-bezier(.3, 1.4, .3, 1), opacity .28s ease;
}
.nav-burger .burger span:nth-child(1) { transform: translate(-50%, calc(-50% - 6.5px)); }
.nav-burger .burger span:nth-child(2) { transform: translate(-50%, -50%); }
.nav-burger .burger span:nth-child(3) { transform: translate(-50%, calc(-50% + 6.5px)); }
.nav-burger.open .burger { transform: rotate(90deg); }
.nav-burger.open .burger span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.nav-burger.open .burger span:nth-child(2) { opacity: 0; transform: translate(-50%, -50%) scaleX(0.25); }
.nav-burger.open .burger span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(84px, 12vw, 160px) 20px clamp(56px, 7vw, 96px); max-width: 1060px; margin: 0 auto; }
.kicker { font-family: var(--garamond); font-size: 13px; letter-spacing: 5px; color: var(--muted); margin-bottom: 26px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 6.4vw, 72px); line-height: 1.08; letter-spacing: -0.5px; }
.hero-sub { max-width: 640px; margin: 26px auto 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--body); }
.hero-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.btn { display: inline-block; text-decoration: none; font-size: 15px; padding: 13px 28px; border-radius: 10px; border: 1px solid var(--ink); font-family: var(--sans); cursor: pointer; }
.btn-primary { background: var(--ink); color: var(--rev); }
.btn-primary:hover { background: #2A2619; }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--paper); }

/* showcase video (full-scene mockup export) */
.showcase { margin: clamp(46px, 6vw, 76px) auto 0; max-width: 900px; border-radius: 12px; overflow: hidden; box-shadow: 0 28px 80px -32px rgba(23, 21, 15, 0.5); }
.showcase-video { display: block; width: 100%; height: auto; }

/* ---------- manifesto ---------- */
/* the manifesto is a full-width paper band in the om-en-om striping; its content stays a 760px column */
.manifesto { background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(64px, 8vw, 110px) 24px; text-align: center; }
.manifesto > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.diamond-rule { display: flex; align-items: center; gap: 16px; color: var(--ink); margin-bottom: 36px; }
.diamond-rule::before, .diamond-rule::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.diamond-rule span { font-size: 12px; }
.manifesto blockquote { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 3vw, 30px); line-height: 1.4; }
.manifesto p { margin-top: 24px; color: var(--body); font-size: 16.5px; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 8vw, 110px) clamp(20px, 5vw, 64px); max-width: 1120px; margin: 0 auto; }
.section-alt { max-width: none; background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
/* alt children get the same inner column as a plain section (1120 minus its side
   padding, box-sizing border-box), so left edges line up across the striping */
.section-alt > * { max-width: calc(1120px - 2 * clamp(20px, 5vw, 64px)); margin-left: auto; margin-right: auto; }
/* section-sub, prose and faq are narrower than the 1120px column, so auto margins would center them; pin their left edge to the column instead */
.section-alt > .section-sub, .section-alt > .prose, .section-alt > .faq { margin-left: max(0px, calc((100% - (1120px - 2 * clamp(20px, 5vw, 64px))) / 2)); margin-right: auto; }
.section-title { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 14px; }
.section-sub { max-width: 640px; color: var(--body); margin-bottom: 44px; }

/* method */
.phases { list-style: none; max-width: 780px; }
.phases li { display: flex; gap: 26px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.phases li:last-child { border-bottom: none; }
.phase-no { font-family: var(--garamond); font-size: 20px; color: var(--muted); min-width: 44px; padding-top: 2px; text-align: center; border-right: 1px solid var(--rule); margin-right: 4px; }
.phases h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin-bottom: 6px; }
.phases p { color: var(--body); font-size: 15.5px; }

/* services */
.svc-group { margin-bottom: 40px; }
.svc-group-label { font-family: var(--garamond); font-size: 12px; letter-spacing: 3.5px; color: var(--muted); margin-bottom: 16px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 34px 40px; }
.svc { position: relative; border-top: 2px solid var(--ink); padding: 16px 2px 26px 0; overflow: hidden; }
.svc-no { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.svc h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; margin: 10px 0 8px; }
.svc p { color: var(--body); font-size: 14.5px; }
.svc .stamp { position: absolute; right: 0; bottom: 4px; width: 96px; height: 96px; opacity: 0; transform: scale(1.7) rotate(-16deg); pointer-events: none; }
@media (hover: hover) {
  .svc:hover .stamp { animation: stamp-in .5s cubic-bezier(.16, 1.1, .3, 1) forwards; }
}
/* touch devices: the seal stamps on scroll instead of on tap */
@media (hover: none) {
  .svc.stamped .stamp { animation: stamp-in .5s cubic-bezier(.16, 1.1, .3, 1) forwards; }
}
.svc-featured { background: var(--ink); border-radius: 10px; padding: 24px 28px 30px; border-top-color: var(--ink); }
.svc-featured p { max-width: 72ch; }
.svc-featured .svc-no { color: var(--muted-d); }
.svc-featured h3 { color: var(--paper); }
.svc-featured p { color: var(--rev); }
.svc-featured .stamp-embossed { position: absolute; right: 14px; bottom: 10px; width: 104px; height: 104px; opacity: .15; transform: rotate(-8deg); pointer-events: none; }
.services-note { margin-top: 30px; font-family: var(--garamond); font-style: italic; color: var(--muted); font-size: 15px; }

/* proof */
.register { position: relative; max-width: 760px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 32px 38px 28px; overflow: hidden; }
.register-head { font-family: var(--garamond); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.register-row { display: flex; align-items: baseline; gap: 14px; padding: 13px 0; }
.register-no { font-family: var(--garamond); width: 30px; flex-shrink: 0; color: var(--muted); font-size: 15px; }
.register-k { font-size: 15px; white-space: nowrap; }
.register-dots { flex: 1; border-bottom: 1px dotted #C4BCA6; transform: translateY(-4px); min-width: 24px; }
.register-v { font-family: var(--garamond); font-style: italic; font-size: 15.5px; color: var(--muted); white-space: nowrap; }
.register-foot { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--rule); text-align: center; font-family: var(--garamond); letter-spacing: 2.6px; font-size: 12.5px; text-transform: uppercase; color: var(--muted); }
.register .stamp-doc { position: absolute; right: 24px; bottom: 46px; width: 122px; height: 122px; opacity: 0; transform: scale(1.7) rotate(-14deg); pointer-events: none; }
.register.stamped .stamp-doc { animation: stamp-in .55s cubic-bezier(.16, 1.1, .3, 1) forwards; }
@media (max-width: 560px) {
  .register { padding: 24px 20px 22px; }
  .register-row { flex-wrap: wrap; gap: 8px; }
  .register-dots { display: none; }
  .register-v { margin-left: auto; }
}
.proof-line { margin-top: 28px; max-width: 720px; color: var(--body); font-size: 15.5px; }

/* about — interactive tilt card */
.about { display: grid; grid-template-columns: 320px 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.tilt-card {
  position: relative; aspect-ratio: 9 / 12; max-width: 340px;
  border-radius: 16px;
  box-shadow: 0 20px 50px -28px rgba(23, 21, 15, 0.4);
  transform-style: preserve-3d; will-change: transform;
  perspective: 1100px;
}
/* the spinner: on first reveal the card whips through one and a half turns and
   decelerates to rest; clicking the card replays it */
.card-spin {
  position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform;
}
.about-photo.reveal.in .card-spin { animation: card-spin-in 2.9s cubic-bezier(.17, .74, .22, 1) both; }
@keyframes card-spin-in { from { transform: rotateY(540deg); } to { transform: rotateY(0deg); } }
/* the card is a closed box: four ink walls span the 15px between the faces.
   Inset 14px past the corner radius; the interior slabs cover the corners. */
.card-side {
  position: absolute; background: var(--ink);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.side-l, .side-r { top: 14px; bottom: 14px; width: 15px; }
.side-t, .side-b { left: 14px; right: 14px; height: 15px; }
.side-l { left: 0; transform-origin: left center; transform: rotateY(90deg); }
.side-r { right: 0; transform-origin: right center; transform: rotateY(-90deg); }
.side-t { top: 0; transform-origin: center top; transform: rotateX(-90deg); }
.side-b { bottom: 0; transform-origin: center bottom; transform: rotateX(90deg); }
/* the glass is laminated on: translucent walls close the 10px gap to the face */
.glass-side {
  position: absolute; background: rgba(255, 255, 255, 0.10);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.gside-l, .gside-r { top: 14px; bottom: 14px; width: 10px; }
.gside-t, .gside-b { left: 14px; right: 14px; height: 10px; }
.gside-l { left: 0; transform-origin: left center; transform: rotateY(-90deg); }
.gside-r { right: 0; transform-origin: right center; transform: rotateY(90deg); }
.gside-t { top: 0; transform-origin: center top; transform: rotateX(90deg); }
.gside-b { bottom: 0; transform-origin: center bottom; transform: rotateX(-90deg); }
/* the front of the card hides when it faces away */
.tilt-inner, .tilt-glass, .tilt-glare, .tilt-tag, .tilt-tag * {
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
/* interior slabs: ink like the walls; they fill the rounded corners the walls
   cannot reach, tucked just inside the 15px body */
.card-spin::before {
  content: ''; position: absolute; inset: 0; border-radius: 16px;
  background: var(--ink);
  transform: translateZ(-14px); z-index: -2;
  box-shadow: 0 30px 54px -24px rgba(23, 21, 15, 0.5);
}
.card-spin::after {
  content: ''; position: absolute; inset: 0; border-radius: 16px;
  background: var(--ink);
  transform: translateZ(-8px); z-index: -1;
}
.tilt-inner { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; transform-style: preserve-3d; background: var(--cream); border: 1px solid var(--rule); }
.tilt-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tilt-video { opacity: 0; transition: opacity .6s ease; }
.tilt-video.on { opacity: 1; }
.tilt-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tilt-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(23, 21, 15, 0.22), rgba(23, 21, 15, 0.04) 45%, transparent 70%); pointer-events: none; }
/* lens glare: a specular hotspot and a sweeping streak chase the light as the card tilts;
   driven by --gx/--gy/--gs set from the mouse and gyro handlers */
/* a glass pane floats 10px above the print: bright rim, two standing reflections.
   It parallaxes against the photo on tilt, which is what sells the depth. */
.tilt-glass {
  position: absolute; inset: 0; border-radius: 16px; pointer-events: none;
  transform: translateZ(10px);
  background:
    linear-gradient(118deg, transparent 28%, rgba(255, 255, 255, 0.10) 38%, rgba(255, 255, 255, 0.02) 47%, transparent 54%),
    linear-gradient(118deg, transparent 60%, rgba(255, 255, 255, 0.06) 69%, transparent 78%);
  border: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .tilt-glass { border-color: rgba(255, 255, 255, 0.22); }
/* a ghost of the seal sits IN the glass, top right, and brightens as the light passes —
   the security hologram of an identity card */
.tilt-glass::after {
  content: ''; position: absolute; right: 16px; top: 16px; width: 62px; height: 62px;
  background: url('../assets/ironstack-seal-full-cream.svg') no-repeat center / contain;
  opacity: calc(0.10 + var(--gs, 0) * 0.24);
  transition: opacity .35s ease;
}
/* the moving glare is a reflection ON the glass, so it rides the same plane.
   NO blend mode here: a blended child forces the browser to flatten the card's
   whole 3D context, killing every translateZ inside it */
.tilt-glare {
  position: absolute; inset: 0; pointer-events: none;
  border-radius: 16px; transform: translateZ(13px);
  background:
    radial-gradient(circle 210px at var(--gx, 50%) var(--gy, 42%), rgba(255, 251, 240, 0.38), rgba(255, 251, 240, 0.08) 45%, transparent 72%),
    linear-gradient(105deg, transparent calc(var(--gx, 50%) - 15%), rgba(255, 251, 240, 0.2) var(--gx, 50%), transparent calc(var(--gx, 50%) + 15%));
  opacity: calc(var(--gs, 0) * 0.85);
  transition: opacity .45s ease;
}
[data-theme="dark"] .tilt-glare { opacity: calc(var(--gs, 0) * 0.55); }
/* the back of the card: an ink certificate face. Sits at the body's far side,
   flipped, so it reads correctly when the spin brings it around. */
.card-back {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  background: var(--ink);
  transform: rotateY(180deg) translateZ(15px);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center;
}
.card-back::before {
  content: ''; position: absolute; inset: 10px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--rev) 30%, transparent); pointer-events: none;
}
.card-back::after {
  content: ''; position: absolute; inset: 15px; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--rev) 14%, transparent); pointer-events: none;
}
.card-back img { width: clamp(120px, 44%, 148px); height: auto; opacity: 0.94; }
.card-back-mono {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 210px; color: var(--rev);
  opacity: 0.05; pointer-events: none; user-select: none;
}
.card-back-line { font-family: var(--garamond); font-size: 11px; letter-spacing: 3.2px; color: var(--rev); opacity: 0.85; }
.card-back-city { font-family: var(--garamond); font-size: 9.5px; letter-spacing: 2.6px; color: var(--muted-d); }

/* the tag is a 3D stack floating above the card: plate lowest, then email,
   subtitle, name, seal on top; each layer parallaxes at its own rate on tilt */
/* modest Z depths: enough for parallax on tilt, small enough that the resting
   perspective projection does not drift the layers off the plate */
.tilt-tag {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 18px 13px;
  transform-style: preserve-3d; transform: translateZ(10px);
}
.tag-plate {
  position: absolute; inset: 0; border-radius: 12px;
  background: rgba(251, 248, 241, 0.78); border: 1px solid rgba(23, 21, 15, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 34px -18px rgba(23, 21, 15, 0.5);
  transform: translateZ(0);
}
.tilt-tag-text { display: flex; flex-direction: column; min-width: 0; transform-style: preserve-3d; }
.tilt-tag-text strong { font-family: var(--serif); font-weight: 600; font-size: 14px; line-height: 1.25; white-space: nowrap; color: var(--ink); transform: translateZ(16px); text-shadow: 0 5px 12px rgba(23, 21, 15, 0.22); }
.tilt-tag-text strong .tag-diamond { font-size: 7.5px; vertical-align: 2px; }
.tilt-tag-text span { font-family: var(--garamond); font-size: 9.5px; line-height: 1.45; letter-spacing: 2px; color: var(--muted); margin: 4px 0; transform: translateZ(10px); text-shadow: 0 3px 8px rgba(23, 21, 15, 0.16); }
.tilt-tag-text a { font-size: 11.5px; line-height: 1.2; color: var(--body); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translateZ(6px); text-shadow: 0 3px 8px rgba(23, 21, 15, 0.14); }
.tilt-tag-text a:hover { color: var(--ink); }
.tag-seal { flex-shrink: 0; opacity: 0.9; transform: translateZ(24px) translate(-2px, -3px); filter: drop-shadow(0 6px 8px rgba(23, 21, 15, 0.35)); }
.about-text p { color: var(--body); margin-bottom: 16px; font-size: 16px; }
.about-text em { font-family: var(--garamond); font-size: 1.06em; }
.about-links { display: flex; gap: 14px; align-items: center; margin-top: 24px; font-size: 14.5px; }
.about-links span { font-size: 9px; color: var(--muted); }
.about-links a { color: var(--ink); }

/* contact */
.contact-wrap { display: grid; grid-template-columns: 1fr 300px; gap: clamp(28px, 5vw, 64px); }
.lead-form label { display: block; margin-bottom: 22px; font-size: 13px; letter-spacing: 0.5px; color: var(--body); }
.lead-form label > span:first-child {
  display: block; margin-bottom: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
/* ledger-style fields: no boxes, a single bottom hairline, flush with the register aesthetic */
.lead-form input, .lead-form textarea, .lead-form select {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--rule); border-radius: 0;
  padding: 10px 2px; font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.lead-form textarea { border: 1px solid var(--rule); padding: 12px 14px; resize: vertical; }
.lead-form select { appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer; padding-right: 20px; }
.lead-form select:required:invalid { color: var(--muted); }
.lead-form option { color: var(--ink); background: var(--paper); }
/* the select's own arrow is suppressed; a hairline chevron takes its place, kin to the mega-menu's */
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: ''; position: absolute; right: 3px; top: 50%; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg); pointer-events: none; transition: border-color .18s ease;
}
.lead-form input:focus, .lead-form select:focus { outline: none; border-bottom-color: var(--ink); }
.lead-form textarea:focus { outline: none; border-color: var(--ink); }
.select-wrap:focus-within::after { border-color: var(--ink); }
/* phone splits into a narrow country-code picker and the number itself */
.phone-group { display: flex; gap: 14px; align-items: flex-end; }
.phone-group .cc-picker { flex: 0 0 auto; position: relative; }
.phone-group select { width: auto; }
.phone-group input[type="tel"] { flex: 1 1 auto; min-width: 0; }
/* no-JS fallback keeps the native select, dressed with the usual chevron */
.cc-picker:not(.enhanced)::after {
  content: ''; position: absolute; right: 3px; top: 50%; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.cc-picker.enhanced > select { display: none; }
.cc-btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: transparent; border: none; border-bottom: 1px solid var(--rule); border-radius: 0;
  padding: 10px 2px; font-family: var(--sans); font-size: 15px; color: var(--ink);
  transition: border-color .16s ease;
}
.cc-btn::after {
  content: ''; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: border-color .18s ease;
}
.cc-btn:hover { border-bottom-color: #B8B09C; }
.cc-btn:focus { outline: none; border-bottom-color: var(--ink); }
.cc-btn:hover::after, .cc-btn:focus::after { border-color: var(--ink); }
.lead-form label.invalid .cc-btn { border-bottom-color: var(--err); }
.lead-form label.valid .cc-btn { border-bottom-color: var(--ok); }
/* the picker panel: a search field on top, the country register scrolling below it;
   dressed like .select-menu so the form's dropdowns read as one family */
.cc-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 70; display: block;
  width: min(300px, 78vw);
  background: color-mix(in srgb, var(--cream) 97%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  box-shadow: 0 26px 40px -28px rgba(23, 21, 15, 0.45);
}
.cc-panel[hidden] { display: none; }
.cc-search {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--rule);
  padding: 11px 14px; font-family: var(--sans); font-size: 14px; color: var(--ink);
}
.cc-search:focus { outline: none; border-bottom-color: var(--ink); }
.cc-list { list-style: none; margin: 0; padding: 6px 0; max-height: 234px; overflow-y: auto; overscroll-behavior: contain; }
.cc-list li {
  position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 9px 16px 9px 34px; cursor: pointer; font-family: var(--sans); font-size: 14.5px; color: var(--body);
  transition: color .14s ease, background .14s ease;
}
.cc-list li[hidden] { display: none; }
.cc-list li .cc-code { font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px; color: var(--muted); }
.cc-list li:hover, .cc-list li.active { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.cc-list li[aria-selected="true"], .cc-list li[aria-selected="true"] .cc-code { color: var(--ink); }
.cc-list li[aria-selected="true"]::before {
  content: '◆'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 8px; color: var(--muted);
}
[data-theme="dark"] .cc-panel { box-shadow: 0 26px 40px -28px rgba(0, 0, 0, 0.8); }
/* Chrome/Safari autofill paints its own background; force it back to the page ground */
.lead-form input:-webkit-autofill,
.lead-form input:-webkit-autofill:hover,
.lead-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0px 1000px var(--cream) inset;
  box-shadow: 0 0 0px 1000px var(--cream) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.form-status { margin-top: 14px; font-family: var(--garamond); font-style: italic; font-size: 15px; color: var(--muted); min-height: 22px; }
.contact-aside { border-left: 1px solid var(--rule); padding-left: clamp(20px, 3vw, 40px); }
.contact-direct { font-size: 14px; color: var(--body); margin-bottom: 12px; }
.contact-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.contact-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; color: var(--muted); flex-shrink: 0; }
.contact-mail { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); width: fit-content; transition: border-color .18s ease; }
.contact-mail:hover { border-color: var(--ink); }
.contact-city { font-family: var(--garamond); font-size: 14px; color: var(--muted); margin-top: 8px; }

/* footer */
.footer { background: var(--ink); color: var(--rev); text-align: center; padding: 64px 24px 44px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.footer-line { font-family: var(--garamond); font-size: 12px; letter-spacing: 4px; color: var(--muted-d); }
.footer-links { display: flex; gap: 26px; font-size: 13.5px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--rev); text-decoration: none; border-bottom: 1px solid #3A3629; }
.footer-links a:hover { border-color: var(--rev); }
.footer-icons { display: flex; gap: 22px; align-items: center; justify-content: center; }
.footer-icons a { color: var(--muted-d); display: flex; transition: color .18s ease; }
.footer-icons a:hover { color: var(--rev); }
.footer-icons svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.footer-fine { font-size: 12px; color: #6B6455; max-width: 420px; }

/* ---------- skip link ---------- */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--rev); padding: 10px 18px; border-radius: 0 0 8px 8px; text-decoration: none; font-size: 14px; transition: top .2s ease; }
.skip-link:focus { top: 0; }

/* ---------- exit clause ---------- */
.exit { background: var(--ink); color: var(--cream-d, #EAE3D2); padding: clamp(70px, 9vw, 120px) 24px; }
.exit-inner { max-width: 680px; margin: 0 auto; text-align: center; }
.exit-diamond { display: block; color: #9C947F; font-size: 13px; margin-bottom: 26px; }
.exit h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 3.6vw, 40px); color: #EAE3D2; margin-bottom: 22px; }
.exit p { color: #B7AF9C; font-size: 16.5px; margin-bottom: 14px; }
.exit .exit-line { font-family: var(--garamond); font-style: italic; font-size: 19px; color: #EAE3D2; margin-top: 26px; }

/* ---------- faq ---------- */
.faq { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary {
  cursor: pointer; list-style: none; position: relative;
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  padding: 22px 44px 22px 0; transition: color .18s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; translate: 0 -50%;
  font-family: var(--garamond); font-weight: 500; font-size: 26px; color: var(--muted);
  transition: transform .25s ease, color .18s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--ink); }
.faq-item summary:hover { color: var(--body); }
.faq-item summary:hover::after { color: var(--ink); }
.faq-item p { color: var(--body); font-size: 15.5px; padding: 0 44px 24px 0; max-width: 68ch; }

/* ---------- how it starts ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px 40px; margin-bottom: 52px; }
.step { display: flex; gap: 16px; border-top: 1px solid var(--ink); padding: 16px 2px 6px 0; }
.step-no { font-family: var(--garamond); font-size: 22px; color: var(--muted); line-height: 1.3; }
.step h3 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.step p { color: var(--body); font-size: 14px; line-height: 1.6; }

/* ---------- interaction states ---------- */
/* keyboard focus only: mouse clicks never show rings */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* nav links: center-out underline. Painted (background-size), not transformed:
   a scaleX'd hairline sits on a compositor layer mid-animation and antialiases
   lighter than at rest; a painted one renders identically every frame */
.nav-links a:not(.nav-cta) {
  padding-bottom: 3px;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat center bottom / 0% 1.5px;
  transition: color .18s ease, background-size .22s cubic-bezier(.2, .6, .2, 1);
}
.nav-links a:not(.nav-cta):hover { background-size: 100% 1.5px; }

/* nav CTA + buttons: lift on hover, settle on press */
.nav-cta { transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-cta:active { transform: scale(0.97); }
.btn { transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(23, 21, 15, 0.5); }
.btn:active { transform: translateY(0); box-shadow: 0 3px 10px -7px rgba(23, 21, 15, 0.45); transition-duration: .07s; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* brand: seal breathes slightly */
.nav-brand img { transition: transform .3s ease; }
.nav-brand:hover img { transform: scale(1.07); }

/* language toggle: quiet chip */
.lang-toggle { border: 1px solid transparent; border-radius: 7px; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.lang-toggle:hover { color: var(--ink); border-color: var(--rule); background: var(--paper); }
.lang-toggle:active { transform: scale(0.94); }
.nav-burger { transition: transform .15s ease; }
.nav-burger:active { transform: scale(0.9); }

/* nav: settles in from above on first paint; desktop links follow one by one.
   Plays once per session — later navigations keep the nav still (html gets .nav-seen pre-paint) */
@keyframes nav-in { from { opacity: 0; transform: translateY(-14px); } }
@keyframes nav-in-fade { from { opacity: 0; } }
.nav { animation: nav-in .6s cubic-bezier(.2, .6, .2, 1) both; }
.nav-seen .nav, .nav-seen .nav-links > * { animation: none; }
@media (min-width: 721px) {
  .nav-links > * { animation: nav-in .5s cubic-bezier(.2, .6, .2, 1) backwards; }
  /* Services only fades: a transform here would make .has-mega the containing
     block for the absolute mega panel and misplace it during the entrance */
  .nav-links > .has-mega { animation-name: nav-in-fade; }
  .nav-links > :nth-child(1) { animation-delay: .08s; }
  .nav-links > :nth-child(2) { animation-delay: .13s; }
  .nav-links > :nth-child(3) { animation-delay: .18s; }
  .nav-links > :nth-child(4) { animation-delay: .23s; }
  .nav-links > :nth-child(5) { animation-delay: .28s; }
  .nav-links > :nth-child(6) { animation-delay: .34s; }
  .nav-links > :nth-child(7) { animation-delay: .40s; }
  .nav-links > :nth-child(8) { animation-delay: .44s; }
}

/* text links: underline thickens/fills */
.about-links a, .footer-links a { text-decoration: none; border-bottom: 1px solid var(--rule); transition: border-color .18s ease, color .18s ease; padding-bottom: 1px; }
.about-links a:hover { border-color: var(--ink); }
.footer-links a { border-bottom-color: #3A3629; }
.footer-links a:hover { border-color: var(--rev); }
.contact-mail { transition: border-color .18s ease; }

/* form fields: hover hints, focus confirms */
.lead-form input, .lead-form textarea, .lead-form select { transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.lead-form input:hover, .lead-form textarea:hover, .lead-form select:hover { border-color: #B8B09C; }
.lead-form input:focus, .lead-form select:focus { border-bottom-color: var(--ink); outline: none; }
.lead-form textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 21, 15, 0.07); outline: none; }
.lead-form label:focus-within > span:first-child { color: var(--ink); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }
/* the portrait card gets a presentation instead: it settles out of a 3D turn */
.about-photo.reveal { transform: none; transition: opacity .7s cubic-bezier(.2,.6,.2,1); }
/* no fill-forward: once the entrance ends the animation must release the transform,
   or it would override the mouse and gyro tilt forever */
.about-photo.reveal.in { animation: card-present 1.1s cubic-bezier(.16, .7, .25, 1); }
@keyframes card-present {
  from { opacity: 0; transform: perspective(1000px) translateY(36px) rotateX(8deg) rotateY(-13deg) scale3d(.94, .94, .94); }
  to   { opacity: 1; transform: perspective(1000px) translateY(0) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .about-photo.reveal.in { animation: none; }
  .card-spin { animation: none; }
  .btn:hover, .btn:active, .nav-brand:hover img, .nav-cta:active, .lang-toggle:active { transform: none; }
  .nav, .nav-links > * { animation: none; }
  .nav-burger .burger, .nav-burger .burger span { transition: none; }
  .nav-links a:not(.nav-cta) { transition: color .18s ease; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { width: min(300px, 100%); margin: 0 auto; }
  .contact-wrap { grid-template-columns: 1fr; }
  .contact-aside { border-left: none; border-top: 1px solid var(--rule); padding: 24px 0 0; }
}
@media (max-width: 720px) {
  .nav-burger { display: block; }

  /* the panel: a curtain that draws down from under the header rule */
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-flow: row wrap; align-items: center; gap: 0 12px;
    padding: 8px 28px 24px;
    background: var(--cream);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 36px 46px -34px rgba(23, 21, 15, 0.4);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .55s cubic-bezier(.2, .6, .2, 1), visibility 0s linear .55s;
  }
  .nav-links.open {
    clip-path: inset(0 0 -90px 0);
    visibility: visible;
    transition: clip-path .55s cubic-bezier(.2, .6, .2, 1);
  }
  [data-theme="dark"] .nav-links { box-shadow: 0 36px 46px -34px rgba(0, 0, 0, 0.85); }

  /* links become an editorial index: full-width rows over hairlines */
  .nav-links > a:not(.nav-cta) { width: 100%; padding: 10px 0; font-size: 15px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); }
  .nav-links a:not(.nav-cta) { background-image: none; }
  .nav-cta { width: 100%; text-align: center; padding: 11px 16px; margin-top: 14px; }

  /* the switches sit first, always in reach, with the diamond rule closing their row */
  .nav-links .switch { order: -2; margin: 12px 0 2px; }
  .nav-links::after {
    content: '◆'; order: -1; width: 100%; text-align: center;
    font-size: 7px; line-height: 1; color: var(--muted); margin: 12px 0 8px;
    background:
      linear-gradient(var(--rule), var(--rule)) no-repeat left center / calc(50% - 22px) 1px,
      linear-gradient(var(--rule), var(--rule)) no-repeat right center / calc(50% - 22px) 1px;
  }

  /* each row settles in a beat after the curtain passes it */
  .nav-links > *, .nav-links::after { opacity: 0; transform: translateY(-14px); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .6, .2, 1); }
  .nav-links.open > *, .nav-links.open::after { opacity: 1; transform: none; }
  .nav-links.open .switch { transition-delay: .08s; }
  .nav-links.open::after { transition-delay: .12s; }
  .nav-links.open > :nth-child(1) { transition-delay: .16s; }
  .nav-links.open > :nth-child(2) { transition-delay: .20s; }
  .nav-links.open > :nth-child(3) { transition-delay: .24s; }
  .nav-links.open > :nth-child(4) { transition-delay: .28s; }
  .nav-links.open > :nth-child(5) { transition-delay: .32s; }
  .nav-links.open > :nth-child(6) { transition-delay: .36s; }

  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .nav-links, .nav-links > *, .nav-links::after { transition: none; }
  .nav-links > *, .nav-links::after { opacity: 1; transform: none; }
}
/* set by main.js when a curtain tap navigates away: the close must be instant
   so the page-transition snapshot never catches it half-drawn */
.nav-links.no-anim, .nav-links.no-anim > *, .nav-links.no-anim::after { transition: none !important; }
.nav-burger.no-anim .burger, .nav-burger.no-anim .burger span { transition: none !important; }

/* ---------- back to top (button injected by main.js on every page) ---------- */
.to-top {
  position: fixed; right: clamp(16px, 3vw, 28px); z-index: 40;
  /* viewport-fit=cover extends the layout under the home indicator; keep the button clear of it */
  bottom: calc(clamp(16px, 3vw, 28px) + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px -16px rgba(23, 21, 15, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .6, .2, 1), border-color .18s ease, visibility 0s linear .3s;
}
.to-top.show {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .6, .2, 1), border-color .18s ease;
}
.to-top::before {
  content: ''; width: 8px; height: 8px;
  border-left: 1.5px solid var(--ink); border-top: 1.5px solid var(--ink);
  transform: translateY(2px) rotate(45deg);
  transition: transform .2s cubic-bezier(.2, .6, .2, 1);
}
.to-top:hover { border-color: var(--ink); }
.to-top:hover::before { transform: translateY(0) rotate(45deg); }
.to-top:active::before { transform: translateY(-1px) rotate(45deg); }
[data-theme="dark"] .to-top { box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.8); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top, .to-top.show, .to-top::before { transition: none; }
  .to-top { transform: none; }
}

/* ---------- honeypot (spam trap: visually gone, present for bots) ---------- */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- form note ---------- */
.form-note { font-size: 0.88rem; color: var(--muted); margin-top: 10px; }

/* ---------- the seal stamp ---------- */
@keyframes stamp-in {
  0%   { opacity: 0;   transform: scale(1.7) rotate(-16deg); }
  55%  { opacity: .22; transform: scale(.94) rotate(-7deg); }
  75%  { opacity: .15; transform: scale(1.03) rotate(-8.5deg); }
  100% { opacity: .17; transform: scale(1) rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .svc:hover .stamp, .svc.stamped .stamp { animation: none; opacity: .15; transform: scale(1) rotate(-8deg); }
  .register.stamped .stamp-doc { animation: none; opacity: .13; transform: scale(1) rotate(-8deg); }
}

/* ---------- legal / privacy page ---------- */
.legal { max-width: 720px; margin: 0 auto; }
.legal .section-title { margin-bottom: 6px; }
.legal-updated { font-family: var(--garamond); font-style: italic; color: var(--muted); margin-bottom: 28px; }
.legal h2 { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 34px 0 10px; color: var(--ink); }
.legal p { color: var(--body); line-height: 1.65; margin-bottom: 12px; }
.legal a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; transition: border-color .18s ease; }
.legal a:hover { border-color: var(--ink); }
.legal-back { margin-top: 40px; }

/* ---------- mega menu: the site's index, under "Services" ---------- */
@media (min-width: 721px) {
  .has-mega { display: flex; align-items: center; gap: 8px; }
  /* a hairline chevron, kin to the burger's engraved lines, points at the panel
     and flips upward while it is open */
  .has-mega::after {
    content: ''; width: 6.5px; height: 6.5px;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: translateY(-2.5px) rotate(45deg);
    transition: transform .3s cubic-bezier(.2, .6, .2, 1), border-color .18s ease;
  }
  .has-mega:hover::after, .has-mega:focus-within::after, .has-mega.tap-open::after {
    border-color: var(--ink); transform: translateY(1px) rotate(225deg);
  }
  /* while the panel is open, the trigger reads as active: ink + full underline */
  .has-mega:hover > a, .has-mega:focus-within > a, .has-mega.tap-open > a {
    color: var(--ink); background-size: 100% 1.5px;
  }
  .mega {
    position: absolute; top: 100%; left: 0; right: 0;
    display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between;
    gap: 0 clamp(24px, 3.5vw, 56px);
    padding: 26px clamp(20px, 5vw, 64px) 36px;
    background: color-mix(in srgb, var(--cream) 97%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 36px 46px -34px rgba(23, 21, 15, 0.4);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    /* closing waits a beat, then the visibility delay keeps the panel alive
       while the pointer crosses from link to panel */
    transition: opacity .2s ease .1s, transform .3s cubic-bezier(.2, .6, .2, 1) .1s, visibility 0s linear .4s;
  }
  /* invisible bridge over the nav's bottom padding: the pointer can travel from
     the Services link down into the panel without ever leaving the hover zone */
  .mega::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 30px; }
  .has-mega:hover .mega, .has-mega:focus-within .mega, .has-mega.tap-open .mega {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .2s ease .05s, transform .3s cubic-bezier(.2, .6, .2, 1) .05s;
  }
  /* after a click the panel is done: instant close that outweighs hover/focus,
     lifted again once the pointer leaves and returns (js toggles the class) */
  .has-mega.is-closed .mega { opacity: 0; visibility: hidden; transform: translateY(-8px); transition: none; }
  .has-mega.is-closed::after { border-color: var(--muted); transform: translateY(-2.5px) rotate(45deg); }
  .has-mega.is-closed > a { color: var(--body); background-size: 0% 1.5px; }
  .mega-label { font-family: var(--garamond); font-size: 11px; letter-spacing: 3px; color: var(--muted); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
  .mega a { display: block; width: fit-content; padding: 7px 0 3px; font-size: 14px; }
}
[data-theme="dark"] .mega { box-shadow: 0 36px 46px -34px rgba(0, 0, 0, 0.85); }
@media (min-width: 721px) and (prefers-reduced-motion: reduce) {
  .mega, .has-mega:hover .mega, .has-mega:focus-within .mega, .has-mega.tap-open .mega { transition: none; transform: none; }
  .has-mega::after { transition: none; }
}
@media (max-width: 720px) {
  /* inside the curtain the mega becomes a grouped index; the whole menu scrolls if it must */
  .nav-links { max-height: calc(100dvh - 71px); overflow-y: auto; padding-top: 2px; padding-bottom: 18px; }
  .has-mega { width: 100%; }
  .has-mega > a { display: block; width: 100%; padding: 10px 0; font-size: 15px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); }
  .mega { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; padding: 2px 0 4px; }
  .mega-label { font-family: var(--garamond); font-size: 10px; letter-spacing: 2.5px; color: var(--muted); margin: 8px 0 1px; }
  .mega a { display: block; padding: 4px 0; font-size: 13.5px; color: var(--body); }
}

/* ---------- subpages (service / replace / proof pages) ---------- */
.page-hero { padding-bottom: clamp(56px, 7vw, 96px); }
.page-hero h1 { font-size: clamp(34px, 5.2vw, 58px); }
.page-hero .hero-sub { max-width: 680px; }
.prose { max-width: 720px; }
.prose p { color: var(--body); margin-bottom: 16px; font-size: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-family: var(--garamond); font-size: 1.06em; }
.prose a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; transition: border-color .18s ease; }
.prose a:hover { border-color: var(--ink); }
.prose h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 26px 0 8px; }
.prose .register { margin: 26px 0; }
.diamond-list { list-style: none; max-width: 720px; }
.diamond-list li { position: relative; padding: 8px 0 8px 26px; color: var(--body); font-size: 15px; }
.diamond-list li::before { content: '◆'; position: absolute; left: 2px; top: 15px; font-size: 8px; color: var(--muted); }
.svc .diamond-list li { font-size: 14.5px; padding: 6px 0 6px 24px; }
.read-more { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; transition: border-color .18s ease; }
.read-more:hover { border-color: var(--ink); }
.svc-featured .read-more { color: var(--rev); border-bottom-color: color-mix(in srgb, var(--rev) 35%, transparent); }
.svc-featured .read-more:hover { border-bottom-color: var(--rev); }
.phase-facts { list-style: none; margin-top: 16px; border-top: 1px solid var(--rule); }
.phase-facts li { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; color: var(--body); }
.phase-facts li:last-child { border-bottom: none; }
.phase-facts b { flex-shrink: 0; min-width: 122px; font-weight: 500; font-family: var(--garamond); font-style: italic; color: var(--muted); }
@media (max-width: 560px) { .phase-facts li { flex-direction: column; gap: 2px; } }
.cta-final { text-align: center; }
.cta-final .section-sub { margin-left: auto; margin-right: auto; }
.footer-nav { display: flex; gap: 10px 22px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; max-width: 680px; }
.footer-nav a { color: var(--muted-d); text-decoration: none; transition: color .18s ease; }
.footer-nav a:hover { color: var(--rev); }

/* ---------- dark mode: the reversed brand page (cream on ink) ---------- */
[data-theme="dark"] {
  --ink: #EAE3D2;
  --cream: #14120D;
  --paper: #1C1912;
  --rev: #17150F;
  --muted: #8A8374;
  --muted-d: #6E6857;
  --rule: #35301F;
  --body: #C9C2AE;
  color-scheme: dark;
}
/* watermarks flip to the cream seal */
[data-theme="dark"] .bg-seal-hero,
[data-theme="dark"] .bg-seal-method,
[data-theme="dark"] .bg-seal-contact { background-image: url('../assets/ironstack-seal-full-cream.svg'); }
[data-theme="dark"] .bg-diamond { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M5 0 L10 6.5 L5 13 L0 6.5 Z" fill="%23EAE3D2"/></svg>'); }
/* ink bands become cream bands; their hardcoded light text flips to ink */
[data-theme="dark"] .exit { color: #17150F; }
[data-theme="dark"] .exit h2, [data-theme="dark"] .exit .exit-line { color: #17150F; }
[data-theme="dark"] .exit p { color: #4A4433; }
[data-theme="dark"] .exit-diamond { color: #6E6857; }
[data-theme="dark"] .footer-fine { color: #7A7362; }
[data-theme="dark"] .footer-links a { border-bottom-color: #C9C1AC; }
[data-theme="dark"] .footer-links a:hover { border-color: var(--rev); }
/* controls and details that carry hardcoded light-mode colors */
[data-theme="dark"] .btn-primary:hover { background: #F7F1E0; }
[data-theme="dark"] .register-dots { border-bottom-color: #4A4433; }
[data-theme="dark"] .lead-form input, [data-theme="dark"] .lead-form textarea, [data-theme="dark"] .lead-form select { color: var(--ink); }
[data-theme="dark"] .lead-form input:hover, [data-theme="dark"] .lead-form textarea:hover, [data-theme="dark"] .lead-form select:hover { border-color: #565040; }
[data-theme="dark"] .lead-form textarea:focus { box-shadow: 0 0 0 3px rgba(234, 227, 210, 0.12); }
[data-theme="dark"] .lead-form input:-webkit-autofill,
[data-theme="dark"] .lead-form input:-webkit-autofill:hover,
[data-theme="dark"] .lead-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--cream) inset;
  box-shadow: 0 0 0px 1000px var(--cream) inset;
}
/* shadows read differently on ink; soften the loud ones */
[data-theme="dark"] .showcase { box-shadow: 0 28px 80px -32px rgba(0, 0, 0, 0.8); }
[data-theme="dark"] .tag-plate { background: rgba(20, 18, 13, 0.78); border-color: rgba(234, 227, 210, 0.16); box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.8); }
[data-theme="dark"] .tilt-tag-text strong { text-shadow: 0 5px 12px rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .tilt-tag-text span, [data-theme="dark"] .tilt-tag-text a { text-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }

/* ---------- lead form: validation + submission feedback ----------
   --err is functional feedback, not a brand accent: a brick red that sits
   in the ink/cream world instead of alarm-red */
:root { --err: #9C4130; }
[data-theme="dark"] { --err: #D08E76; }

.lead-form label.invalid > span:first-child { color: var(--err); }
.lead-form label.invalid > span:first-child::after { content: ' ✕'; color: var(--err); font-family: var(--sans); letter-spacing: 0; }
.lead-form label.invalid input,
.lead-form label.invalid .select-btn,
.lead-form label.invalid select { border-bottom-color: var(--err); }
.lead-form label.invalid textarea { border-color: var(--err); }
.form-status.error { color: var(--err); }
.form-status.shake { animation: status-shake .45s ease; }
@keyframes status-shake {
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  90% { transform: translateX(2px); }
}

/* ---------- lead modal: the receipt ---------- */
.lead-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 22px; }
.lead-modal[hidden] { display: none; }
.lead-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(23, 21, 15, 0.44);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: lead-fade-in .3s ease both;
}
.lead-modal-panel {
  position: relative; width: min(430px, 100%);
  background: var(--paper); border: 1px solid var(--rule);
  padding: 46px 42px 38px; text-align: center;
  box-shadow: 0 34px 70px -32px rgba(23, 21, 15, 0.55);
  animation: lead-panel-in .55s cubic-bezier(.16, 1, .3, 1) both;
}
.lead-modal-seal {
  width: 78px; aspect-ratio: 1; margin: 0 auto 20px;
  background: url('../assets/ironstack-seal-small-ink.svg') center/contain no-repeat;
  animation: lead-seal-press .6s cubic-bezier(.16, 1.1, .3, 1) .22s both;
}
[data-theme="dark"] .lead-modal-seal { background-image: url('../assets/ironstack-seal-small-cream.svg'); }
[data-theme="dark"] .lead-modal-panel { box-shadow: 0 34px 70px -32px rgba(0, 0, 0, 0.85); }
/* the problem dialog: a crossed ring where the seal would sit, and the list of what to fix */
.lead-modal-mark {
  width: 78px; height: 78px; margin: 0 auto 20px;
  border: 1.5px solid var(--err); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 28px; line-height: 1; color: var(--err);
  animation: lead-seal-press .6s cubic-bezier(.16, 1.1, .3, 1) .22s both;
}
.lead-modal-list {
  list-style: none; margin: 0 0 28px; padding: 0;
  font-family: var(--garamond); font-style: italic; font-size: 16.5px; line-height: 1.75; color: var(--body);
}
.lead-modal-list li::before { content: '✕'; color: var(--err); font-family: var(--sans); font-style: normal; font-size: 11px; margin-right: 9px; vertical-align: 1px; }
.lead-modal-title { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: .2px; color: var(--ink); margin-bottom: 10px; }
.lead-modal-body { font-family: var(--garamond); font-style: italic; font-size: 17px; line-height: 1.55; color: var(--body); margin-bottom: 28px; }
.lead-modal.closing .lead-modal-backdrop { animation: lead-fade-out .22s ease both; }
.lead-modal.closing .lead-modal-panel { animation: lead-panel-out .22s ease both; }
@keyframes lead-fade-in { from { opacity: 0; } }
@keyframes lead-fade-out { to { opacity: 0; } }
@keyframes lead-panel-in { from { opacity: 0; transform: translateY(28px) scale(.96); } }
@keyframes lead-panel-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes lead-seal-press {
  0%   { opacity: 0; transform: scale(1.65) rotate(-11deg); }
  60%  { opacity: 1; transform: scale(.95) rotate(-1deg); }
  80%  { transform: scale(1.03) rotate(-2.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lead-modal-backdrop, .lead-modal-panel, .lead-modal-seal, .lead-modal-mark,
  .lead-modal.closing .lead-modal-backdrop, .lead-modal.closing .lead-modal-panel { animation: none; }
  .form-status.shake { animation: none; }
}

/* ---------- lead form: live positive feedback ----------
   --ok is functional feedback like --err: a moss green that stays in the
   ink/cream world. The check mark rides the label; the underline agrees. */
:root { --ok: #55794B; }
[data-theme="dark"] { --ok: #9CBF8D; }

.lead-form label > span:first-child { transition: color .16s ease; }
.lead-form label.valid > span:first-child { color: var(--ok); }
.lead-form label.valid > span:first-child::after { content: ' ✓'; color: var(--ok); font-family: var(--sans); letter-spacing: 0; }
.lead-form label.valid input,
.lead-form label.valid .select-btn,
.lead-form label.valid select { border-bottom-color: var(--ok); }
.lead-form label.valid textarea { border-color: var(--ok); }

/* ---------- styled select: the option list, in the site's own clothes ----------
   The native select stays as the form field; .select-btn and .select-menu are
   its face. The panel is kin to the nav's mega menu: cream over blur, hairline
   border, soft shadow, diamond on the chosen entry. */
.select-wrap.enhanced select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.select-btn {
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: none; border-bottom: 1px solid var(--rule); border-radius: 0;
  padding: 10px 20px 10px 2px; font-family: var(--sans); font-size: 15px; color: var(--ink);
  transition: border-color .16s ease;
}
.select-btn.placeholder { color: var(--muted); }
.select-btn:hover { border-bottom-color: #B8B09C; }
.select-btn:focus { outline: none; border-bottom-color: var(--ink); }
[data-theme="dark"] .select-btn:hover { border-bottom-color: #565040; }
[data-theme="dark"] .select-btn:focus { border-bottom-color: var(--ink); }
.select-wrap.open::after { transform: translateY(-25%) rotate(-135deg); border-color: var(--ink); }
.select-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 6px 0; list-style: none;
  background: color-mix(in srgb, var(--cream) 97%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  box-shadow: 0 26px 40px -28px rgba(23, 21, 15, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, .6, .2, 1), visibility 0s linear .3s;
}
.select-wrap.open .select-menu {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, .6, .2, 1);
}
[data-theme="dark"] .select-menu { box-shadow: 0 26px 40px -28px rgba(0, 0, 0, 0.8); }
.select-opt { position: relative; padding: 9px 16px 9px 34px; font-size: 14.5px; color: var(--body); cursor: pointer; transition: color .14s ease, background .14s ease; }
.select-opt.active { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.select-opt[aria-selected="true"] { color: var(--ink); }
.select-opt[aria-selected="true"]::before {
  content: '◆'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 8px; color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .select-menu, .select-wrap.open .select-menu { transition: none; transform: none; }
}
