:root {
  --fire: #e8893c;
  --ice: #5bc4e8;
  --gold: #d4a940;
  --ember: #c0501a;
  --crystal: #a8d8f0;
  --void: #06060e;
  --deep: #0d0d1a;
  --surface: #121220;
  --raised: #1a1a2e;
  --glass: rgba(18, 18, 32, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8e4dc;
  --muted: #8a8578;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.52);
  --glow-fire: 0 0 40px rgba(232, 137, 60, 0.22);
  --glow-ice: 0 0 40px rgba(91, 196, 232, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --font-display: 'Cinzel Decorative', serif;
  --font-heading: 'Cinzel', serif;
  --font-body: 'Crimson Pro', serif;
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --scroll-progress: 0%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--void);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--fire), var(--gold));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f0a060, var(--fire));
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top, rgba(232, 137, 60, 0.08), transparent 32%),
    linear-gradient(180deg, #070711 0%, #06060e 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
}

body.menu-open,
body.modal-open,
body.ledger-open,
body.ui-locked {
  overflow: hidden;
}

/* Portal active — hide main site until portal dismisses */
body.portal-active .site-shell {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: none;
}

body:not(.portal-active) .site-shell {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
}

main,
section,
header,
footer,
nav,
aside {
  position: relative;
  z-index: 1;
}

[id] {
  scroll-margin-top: 96px;
}

/* ─── Scroll Progress Bar ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 2px;
  width: var(--scroll-progress);
  background: linear-gradient(90deg, var(--fire) 0%, var(--gold) 50%, var(--ice) 100%);
  pointer-events: none;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(232, 137, 60, 0.6);
}

.site-shell {
  position: relative;
  isolation: isolate;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.ambient-grid,
.ambient-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-grid {
  z-index: -2;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.35), transparent 100%),
    radial-gradient(1px 1px at 27% 64%, rgba(255,255,255,0.22), transparent 100%),
    radial-gradient(1px 1px at 76% 24%, rgba(168,216,240,0.28), transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 75%, rgba(255,255,255,0.18), transparent 100%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto, auto;
}

.ambient-vignette {
  z-index: -1;
  background:
    radial-gradient(circle at 50% -10%, transparent 0%, rgba(6, 6, 14, 0.15) 45%, rgba(6, 6, 14, 0.82) 100%),
    radial-gradient(circle at 50% 120%, rgba(91, 196, 232, 0.06), transparent 38%);
}

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fire);
}

.section {
  padding: 6.5rem 0;
}

.section-header {
  max-width: 760px;
  margin-bottom: 2.5rem;
}

.section-header h2,
.section-copy h2,
.contact-copy h2,
.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
}

.hero-copy h1 {
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f0c070 0%, #e8893c 34%, #a8d8f0 69%, #5bc4e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: heroTitleShimmer 6s ease infinite;
  background-size: 200% 200%;
}

@keyframes heroTitleShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.section-header h2,
.section-copy h2,
.contact-copy h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.section-lead,
.hero-lead {
  margin: 1.2rem 0 0;
  font-size: 1.22rem;
  line-height: 1.7;
  color: rgba(232, 228, 220, 0.78);
}

.muted-line {
  color: var(--muted);
}

/* ─── Reveal Animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }

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

/* ─── Buttons ─── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease,
              border-color 0.22s ease,
              background 0.22s ease,
              color 0.22s ease,
              box-shadow 0.22s ease;
}

/* Sweep shimmer on hover */
.button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.45s ease;
  pointer-events: none;
}

.button:hover::after,
.button:focus-visible::after {
  left: 160%;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: var(--void);
  background: linear-gradient(135deg, var(--fire), var(--gold));
  box-shadow: 0 14px 28px rgba(232, 137, 60, 0.22), 0 0 0 0 rgba(232, 137, 60, 0);
}

.button-primary:hover,
.button-primary:focus-visible {
  box-shadow: 0 20px 40px rgba(232, 137, 60, 0.36), 0 0 0 4px rgba(232, 137, 60, 0.12);
}

.button-secondary {
  color: var(--crystal);
  border-color: rgba(91, 196, 232, 0.34);
  background: rgba(91, 196, 232, 0.06);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(91, 196, 232, 0.6);
  background: rgba(91, 196, 232, 0.12);
  box-shadow: 0 0 24px rgba(91, 196, 232, 0.12);
}

.button-small {
  min-height: 40px;
  padding: 0.72rem 1rem;
  font-size: 0.72rem;
}

.inline-sigil {
  padding: 0;
  background: none;
  border: 0;
  color: var(--crystal);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(91, 196, 232, 0.3);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.inline-sigil:hover {
  color: #fff;
  text-decoration-color: rgba(91, 196, 232, 0.8);
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.68rem;
}

.clean-list li {
  position: relative;
  padding-left: 1.2rem;
  color: rgba(232, 228, 220, 0.72);
}

.clean-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 0.13rem;
  font-size: 0.5rem;
  color: var(--fire);
}

.clean-list.compact {
  gap: 0.58rem;
}

/* ─── Portal Intro ─── */
.portal-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.portal-intro.dissolving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.portal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portal-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(6, 6, 14, 0.7) 60%, rgba(6, 6, 14, 0.95) 100%);
  pointer-events: none;
}

.portal-shell {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 560px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.portal-sigil {
  font-size: 3rem;
  color: var(--fire);
  animation: sigilPulse 2.4s ease infinite;
  text-shadow: 0 0 40px rgba(232, 137, 60, 0.6);
  display: block;
  margin-bottom: 0.5rem;
}

@keyframes sigilPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); text-shadow: 0 0 30px rgba(232, 137, 60, 0.5); }
  50% { opacity: 1; transform: scale(1.08); text-shadow: 0 0 60px rgba(232, 137, 60, 0.9); }
}

.portal-kicker {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(91, 196, 232, 0.7);
}

.portal-body {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-line {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: rgba(232, 228, 220, 0.88);
  line-height: 1.7;
}

.portal-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--fire);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.portal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fadeUp 0.6s ease forwards;
}

.portal-utility {
  display: flex;
  justify-content: center;
  width: 100%;
}

.portal-skip {
  border: 0;
  padding: 0.35rem 0.75rem;
  background: transparent;
  color: rgba(232, 228, 220, 0.66);
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.portal-skip:hover,
.portal-skip:focus-visible {
  color: rgba(91, 196, 232, 0.88);
  opacity: 1;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 1rem 2rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 137, 60, 0.5);
  background: linear-gradient(135deg, rgba(232, 137, 60, 0.15), rgba(212, 169, 64, 0.1));
  color: var(--fire);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.portal-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.5s ease;
}

.portal-btn:hover {
  background: linear-gradient(135deg, rgba(232, 137, 60, 0.3), rgba(212, 169, 64, 0.2));
  border-color: rgba(232, 137, 60, 0.8);
  box-shadow: 0 0 40px rgba(232, 137, 60, 0.2), 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  color: #fff;
}

.portal-btn:hover::after {
  left: 160%;
}

.portal-hint {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.portal-hint strong {
  color: rgba(91, 196, 232, 0.7);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .container {
    width: min(var(--container), calc(100% - 1.5rem));
  }
}

@media (max-width: 700px) {
  body {
    font-size: 17px;
  }

  .section {
    padding: 5rem 0;
  }

  .section-lead,
  .hero-lead {
    font-size: 1.06rem;
  }

  .portal-sigil {
    font-size: 2.2rem;
  }
}

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

  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
