:root {
  color-scheme: dark;
  --wa-ground: #06080b;
  --wa-surface: rgba(11, 16, 24, 0.90);
  --wa-card: #151d29;
  --wa-ink: #eff6ff;
  --wa-ink-soft: #c9d5e6;
  --wa-ink-muted: #b4c2d6;
  --wa-line: rgba(231, 233, 230, 0.16);
  --wa-signal: #e8b05c;
  --wa-signal-hover: #f1c47e;
  --wa-signal-ink: #0b0f14;
  --wa-accent: #f2bd6a;
  --wa-cyan: #8fe3ff;
  --wa-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --wa-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--wa-ground);
  color: var(--wa-ink);
  font-family: var(--wa-sans);
  -webkit-font-smoothing: antialiased;
}
body {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
}

canvas#field-hero.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
  opacity: 1;
}

.gate-chrome {
  position: relative;
  z-index: 1;
  width: min(100%, 49rem);
  min-width: 0;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-top: clamp(1.25rem, 3vh, 2rem);
  padding-bottom: 0.75rem;
}
.gate-logo {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(11, 16, 24, 0.90);
  border: 1px solid var(--wa-line);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gate-logo:hover {
  border-color: rgba(232, 176, 92, 0.45);
}
.gate-logo img {
  display: block;
  width: 140px;
  height: 40px;
}

.gate-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: rgba(11, 16, 24, 0.90);
  border: 1px solid var(--wa-line);
  font-size: 13.5px;
}
.gate-nav a {
  color: var(--wa-ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.16s ease;
}
.gate-nav a:hover,
.gate-nav a[aria-current="page"] {
  color: var(--wa-accent);
}
.gate-nav .gate-nav-cta {
  color: var(--wa-accent);
  font-weight: 600;
  padding-left: 0.75rem;
  border-left: 1px solid var(--wa-line);
}

.gate-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-block: clamp(1.25rem, 4vh, 3rem);
}

.gate-card {
  width: min(100%, 44rem);
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  background: rgba(11, 16, 24, 0.90);
  border: 1px solid var(--wa-line);
  border-radius: 18px;
  padding: clamp(1.35rem, 3.6vw, 2.4rem);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.io-ladder {
  display: grid;
  gap: 20px;
}
.io {
  display: grid;
  gap: 8px;
}
.io + .io {
  padding-top: 16px;
  border-top: 1px solid rgba(231, 233, 230, 0.12);
}
.io-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  border-radius: 8px;
  transition: background 0.18s ease;
}
.io-row.in {
  cursor: pointer;
}
.io-row.in:hover .io-k {
  border-color: rgba(232, 176, 92, 0.65);
  color: var(--wa-accent);
}
.io-k {
  font: 500 11px/1 var(--wa-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wa-ink-muted);
  border: 1px solid var(--wa-line);
  border-radius: 4px;
  padding: 5px 0;
  text-align: center;
  background: rgba(21, 29, 41, 0.92);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.io-row.out .io-k {
  color: var(--wa-accent);
  border-color: rgba(232, 176, 92, 0.55);
}
.io-row.out.io-pulse .io-k {
  border-color: var(--wa-signal);
  background: rgba(232, 176, 92, 0.18);
  box-shadow: 0 0 16px rgba(232, 176, 92, 0.55);
}
.io-row.in .io-t {
  margin: 0;
  font-size: clamp(14.5px, 1.25vw, 17px);
  color: var(--wa-ink-soft);
  line-height: 1.4;
}
.io-row.out .io-t {
  margin: 0;
  font-size: clamp(22px, 2.7vw, 31px);
  line-height: 1.22;
  letter-spacing: -0.028em;
  font-weight: 600;
  color: var(--wa-ink);
}
.io-row.out .io-t.io-t-sub {
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.26;
}
.io-t em {
  font-style: normal;
  color: var(--wa-accent);
}

.gate-sub {
  margin: 1.25rem 0 0;
  max-width: 50ch;
  color: var(--wa-ink-soft);
  font-size: clamp(14.5px, 1.15vw, 16.5px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font: 600 15px/1 var(--wa-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.btn-primary {
  background: var(--wa-signal);
  color: var(--wa-signal-ink);
  border: 1px solid var(--wa-signal);
}
.btn-primary:hover {
  background: var(--wa-signal-hover);
  box-shadow: 0 8px 32px -6px rgba(232, 176, 92, 0.55);
}
.btn-ghost {
  background: var(--wa-card);
  color: var(--wa-ink);
  border: 1px solid #46576e;
}
.btn-ghost:hover {
  border-color: var(--wa-signal);
  background: #1b2636;
}

/* Unified Dark Obsidian / Amber Legal Surface */
.gate-legal-main {
  align-items: flex-start;
  padding-block: clamp(1rem, 3vh, 2.25rem);
}
.gate-legal-main.gate-chrome {
  width: min(100%, 68rem);
}
.gate-card.gate-legal {
  width: min(100%, 63rem);
}
.gate-legal {
  line-height: 1.65;
  font-size: 15.5px;
  color: var(--wa-ink-soft);
  overflow-wrap: break-word;
}
.gate-legal .page-top .wrap h1,
.gate-legal h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.028em;
  font-weight: 650;
  color: var(--wa-ink);
}
.gate-legal .legal-meta {
  font: 500 12.5px/1.4 var(--wa-mono);
  color: var(--wa-ink-muted);
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wa-line);
}
.gate-legal .legal-meta .nowrap {
  white-space: nowrap;
  display: inline-block;
}
.gate-legal h2 {
  margin: 1.75rem 0 0.6rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(231, 233, 230, 0.10);
  font-size: clamp(18.5px, 2vw, 22px);
  line-height: 1.28;
  letter-spacing: -0.018em;
  font-weight: 600;
  color: var(--wa-ink);
}
.gate-legal .page-top + .block h2:first-child {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
}
.gate-legal h3 {
  margin: 1.45rem 0 0.45rem;
  font-size: 16.5px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--wa-ink);
}
.gate-legal p {
  margin: 0.75rem 0;
  color: var(--wa-ink-soft);
}
.gate-legal ul,
.gate-legal ol {
  margin: 0.75rem 0;
  padding-left: 1.35rem;
  color: var(--wa-ink-soft);
}
.gate-legal li {
  margin: 0.4rem 0;
}
.gate-legal strong {
  color: var(--wa-ink);
  font-weight: 600;
}
.gate-legal a {
  color: var(--wa-accent);
  text-decoration: underline;
  text-decoration-color: rgba(242, 189, 106, 0.45);
  text-underline-offset: 0.22em;
  font-weight: 500;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.gate-legal a:hover {
  color: var(--wa-signal-hover);
  text-decoration-color: var(--wa-signal-hover);
}
.gate-legal :target {
  scroll-margin-top: 1.25rem;
}
.gate-legal .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.1rem 0;
  border: 1px solid var(--wa-line);
  border-radius: 12px;
  background: rgba(6, 8, 11, 0.55);
}
.gate-legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.45;
}
.gate-legal th,
.gate-legal td {
  padding: 0.58rem 0.68rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(231, 233, 230, 0.12);
}
.gate-legal tr:last-child td {
  border-bottom: 0;
}
.gate-legal th {
  font: 600 11.5px/1.3 var(--wa-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wa-accent);
  background: rgba(21, 29, 41, 0.85);
  border-bottom: 1px solid var(--wa-line);
  white-space: normal;
}
.gate-legal .table-swipe-hint {
  display: none;
  margin: 0;
  padding: 0.5rem 0.75rem;
  font: 500 11.5px/1.35 var(--wa-mono);
  color: var(--wa-ink-muted);
  background: rgba(21, 29, 41, 0.65);
  border-top: 1px solid var(--wa-line);
}

