/* =========================================================================
   Kerberogate — WebGL rebuild stylesheet
   Palette preserved from the previous site (gold on near-black).
   ========================================================================= */

:root {
  --bg: #070706;
  --bg2: #11100d;
  --gold: #d4af37;
  --gold2: #f4d875;
  --gold-deep: #8c6a18;
  --text: #f8f4e8;
  --muted: #c7bda0; /* body text on near-black — ~7.5:1, meets WCAG AA */
  --line: rgba(212, 175, 55, 0.24);
  --line-strong: rgba(244, 216, 117, 0.55);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.025);
  --radius: 22px;
  --radius-lg: 34px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(20px, 6vw, 86px);
  --maxw: 1200px;
  --shadow: 0 30px 120px rgba(0, 0, 0, 0.45);

  /* ---- glassmorphism system ---- */
  --glass-bg: linear-gradient(150deg, rgba(60, 52, 32, 0.42), rgba(20, 18, 12, 0.30));
  --glass-blur: blur(22px) saturate(150%);
  --glass-border: rgba(244, 216, 117, 0.26);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.42), 0 4px 14px rgba(0, 0, 0, 0.28);
}

/* One place to define the frosted-panel look. */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .visual-card,
  .form,
  .cards article,
  .stat-row div,
  .focus-row div { background: rgba(18, 17, 13, 0.94) !important; }
  .site-header { background: rgba(12, 11, 8, 0.96) !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* clip (not hidden) contains full-bleed decorations without turning the
     document into a nested scroll container — that was breaking scrolling. */
  overflow-x: clip;
  /* anchored sections clear the fixed header */
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* CSS fallback shown until / instead of the WebGL canvas */
  background-image:
    radial-gradient(60vw 60vw at 12% 8%, rgba(212, 175, 55, 0.12), transparent 60%),
    radial-gradient(55vw 55vw at 92% 28%, rgba(140, 106, 24, 0.13), transparent 62%),
    radial-gradient(45vw 45vw at 40% 100%, rgba(244, 216, 117, 0.08), transparent 60%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: rgba(244, 216, 117, 0.28); color: #fff; }

/* ---------- Background layers ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#bg.ready { opacity: 1; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--gold);
  color: #111;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px var(--pad-x);
  background: linear-gradient(to bottom, rgba(20, 18, 12, 0.7), rgba(10, 9, 6, 0.5));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transition: padding 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  padding-top: 10px;
  padding-bottom: 10px;
  background: linear-gradient(to bottom, rgba(16, 14, 9, 0.92), rgba(10, 9, 6, 0.82));
  border-bottom-color: var(--glass-border);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(8, 8, 7, 0.97); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-logo {
  width: auto;
  height: 38px;
  filter: drop-shadow(0 0 14px rgba(244, 216, 117, 0.25));
  transition: transform 0.4s var(--ease);
}
.site-footer .brand-logo { height: 34px; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }
.brand-name { font-size: 15px; }

.nav {
  display: flex;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.nav a {
  position: relative;
  padding: 6px 2px;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold2), var(--gold-deep));
  transition: right 0.3s var(--ease);
}
.nav a:hover,
.nav a.active { color: var(--gold2); }
.nav a:hover::after,
.nav a.active::after { right: 0; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--gold2);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold2);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle span + span { margin-top: 5px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout / panels ---------- */
main { position: relative; z-index: 3; }

.panel {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: clamp(110px, 16vh, 170px) var(--pad-x) clamp(70px, 12vh, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--maxw);
  margin-inline: auto;
}
.panel > * { width: 100%; }

/* Soft blended edges so sections "morph" into each other */
.panel::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100vw;
  height: 160px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 7, 6, 0.9), rgba(7, 7, 6, 0));
  z-index: -1;
}
.panel::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -80px;
  width: 100vw;
  height: 200px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse at 22% 50%, rgba(244, 216, 117, 0.14), transparent 42%),
    radial-gradient(ellipse at 78% 40%, rgba(140, 106, 24, 0.16), transparent 46%);
  filter: blur(24px);
  opacity: 0.8;
}

/* ---------- Readability over the WebGL field ---------- */
.hero h1,
h2,
h3 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55); }
.lead,
.summary,
.copy p,
.section-head p,
.contact-alt { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7); }

