/* ============================================================
   Artifact Systems
   Grayscale institutional system.
   Radius rule: containers are sharp (0), interactive is pill.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* Theme cross-fade: long and symmetric so the switch drifts, never snaps. */
  --theme-dur: 1.2s;
  --theme-ease: cubic-bezier(0.45, 0.05, 0.25, 1);
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  /* One uniform black across the page; hairline borders carry the
     section and card structure instead of shifts in fill. */
  --bg: #000000;
  --bg-rgb: 0, 0, 0;
  --bg-tint: #000000;
  --bg-panel: #000000;
  --border: #232323;
  --border-faint: #1a1a1a;
  --text: #f2f2f2;
  --text-dim: #9d9d9d;
  --text-faint: #6e6e6e;
  --btn-hover: #cfcfcf;
  --ghost-border: #3a3a3a;
  --ghost-border-hover: #6e6e6e;
  --selection: #3a3a3a;
  --dot-rgb: 242, 242, 242;
}

:root[data-theme="light"] {
  color-scheme: light;
  /* One uniform white, mirroring the pure-black dark theme; hairline
     borders carry section and card structure. */
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --bg-tint: #ffffff;
  --bg-panel: #ffffff;
  --border: #d7d7d7;
  --border-faint: #e3e3e3;
  --text: #141414;
  --text-dim: #565656;
  --text-faint: #8a8a8a;
  --btn-hover: #3a3a3a;
  --ghost-border: #bdbdbd;
  --ghost-border-hover: #8a8a8a;
  --selection: #cfcfcf;
  --dot-rgb: 20, 20, 20;
}

/* Overlay canvas for the ASCII signal pulse that rides the theme
   boundary. Created and removed by the toggle handler. Its own
   view-transition layer lets the glyphs paint across BOTH sides of
   the masked theme boundary during the switch. */
.theme-pulse {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
  view-transition-name: theme-pulse;
}
::view-transition-old(theme-pulse),
::view-transition-new(theme-pulse) {
  animation: none;
}
::view-transition-group(theme-pulse) {
  z-index: 10; /* above the root group's masked reveal */
}

/* Theme switch, preferred path: a slow circular reveal growing out of
   the toggle button. The default snapshot cross-fade is disabled; the
   new view is clipped by a script-driven expanding circle. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* Fallback cross-fade, applied only while the theme is switching. */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition:
    background-color var(--theme-dur) var(--theme-ease),
    color var(--theme-dur) var(--theme-ease),
    border-color var(--theme-dur) var(--theme-ease),
    fill var(--theme-dur) var(--theme-ease) !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 380;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.container.narrow { max-width: 880px; }

::selection { background: var(--selection); color: var(--text); }

h1, h2, h3 { font-weight: 330; letter-spacing: -0.02em; }

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.15;
  margin-bottom: 24px;
}

.body {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 62ch;
}
.body + .body { margin-top: 16px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.footnote {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-top: 40px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 9999px;
  padding: 12px 28px;
  font-size: 0.92rem;
  font-weight: 470;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--ghost-border);
}
.btn-ghost:hover { border-color: var(--ghost-border-hover); }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-faint);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-logo {
  display: block;
  height: 22px;
  width: auto;
  aspect-ratio: 528 / 80.32;
}

.footer-logo {
  display: block;
  height: 17px;
  width: auto;
  aspect-ratio: 528 / 80.32;
}

.nav-links {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid var(--ghost-border);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s var(--ease);
}
.theme-toggle:hover { border-color: var(--ghost-border-hover); }
.theme-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--theme-dur) var(--theme-ease);
}
:root[data-theme="light"] .theme-toggle svg { transform: rotate(180deg); }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 430;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }

.btn-nav { padding: 9px 22px; font-size: 0.86rem; }

/* ---------- Mobile menu ---------- */

/* Hidden on desktop; replaces the nav CTA on small screens. */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid var(--ghost-border);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s var(--ease);
}
.menu-toggle:hover { border-color: var(--ghost-border-hover); }
.menu-toggle span {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px 20px 28px;
  background: rgba(var(--bg-rgb), 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-faint);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0s linear 0.4s;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.mobile-menu-links { display: flex; flex-direction: column; }
.mobile-menu-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 380;
  letter-spacing: 0.01em;
  padding: 15px 2px;
  border-bottom: 1px solid var(--border-faint);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.2s var(--ease);
}
.mobile-menu-links a:hover { color: var(--text); }
.mobile-menu.is-open .mobile-menu-links a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.is-open .mobile-menu-links a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(5) { transition-delay: 0.25s; }