.gate-footer-wrap {
  padding-bottom: 1.5rem;
}
.gate-footer {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: rgba(11, 16, 24, 0.90);
  border: 1px solid var(--wa-line);
  font-size: 13.5px;
  color: var(--wa-ink-muted);
}
.gate-footer a {
  color: var(--wa-accent);
  text-underline-offset: 0.22em;
  font-weight: 500;
}
.gate-footer a:hover {
  color: var(--wa-signal-hover);
}

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

@media (max-width: 720px) {
  .gate-legal .table-swipe-hint {
    display: block;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] {
    overflow-x: visible;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] table,
  .gate-legal .table-scroll[aria-label*="ubprocessors"] tbody {
    display: block;
    width: 100%;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] tr:first-child {
    display: none;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] tr:not(:first-child) {
    display: block;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--wa-line);
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] tr:last-child {
    border-bottom: 0;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] td {
    display: grid;
    grid-template-columns: 7.75rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.28rem 0;
    border-bottom: 0;
    font-size: 13px;
    line-height: 1.42;
  }
  .gate-legal .table-scroll[aria-label*="ubprocessors"] td::before {
    font: 600 10.5px/1.35 var(--wa-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wa-accent);
  }
  .gate-legal .table-scroll[aria-label="Subprocessors"] td:nth-child(1)::before { content: "Subprocessor"; }
  .gate-legal .table-scroll[aria-label="Subprocessors"] td:nth-child(2)::before { content: "Purpose"; }
  .gate-legal .table-scroll[aria-label="Subprocessors"] td:nth-child(3)::before { content: "Data processed"; }
  .gate-legal .table-scroll[aria-label="Subprocessors"] td:nth-child(4)::before { content: "Location"; }
  .gate-legal .table-scroll[aria-label="Subprocessors"] td:nth-child(5)::before { content: "Privacy"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(1)::before { content: "Provider"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(2)::before { content: "Planned purpose"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(3)::before { content: "Data processed"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(4)::before { content: "Location"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(5)::before { content: "Earliest start"; }
  .gate-legal .table-scroll[aria-label="Approved subprocessors"] td:nth-child(6)::before { content: "Privacy"; }
}

@media (max-width: 600px) {
  .gate-header { flex-direction: column; align-items: flex-start; }
  .gate-nav { width: 100%; justify-content: space-between; }
  .io-row { grid-template-columns: 1fr; gap: 6px; }
  .io-k { justify-self: start; padding: 5px 10px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .gate-card.gate-legal, .gate-legal { font-size: 14.5px; }
  .gate-legal th, .gate-legal td { padding: 0.55rem 0.65rem; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