/* ---------- Typography ---------- */
.eyebrow {
  color: var(--gold2);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 14px;
}
.display {
  margin: 6px 0 0;
  /* "KERBEROGATE" is 11 fixed characters — keep it on one line inside
     .hero-content (max 960px) at every width so it never clips. */
  font-size: clamp(44px, 8.8vw, 112px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.9;
  max-width: 100%;
  overflow-wrap: break-word;
  background: linear-gradient(100deg, #fff8dc, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(212, 175, 55, 0.18);
}
h2 {
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.04;
  margin: 8px 0 18px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 21px;
  margin: 16px 0 10px;
  letter-spacing: 0.01em;
}
p { margin: 0 0 14px; }

/* ---------- Hero ---------- */
.hero { text-align: center; align-items: center; }
.hero-content { max-width: 960px; margin-inline: auto; }
.lead {
  font-size: clamp(21px, 3.1vw, 40px);
  line-height: 1.14;
  margin: 20px auto 0;
  color: #fff7df;
  max-width: 22ch;
}
.summary {
  max-width: 760px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.75;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.btn {
  --btn-bg: var(--glass);
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--gold2);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border);
  box-shadow: var(--glass-edge);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #171307;
  border-color: transparent;
  box-shadow: 0 12px 40px rgba(212, 175, 55, 0.22);
}
.btn.primary:hover { box-shadow: 0 18px 60px rgba(212, 175, 55, 0.34); }
.btn.ghost:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.scroll-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 30px;
  width: 26px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.scroll-cue span {
  display: block;
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: var(--gold2);
  margin: 8px auto;
  animation: scrollcue 1.7s var(--ease) infinite;
}
@keyframes scrollcue { to { transform: translateY(16px); opacity: 0; } }

/* ---------- Split (About) ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.visual-card {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow), inset 0 0 80px rgba(212, 175, 55, 0.06);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
}
.visual-logo {
  width: auto;
  height: clamp(150px, 26vw, 232px);
  z-index: 2;
  filter: drop-shadow(0 0 50px rgba(244, 216, 117, 0.4));
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-12px); } }
.rings, .rings::before, .rings::after {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  inset: 16%;
  animation: spin 22s linear infinite;
}
.rings::before, .rings::after { content: ""; inset: 8%; animation-duration: 13s; }
.rings::after { inset: 26%; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.stat-row,
.focus-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}
.stat-row div,
.focus-row div {
  padding: 20px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.stat-row strong { display: block; color: var(--gold2); font-size: 20px; }
.stat-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.focus-row strong {
  display: block;
  color: var(--gold2);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.focus-row span {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin-top: 8px;
}

/* ---------- Section head ---------- */
.section-head { max-width: 900px; margin-bottom: 34px; }
.section-head p { color: var(--muted); font-size: 17px; }
.copy p { color: var(--muted); font-size: 16px; line-height: 1.8; }

/* ---------- Cards / grids ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.cards article {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.cards article:hover {
  transform: translateY(-8px);
  border-color: var(--line-strong);
  box-shadow: var(--glass-edge), 0 28px 90px rgba(212, 175, 55, 0.18);
}
.cards p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0; }

/* Service icons — pure CSS marks, no emoji */
.service-icon {
  width: 44px;
  height: 44px;
  display: inline-block;
  position: relative;
  border: 1px solid rgba(244, 216, 117, 0.35);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(244, 216, 117, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.12);
}
.service-icon::before, .service-icon::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid var(--gold2);
  border-radius: 10px;
  opacity: 0.92;
}
.service-cyber::before {
  inset: 8px 12px 12px;
  border-radius: 14px 14px 10px 10px;
  clip-path: polygon(50% 0, 100% 20%, 86% 100%, 50% 86%, 14% 100%, 0 20%);
}
.service-grc::before { inset: 9px 12px; border-radius: 3px; }
.service-grc::after {
  inset: auto 13px 12px 13px;
  height: 2px;
  border: 0;
  background: var(--gold2);
  box-shadow: 0 -8px 0 var(--gold2), 0 -16px 0 var(--gold2);
}
.service-chain::before { inset: 10px 18px 10px 7px; border-radius: 14px; }
.service-chain::after { inset: 10px 7px 10px 18px; border-radius: 14px; }
.service-network::before { inset: 8px; border-radius: 50%; }
.service-network::after {
  inset: 20px 6px;
  border-width: 2px 0 0 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 -10px 0 -1px var(--gold2), 0 10px 0 -1px var(--gold2);
}
.service-hardware::before { inset: 10px 8px 14px; border-radius: 4px; }
.service-hardware::after {
  inset: auto 13px 8px 13px;
  height: 4px;
  border: 0;
  background: var(--gold2);
  border-radius: 2px;
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 18px;
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 40px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow), inset 0 0 70px rgba(212, 175, 55, 0.05);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.partner-form { max-width: 880px; margin-inline: auto; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--gold2); letter-spacing: 0.04em; }
.field .opt { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.field select option { background: #14120d; color: var(--text); }
.field textarea { resize: vertical; min-height: 110px; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold2);
  box-shadow: 0 0 0 3px rgba(244, 216, 117, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}
.field input:user-invalid,
.field select:user-invalid,
.field textarea:user-invalid { border-color: #e0736b; }

.form-foot {
  flex-direction: row;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form-status { margin: 0; font-size: 14px; color: var(--muted); }
.form-status.ok { color: #8fd6a0; }
.form-status.err { color: #e88f87; }

/* honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Contact ---------- */
.contact-form { max-width: 880px; margin-inline: auto; }
.contact-alt {
  max-width: 880px;
  margin: 18px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.contact-alt a {
  color: var(--gold2);
  border-bottom: 1px solid var(--line);
}
.contact-alt a:hover { border-bottom-color: var(--gold2); }

/* small link under the solutions grid pointing to the partners page */
.section-cta {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.section-cta a {
  color: var(--gold2);
  border-bottom: 1px solid var(--line);
}
.section-cta a:hover { border-bottom-color: var(--gold2); }

/* ---------- Partners page ---------- */
.partners-page {
  gap: clamp(26px, 5vw, 44px);
  max-width: 980px;
}
.partners-head { max-width: 760px; }
.partners-head .lead {
  font-size: clamp(19px, 2.4vw, 28px);
  margin-top: 16px;
  max-width: none;
  text-align: left;
}
.partners-head .summary { margin-top: 14px; }
.display--sm {
  font-size: clamp(32px, 5.6vw, 60px);
  letter-spacing: -0.005em;
  text-transform: none;
  line-height: 1.02;
}
.crumb {
  color: var(--gold2);
  border-bottom: 1px solid transparent;
}
.crumb:hover { border-bottom-color: currentColor; }
.partners-alt {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.partners-alt a { color: var(--gold2); }
.partners-alt .back-link { margin-left: auto; }
.page-partners .partner-form { margin-inline: 0; max-width: none; }

/* ---------- Resources page ---------- */
.resources-page { gap: clamp(26px, 5vw, 44px); max-width: 980px; }
.resources-head { max-width: 760px; }
.resources-head .lead {
  font-size: clamp(19px, 2.4vw, 28px);
  margin-top: 16px;
  max-width: none;
  text-align: left;
}
.resource-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.resource-cards .card {
  position: relative;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resource-cards .card:hover {
  transform: translateY(-8px);
  border-color: var(--line-strong);
  box-shadow: var(--glass-edge), 0 28px 90px rgba(212, 175, 55, 0.18);
}
.resource-cards .card p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0; }
.resource-cards .card .resource-icon {
  width: 34px;
  height: 44px;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.28));
}
.resource-cards .card .tag {
  align-self: flex-start;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold2);
  border: 1px solid rgba(244, 216, 117, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
}
.resource-cards .card .open-link {
  margin-top: auto;
  color: var(--gold2);
  font-size: 14px;
}
.resource-cards .card a.stretched-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
@media (max-width: 720px) {
  .resource-cards { grid-template-columns: 1fr; }
}

/* ---------- Header CTA ---------- */
.header-cta {
  margin-left: auto;
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
}
@media (max-width: 960px) {
  .header-cta { margin-right: 10px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .header-cta { padding: 9px 14px; font-size: 12px; }
}

/* ---------- Hero headline + trust line ---------- */
.hero-h1 {
  margin-top: 12px;
  max-width: 20ch;
  margin-inline: auto;
}
.hero .lead {
  max-width: 62ch;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
  color: #efe6cf;
}
.hero-trust {
  margin: 20px auto 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Contact extras ---------- */
.form-consent {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.form-consent a { color: var(--gold2); border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 3;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.footer-grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(40px, 7vw, 72px) var(--pad-x) 32px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: clamp(28px, 5vw, 56px);
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { margin: 0; max-width: 34ch; line-height: 1.7; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold2);
  margin: 0 0 6px;
  font-weight: 800;
}
.footer-col a { color: var(--muted); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--gold2); }
.footer-contact address { font-style: normal; line-height: 1.7; color: var(--muted); }
.footer-map {
  margin-top: 14px;
  max-width: 340px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge);
}
.footer-map-canvas {
  height: 158px;
  width: 100%;
  background: #12100c;
}
.footer-map-canvas.leaflet-container { background: #12100c; font: inherit; outline: none; }
/* turn the standard OSM raster into a clean dark monochrome map */
.footer-map-canvas .leaflet-tile-pane {
  filter: grayscale(1) invert(0.93) contrast(0.82) brightness(0.92) sepia(0.12);
}
.footer-map-canvas .leaflet-control-attribution {
  background: rgba(10, 9, 6, 0.72);
  color: var(--muted);
  font-size: 9px;
  padding: 0 5px;
}
.footer-map-canvas .leaflet-control-attribution a { color: var(--gold2); }
.footer-map-canvas .leaflet-bar a {
  background: rgba(15, 13, 9, 0.92);
  color: var(--gold2);
  border-bottom-color: var(--glass-border);
}
.footer-map-canvas .leaflet-bar a:hover { background: rgba(32, 27, 18, 0.95); }
.footer-map-canvas .leaflet-tooltip {
  background: #0b0a08;
  color: var(--gold2);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 700;
}
.footer-map-canvas .leaflet-tooltip-top::before { border-top-color: var(--glass-border); }
.footer-map-fallback {
  display: block;
  padding: 44px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.footer-map > a {
  display: block;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold2);
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--glass-border);
}
.footer-map > a:hover { background: rgba(255, 255, 255, 0.07); }
.footer-social {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  gap: 10px;
}
.footer-social a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--gold2);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.footer-social a:hover {
  transform: translateY(-2px);
  color: #fff3cd;
  border-color: var(--line-strong);
  background: rgba(244, 216, 117, 0.1);
}
.footer-social svg { width: 18px; height: 18px; display: block; }
.footer-legal {
  border-top: 1px solid var(--line);
  padding: 20px var(--pad-x);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
}
.footer-legal p { margin: 2px 0; }
.footer-legal strong { color: #e9ddc0; }
.site-footer a { color: var(--gold2); }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Legal pages (privacy / terms) ---------- */
.legal {
  justify-content: flex-start;
  max-width: 860px;
  gap: 28px;
}
.legal-head { max-width: 720px; }
.legal-meta { color: var(--muted); font-size: 14px; margin-top: 10px; }
.legal-body {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: clamp(24px, 4vw, 44px);
}
.legal-body h2 {
  font-size: clamp(19px, 2.4vw, 24px);
  margin: 30px 0 10px;
  letter-spacing: 0;
  text-shadow: none;
}
.legal-body h2:first-of-type { margin-top: 6px; }
.legal-body p,
.legal-body li { color: var(--muted); line-height: 1.75; font-size: 15px; }
.legal-body ul { margin: 8px 0 16px; padding-left: 20px; }
.legal-body li { margin-bottom: 8px; }
.legal-body li > ul { margin: 8px 0 4px; }
.legal-body p + p { margin-top: 12px; }
.legal-meta { color: var(--muted); }
.legal-body a { color: var(--gold2); border-bottom: 1px solid var(--line); }
.legal-note {
  border: 1px solid rgba(244, 216, 117, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(244, 216, 117, 0.06);
  margin-bottom: 22px;
}
.legal-todo { color: var(--gold2); opacity: 0.9; }
.legal-back { margin-top: 26px; }

/* ---------- Thank-you page ---------- */
.thanks { text-align: center; align-items: center; }
.thanks-inner { max-width: 640px; margin-inline: auto; }
.thanks-mark {
  width: auto;
  height: 84px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 40px rgba(244, 216, 117, 0.35));
}
.thanks .lead { max-width: 52ch; margin-inline: auto; color: #efe6cf; }
.thanks .hero-actions { justify-content: center; }

/* ---------- Visible keyboard focus ---------- */
:focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 4px; }
.menu-toggle:focus-visible { outline-offset: 2px; }
/* pointer users keep the softer states; only keyboard gets the ring */
:focus:not(:focus-visible) { outline: none; }

/* ---------- Reveal / morph transitions ----------
   Content is visible by default so the page never depends on JS to be
   readable (e.g. when a module script can't load, such as under the
   file:// protocol). reveal.js applies the hidden "pre-reveal" starting
   state itself at runtime, only once it has actually initialized, then
   animates to .visible via IntersectionObserver. */
.reveal {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
}
.reveal.pre-reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(6px);
}
.reveal.visible {
  opacity: 1;
  transform: none;
  filter: none;
}
.cards .reveal:nth-child(2) { transition-delay: 0.06s; }
.cards .reveal:nth-child(3) { transition-delay: 0.12s; }
.cards .reveal:nth-child(4) { transition-delay: 0.18s; }
.cards .reveal:nth-child(5) { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    height: 100vh;
    height: 100dvh;
    z-index: 49;
    width: min(320px, 82vw);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    gap: 8px;
    padding: 96px 28px 28px;
    background: #0b0a08;
    border-left: 1px solid var(--line);
    box-shadow: -30px 0 90px rgba(0, 0, 0, 0.6);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    font-size: 17px;
  }
  .nav.open { transform: translateX(0); }
  .nav a { padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: block; position: relative; z-index: 51; }
  body.nav-open { overflow: hidden; }
  body.nav-open::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 48;
    background: rgba(4, 4, 3, 0.6);
  }

  .split { grid-template-columns: 1fr; }
  .visual-card { min-height: 300px; order: -1; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .panel { padding-left: 16px; padding-right: 16px; }
  .cards,
  .form { grid-template-columns: 1fr; }
  .stat-row,
  .focus-row { grid-template-columns: 1fr; }
  .lead { max-width: none; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
  .display {
    font-size: clamp(38px, 12.5vw, 60px);
    letter-spacing: 0.01em;
    word-break: break-word;
  }
  h2 { font-size: clamp(26px, 7.5vw, 40px); }
}

@media (max-width: 380px) {
  .display { font-size: 36px; }
}

/* ---------- Motion / data-saver preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* =========================================================================
   Light mode — same structure, warm cream palette instead of near-black.
   The animated WebGL canvas is dark-tuned, so it's hidden in light mode and
   a plain warm gradient takes its place; everything else follows the same
   --bg/--text/--muted/--glass-* tokens the dark theme already uses.
   ========================================================================= */
:root[data-theme="light"] {
  --bg: #f8f4e9;
  --bg2: #efe7d2;
  --gold: #b8860b;
  --gold2: #9a6b0c;
  --gold-deep: #7a5608;
  --text: #241f14;
  --muted: #5b5340; /* ~7:1 on --bg */
  --line: rgba(154, 107, 12, 0.28);
  --line-strong: rgba(122, 86, 8, 0.5);
  --glass: rgba(20, 16, 4, 0.04);
  --glass-2: rgba(20, 16, 4, 0.02);
  --shadow: 0 30px 120px rgba(120, 96, 40, 0.14);

  --glass-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 232, 0.55));
  --glass-border: rgba(122, 86, 8, 0.22);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(20, 16, 4, 0.02);
  --glass-shadow: 0 20px 60px rgba(120, 96, 40, 0.1), 0 4px 14px rgba(120, 96, 40, 0.08);
}
:root[data-theme="light"] body {
  background: radial-gradient(120% 90% at 50% -10%, #fffdf6 0%, var(--bg) 55%, #f1e9d4 100%);
}
/* The WebGL scene is tuned for a dark canvas — swap it for a plain gradient. */
:root[data-theme="light"] #bg { opacity: 0 !important; }
:root[data-theme="light"] .grain { opacity: 0.03; mix-blend-mode: multiply; background-image: radial-gradient(#000 1px, transparent 1px); }
:root[data-theme="light"] ::selection { background: rgba(154, 107, 12, 0.22); color: #241f14; }

:root[data-theme="light"] .site-header {
  background: linear-gradient(to bottom, rgba(255, 253, 246, 0.86), rgba(248, 244, 233, 0.65));
  box-shadow: inset 0 -1px 0 rgba(20, 16, 4, 0.05);
}
:root[data-theme="light"] .site-header.scrolled {
  background: linear-gradient(to bottom, rgba(255, 253, 246, 0.96), rgba(248, 244, 233, 0.9));
}
/* The dark text-shadows and near-white hero/lead colors below were tuned to
   sit over the dark WebGL field — they read as a smeared "double vision"
   halo once the background (and the canvas) turns light, so light mode
   turns them off and switches those colors to the theme's own text tokens. */
:root[data-theme="light"] .hero h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] .lead,
:root[data-theme="light"] .summary,
:root[data-theme="light"] .copy p,
:root[data-theme="light"] .section-head p,
:root[data-theme="light"] .contact-alt { text-shadow: none; }
:root[data-theme="light"] .lead,
:root[data-theme="light"] .hero .lead,
:root[data-theme="light"] .thanks .lead { color: var(--text); }
:root[data-theme="light"] .display {
  background: linear-gradient(100deg, var(--text), var(--gold-deep) 55%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
/* The section top/bottom "morph" edges default to a near-black fade meant to
   blend into the dark canvas — swap for a light fade so it doesn't leave a
   dark band across each section on a light background. */
:root[data-theme="light"] .panel::before {
  background: linear-gradient(to bottom, rgba(248, 244, 233, 0.9), rgba(248, 244, 233, 0));
}
:root[data-theme="light"] .panel::after {
  background:
    radial-gradient(ellipse at 22% 50%, rgba(154, 107, 12, 0.1), transparent 42%),
    radial-gradient(ellipse at 78% 40%, rgba(122, 86, 8, 0.12), transparent 46%);
}

@media (max-width: 960px) {
  :root[data-theme="light"] .nav { background: #fffdf6; border-left-color: var(--line); box-shadow: -30px 0 90px rgba(120, 96, 40, 0.12); }
  :root[data-theme="light"] body.nav-open::after { background: rgba(244, 238, 220, 0.7); }
}

:root[data-theme="light"] .btn.ghost { background: rgba(20, 16, 4, 0.035); }
:root[data-theme="light"] .btn.ghost:hover { background: rgba(20, 16, 4, 0.06); }
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea { background: rgba(20, 16, 4, 0.035); }
:root[data-theme="light"] .field select:focus,
:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field textarea:focus { background: rgba(20, 16, 4, 0.05); }
:root[data-theme="light"] .field select option { background: #fff; color: var(--text); }
:root[data-theme="light"] .footer-map,
:root[data-theme="light"] .footer-map-canvas { background: rgba(20, 16, 4, 0.035); }
:root[data-theme="light"] .footer-map > a { background: rgba(20, 16, 4, 0.035); }
:root[data-theme="light"] .footer-map > a:hover { background: rgba(20, 16, 4, 0.06); }
:root[data-theme="light"] .footer-social a { background: rgba(20, 16, 4, 0.035); }
:root[data-theme="light"] .footer-social a:hover { background: rgba(154, 107, 12, 0.12); color: var(--gold-deep); }
:root[data-theme="light"] .footer-legal strong { color: var(--text); }
:root[data-theme="light"] .visual-card { box-shadow: var(--glass-edge), var(--glass-shadow), inset 0 0 80px rgba(154, 107, 12, 0.05); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="light"] .glass,
  :root[data-theme="light"] .visual-card,
  :root[data-theme="light"] .form,
  :root[data-theme="light"] .cards article,
  :root[data-theme="light"] .stat-row div,
  :root[data-theme="light"] .focus-row div { background: rgba(250, 246, 234, 0.96) !important; }
  :root[data-theme="light"] .site-header { background: rgba(250, 246, 234, 0.97) !important; }
}

/* =========================================================================
   Rail nav — the scroll-position "bar" from the regulatory-atlas / Ihkaam
   presentations: a column of dots beside the viewport, with the current
   section's dot stretching into a gold pill. Desktop only.
   ========================================================================= */
.railnav {
  position: fixed;
  right: clamp(14px, 2.2vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.railnav .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(244, 216, 117, 0.2);
  border: 1px solid var(--glass-border);
  position: relative;
  transition: width 0.5s var(--ease), height 0.5s var(--ease), border-radius 0.5s var(--ease), background 0.4s var(--ease);
}
.railnav .dot::after {
  content: attr(data-tip);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.railnav .dot:hover::after,
.railnav .dot:focus-visible::after { opacity: 1; }
.railnav .dot:hover,
.railnav .dot:focus-visible { background: rgba(244, 216, 117, 0.4); }
.railnav .dot.active {
  width: 10px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  border-color: transparent;
}
@media (max-width: 960px) {
  .railnav { display: none; }
}
