/* --- Variables (Palantir-style: deep black, precision, accent) --- */
:root {
  --bg: #18333C;
  --bg-elevated: #0c1014;
  --bg-warm: #132a32;
  --text: #f2efe8;
  --text-muted: rgba(242, 239, 232, 0.68);
  --cream: #f2efe8;
  --accent: #FAE6A1;
  --accent-warm: #FAE6A1;
  --accent-dim: rgba(250, 230, 161, 0.35);
  --accent-glow: rgba(250, 230, 161, 0.12);
  --burgundy: #18333C;
  --burgundy-dim: rgba(24, 51, 60, 0.35);
  --navy: #10262e;
  --teaser-bg: #132a32;
  --teaser-dot: rgba(250, 230, 161, 0.5);
  --teaser-dot-muted: rgba(242, 239, 232, 0.35);
  --grid-line: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.06);
  --glass: rgba(24, 51, 60, 0.78);
  --font-logo: "Aboreto", "Cormorant Garamond", Georgia, serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --space: clamp(1.5rem, 4vw, 3rem);
  --max-width: 72rem;
  /* Premium motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-snappy: 0.35s;
  --duration-smooth: 0.6s;
  --duration-slow: 1s;
  --hero-visibility: 0;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  overflow-x: hidden;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(139, 58, 58, 0.18), transparent 50%),
    radial-gradient(ellipse at 60% 85%, rgba(201, 162, 39, 0.08), transparent 60%);
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  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);
  background-size: 120px 120px;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  z-index: 0;
}
/* Subtle film grain — premium texture */
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-snappy) var(--ease-out-quart);
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 1px solid var(--accent-dim);
  outline-offset: 3px;
  border-radius: 2px;
}

main {
  position: relative;
  z-index: 1;
  scroll-margin-top: 5rem;
}
main:focus {
  outline: none;
}
.site-footer {
  position: relative;
  z-index: 1;
}
::selection {
  background: rgba(250, 230, 161, 0.25);
  color: var(--cream);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: linear-gradient(90deg, transparent 0%, var(--accent-dim) 15%, var(--accent) 50%, var(--accent-warm) 85%, transparent 100%);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(250, 230, 161, 0.06);
  z-index: 120;
  transition: width 0.12s var(--ease-out-quart);
  border-radius: 0 2px 2px 0;
}

/* --- Header (transparent over hero, solid on scroll) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space) calc(var(--space) * 1.5);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease-out-quart), border-color 0.5s var(--ease-out-quart), backdrop-filter 0.5s var(--ease-out-quart), box-shadow 0.5s var(--ease-out-quart);
}
.site-header.is-solid {
  background: rgba(6, 8, 10, 0.88);
  border-bottom-color: var(--border);
  backdrop-filter: blur(20px) saturate(1.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}
.logo {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.site-header .logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.site-header .logo-sub {
  font-family: var(--font-logo);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 239, 232, 0.55);
}
.logo:hover { text-decoration: none; }
.site-header.is-solid .logo {
  opacity: 1;
  pointer-events: auto;
}
.nav {
  display: flex;
  gap: 1.75rem;
}
.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 0.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleX(0.5);
  transform-origin: left;
  transition: opacity var(--duration-snappy) var(--ease-out-expo), transform var(--duration-snappy) var(--ease-out-expo);
}
.nav a:hover { color: var(--cream); }
.nav a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}
.nav a:focus-visible { outline: 1px solid var(--accent-dim); outline-offset: 4px; }
.nav-toggle {
  display: none;
  width: 1.5rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
}
.nav-toggle::before { top: 0; }
.nav-toggle::after { bottom: 0; }
.nav-toggle span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin-top: -1px;
  height: 2px;
  background: var(--text);
}

/* --- Sections (scroll reveal) — editorial, avant-garde --- */
.section {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--space) * 1.7) calc(var(--space) * 1.5);
  z-index: 1;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.05s var(--ease-out-expo), transform 1.05s var(--ease-out-expo);
  scroll-margin-top: 5rem;
}
.section::before {
  content: "";
  position: absolute;
  left: calc(var(--space) * 1.5);
  right: calc(var(--space) * 1.5);
  top: 1.15rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.25), transparent);
  opacity: 0.35;
}
.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Staggered children (cards, list items) */
.section.is-visible [data-stagger] {
  opacity: 1;
  transform: translateY(0);
}
[data-stagger] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.75s var(--ease-out-expo), transform 0.75s var(--ease-out-expo);
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  margin: 0 0 calc(var(--space) * 0.85);
  color: var(--cream);
  letter-spacing: 0.04em;
}
.section-title::after {
  content: "";
  display: block;
  width: 3.75rem;
  height: 1px;
  margin-top: 0.55rem;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.65;
  transition: width 0.8s var(--ease-out-expo) 0.2s;
}
.section.is-visible .section-title::after {
  width: 4.6rem;
}
.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-bg { transition: none; }
}

/* --- Mobile nav --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width:  min(18rem, 85vw);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.2s ease;
  }
  .nav.is-open { transform: translateX(0); }
  .nav-toggle {
    display: block;
    position: relative;
  }
  .nav-toggle::before {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
  }
  .nav-toggle::after {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
  }
}