.mobile-menu-cta {
  display: flex;
  margin-top: 24px;
  width: 100%;
  justify-content: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s var(--ease) 0.3s, transform 0.4s var(--ease) 0.3s;
}
.mobile-menu.is-open .mobile-menu-cta {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu-links a,
  .mobile-menu-cta,
  .menu-toggle span {
    transition: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#hero-ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity var(--theme-dur) var(--theme-ease);
}
.scrim-dark {
  background:
    linear-gradient(90deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 44%, rgba(0,0,0,0.05) 78%),
    linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 30%);
  opacity: 1;
}
.scrim-light {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.58) 44%, rgba(255,255,255,0.05) 78%),
    linear-gradient(0deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0) 30%);
  opacity: 0;
}
:root[data-theme="light"] .scrim-dark { opacity: 0; }
:root[data-theme="light"] .scrim-light { opacity: 1; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 88px 32px 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
  max-width: 14ch;
}
.hero h1 .dim { color: var(--text-dim); }

.hero-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 52ch;
  margin-top: 28px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ---------- Pillars ---------- */

.pillars {
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg-tint);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.pillar {
  padding: 44px 32px;
  border-left: 1px solid var(--border-faint);
}
.pillar:first-child { border-left: none; padding-left: 0; }
.pillar:last-child { padding-right: 0; }

.pillar h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 10px;
}
.pillar p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- Sections ---------- */

.section { padding: 128px 0; }
.section-tint {
  background: var(--bg-tint);
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
}
/* Where two bordered sections touch, drop one edge so every
   full-width divider is a single hairline. */
.pillars + .section-tint,
.section-tint + .section-tint { border-top: 0; }

/* ---------- Infrastructure split ---------- */

.split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 80px;
  align-items: center;
}

.split-panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

#lattice-ascii {
  display: block;
  width: 100%;
  height: 250px;
  border-bottom: 1px solid var(--border-faint);
}

.jurisdictions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px 32px 32px;
}

.jur-group h4 {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.jur-group ul { list-style: none; }
.jur-group li {
  font-size: 0.94rem;
  color: var(--text);
  padding: 5px 0;
}

/* ---------- Services ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 56px 0;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat-num {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 280;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.services-tabs {
  position: relative;
  z-index: 0;
  display: inline-flex;
  border: 1px solid var(--ghost-border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 40px;
}

/* Subtle shimmer confined to the border line: a few faint glints
   drift along the hairline, with a 2px emanation hugging it. */
@property --tabs-glow {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.services-tabs::before,
.services-tabs::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: conic-gradient(
    from var(--tabs-glow),
    transparent 0deg,
    rgba(var(--dot-rgb), 0.45) 40deg,
    transparent 95deg,
    transparent 150deg,
    rgba(var(--dot-rgb), 0.25) 205deg,
    transparent 255deg,
    transparent 295deg,
    rgba(var(--dot-rgb), 0.35) 330deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: tabs-glow-spin 14s linear infinite;
}
.services-tabs::before {
  /* Shimmer in the hairline itself. */
  inset: 0;
  padding: 1px;
}
.services-tabs::after {
  /* Tight emanation off the line — a couple of pixels, no further. */
  inset: -2px;
  padding: 3px;
  filter: blur(1.5px);
  opacity: 0.6;
}
@keyframes tabs-glow-spin {
  to { --tabs-glow: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .services-tabs::before,
  .services-tabs::after { animation: none; opacity: 0; }
}
.services-tabs [role="tab"] {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.services-tabs [role="tab"]:hover { color: var(--text); }
.services-tabs [role="tab"][aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
}
.services-tabs [role="tab"]:focus-visible {
  outline: 1px solid var(--ghost-border-hover);
  outline-offset: 2px;
}

.services-viewport {
  overflow: hidden;
  transition: height 0.45s var(--ease);
}
.services-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .services-viewport, .services-track { transition: none; }
}
.svc-panel { min-width: 100%; }
.svc-panel[hidden] { display: block; visibility: hidden; }

.svc-lead {
  font-size: 1.15rem;
  font-weight: 330;
  color: var(--text);
  margin-bottom: 44px;
}
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
}
.svc-item {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.svc-item h4 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 10px;
}
.svc-item p {
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ---------- Compliance ---------- */

.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.scope h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.scope p {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border-faint);
}
.ops-item h4 {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.ops-item p {
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Statement ---------- */

.statement { padding: 140px 0; }

.statement-text {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 330;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 26ch;
}

.statement-note {
  color: var(--text-faint);
  font-size: 0.92rem;
  margin-top: 28px;
  max-width: 50ch;
}

/* ---------- Coverage ---------- */

.coverage-head { max-width: 640px; margin-bottom: 64px; }
/* Let the longer services heading sit on one line when the viewport
   allows; it still wraps naturally on narrow screens. The intro line
   stays readable via .body's own max-width. */
#services .coverage-head { max-width: none; }

.chain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.chain-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 32px 40px;
  min-height: 170px;
}
.cell-raised { background: var(--bg-panel); }
.cell-texture {
  background-image: radial-gradient(rgba(var(--dot-rgb), 0.05) 1px, transparent 1px);
  background-size: 14px 14px;
}

.chain-cell h3 {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.chain-cell p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Serve ---------- */

.serve-title { max-width: 20ch; margin-bottom: 56px; }

.serve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.serve-panel {
  border: 1px solid var(--border);
  padding: 44px 40px 48px;
  background: var(--bg);
}
.serve-panel h3 {
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 16px;
}
.serve-panel p {
  color: var(--text-dim);
  font-size: 0.96rem;
}

/* ---------- Chain logo marquee ---------- */

.chain-marquee {
  margin-top: 72px;
  overflow: hidden;
  /* Faded borders on both sides. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.chain-track {
  display: flex;
  width: max-content;
  color: var(--text-dim);
  /* One .chain-set width per cycle; from -50% to 0 = drifting rightward. */
  animation: chain-scroll 240s linear infinite;
}

.chain-set {
  display: flex;
  align-items: center;
  gap: 80px;
  padding-right: 80px;
}

.chain-logo { display: flex; align-items: center; flex: none; }
.chain-logo svg {
  height: 40px;
  display: block;
  fill: currentColor;
}

@keyframes chain-scroll {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .chain-track { animation: none; }
}

/* ---------- Contact ---------- */

.contact { padding: 160px 0; text-align: center; }
/* No cap so the headline stays on one line when the viewport allows;
   it wraps naturally on narrow screens. */
.contact h2 { max-width: none; }
.contact .body { max-width: none; }

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.contact-mail {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-mail:hover { color: var(--text); border-color: var(--text-faint); }

/* ---------- Contact modal ---------- */

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* display:flex above would otherwise override the hidden attribute,
   leaving an invisible click-eating overlay across the page. */
.contact-modal[hidden] { display: none; }

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
:root[data-theme="light"] .contact-modal-backdrop {
  background: rgba(255, 255, 255, 0.6);
}

.contact-modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 48px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.contact-modal.is-open .contact-modal-backdrop { opacity: 1; }
.contact-modal.is-open .contact-modal-panel { opacity: 1; transform: translateY(0); }

.contact-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid var(--ghost-border);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s var(--ease);
}
.contact-modal-close:hover { border-color: var(--ghost-border-hover); }
.contact-modal-close svg { width: 14px; height: 14px; }

.contact-modal-panel h3 {
  font-size: 1.5rem;
  font-weight: 380;
  letter-spacing: -0.01em;
}

.cf-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 10px 0 34px;
}

.cf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 20px;
  margin-bottom: 22px;
}

.cf-field { display: flex; flex-direction: column; gap: 8px; }
.cf-field > span:first-child {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.cf-field input,
.cf-field select,
.cf-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 11px 14px;
  transition: border-color 0.25s var(--ease);
}
.cf-field textarea { resize: vertical; min-height: 110px; }
.cf-field input:focus,
.cf-field select:focus,
.cf-field textarea:focus {
  outline: none;
  border-color: var(--ghost-border-hover);
}

.cf-select { position: relative; display: block; }
.cf-select-btn {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 11px 36px 11px 14px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease);
}
.cf-select-btn:focus-visible {
  outline: none;
  border-color: var(--ghost-border-hover);
}
/* While open, field + menu share the standard hairline so the two
   frames read as one continuous box. */
.cf-select.is-open .cf-select-btn { border-color: var(--border); }
.cf-select-btn .is-placeholder { color: var(--text-faint); }
.cf-select.is-invalid .cf-select-btn { border-color: var(--text-dim); }
.cf-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--text-faint);
  border-bottom: 1px solid var(--text-faint);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.25s var(--ease);
}
.cf-select.is-open::after { transform: translateY(-30%) rotate(225deg); }

/* Options panel: framed exactly like the field it opens from. */
.cf-select-menu {
  position: absolute;
  /* Overlap the field's bottom hairline so the frames read as one. */
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 10;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
}
.cf-select-menu li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text);
  padding: 11px 14px;
  cursor: pointer;
}
.cf-select-menu li + li { border-top: 1px solid var(--border); }
.cf-select-menu li:hover,
.cf-select-menu li:focus-visible {
  outline: none;
  background: var(--border-faint);
}
/* Checkbox square */
.cf-select-menu li::before {
  content: "";
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border: 1px solid var(--ghost-border);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.cf-select-menu li[aria-selected="true"]::before {
  background: var(--text);
  border-color: var(--text);
}
/* Check mark inside the square */
.cf-select-menu li[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 4px;
  height: 8px;
  border-right: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: translateY(-65%) rotate(45deg);
}

/* Invisible reCAPTCHA: badge hidden (attribution shown in the form instead). */
.grecaptcha-badge { visibility: hidden !important; }
#contact-captcha { position: absolute; width: 0; height: 0; overflow: hidden; }

.cf-recaptcha-note {
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
}
.cf-recaptcha-note a {
  color: var(--text-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cf-recaptcha-note a:hover { color: var(--text-dim); }

.cf-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cf-error {
  color: var(--text-dim);
  font-size: 0.88rem;
  border-left: 2px solid var(--text-faint);
  padding-left: 12px;
  margin-top: 20px;
}

.cf-submit { margin-top: 28px; width: 100%; justify-content: center; display: flex; }
.cf-submit:disabled { opacity: 0.55; cursor: default; }

.cf-success { text-align: center; padding: 40px 0 24px; }
.cf-success .cf-sub { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .contact-modal-backdrop, .contact-modal-panel { transition: none; }
}

@media (max-width: 640px) {
  .contact-modal { padding: 12px; }
  .contact-modal-panel { padding: 36px 24px; }
  .cf-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border-faint);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.wordmark-footer { font-size: 0.88rem; color: var(--text-dim); }
.wordmark-footer:hover { color: var(--text); }

.footer-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--text); }

.footer-legal {
  width: 100%;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; gap: 48px; }
  .pillar-grid { grid-template-columns: 1fr 1fr; }
  .pillar { padding: 32px 28px; }
  .pillar:first-child { padding-left: 0; }
  .pillar:nth-child(odd) { border-left: none; padding-left: 0; }
  .pillar:nth-child(-n+2) { border-bottom: 1px solid var(--border-faint); }
  .chain-grid { grid-template-columns: 1fr 1fr; }
  .ops-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  .scrim-dark {
    background:
      linear-gradient(0deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.72) 55%, rgba(0,0,0,0.4) 100%);
  }
  .scrim-light {
    background:
      linear-gradient(0deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.76) 55%, rgba(255,255,255,0.44) 100%);
  }
  .container, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav-links { display: none; }
  .btn-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .theme-toggle { margin-left: auto; }
  .nav-inner { gap: 16px; }
  .nav-logo { height: 18px; }
  .footer-inner { gap: 24px; }
  .footer-links { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 20px; }
  .section { padding: 88px 0; }
  .statement { padding: 96px 0; }
  .contact { padding: 112px 0; }
  .hero-content { padding: 96px 20px 0; }
  .pillar-grid { grid-template-columns: 1fr; }
  .pillar { border-left: none; padding: 24px 0; border-bottom: 1px solid var(--border-faint); }
  .pillar:last-child { border-bottom: none; }
  .pillar:nth-child(-n+2) { border-bottom: 1px solid var(--border-faint); }
  .chain-grid { grid-template-columns: 1fr; }
  .chain-cell { min-height: 0; padding: 28px 24px 32px; }
  .serve-grid { grid-template-columns: 1fr; }
  .jurisdictions { grid-template-columns: 1fr; gap: 20px; }
  .scope-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-row { grid-template-columns: 1fr; gap: 24px; padding: 28px 0; }
  .svc-grid { grid-template-columns: 1fr; gap: 28px; }
  .ops-grid { grid-template-columns: 1fr; gap: 24px; }
  .services-tabs { width: 100%; }
  .services-tabs [role="tab"] { flex: 1; padding: 9px 10px; }
}
