@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Mono:wght@300;400;500&family=IBM+Plex+Sans+Condensed:wght@300;400;500&display=swap');

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens: dark (default) ──────────────────────── */
:root {
  --bg:        #0f0e0c;
  --bg-alt:    #141210;
  --fg:        #e8e3d9;
  --fg-muted:  #8d8479;   /* bumped from #7a7268 — now 5.5:1 on --bg */
  --accent:    #d4830a;
  --accent-hi: #f0a030;
  --rule:      rgba(255,255,255,0.07);
  --focus-ring: #f0a030;
  --toggle-bg: rgba(255,255,255,0.06);
  --toggle-bg-hover: rgba(255,255,255,0.1);
  --lava-blend:  screen;
  --blob-color-1: rgba(200, 120, 10, 0.13);
  --blob-color-2: rgba(170,  85,  5, 0.10);
  --blob-color-3: rgba(215, 145, 20, 0.09);
  --blob-color-4: rgba(155,  75,  0, 0.11);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
  --font-sans:    'IBM Plex Sans Condensed', 'Arial Narrow', sans-serif;
}

/* ── Design tokens: light ────────────────────────────────── */
/* Applies when system prefers light AND no explicit override */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #f5f0e8;
    --bg-alt:    #ede8de;
    --fg:        #1a1814;
    --fg-muted:  #5c5650;   /* 6.3:1 on light bg */
    --accent:    #8f5000;   /* 5.6:1 on light bg */
    --accent-hi: #b86800;
    --rule:      rgba(0,0,0,0.09);
    --focus-ring: #8f5000;
    --toggle-bg: rgba(0,0,0,0.06);
    --toggle-bg-hover: rgba(0,0,0,0.1);
    --lava-blend:  multiply;
    --blob-color-1: rgba(143, 80,  0, 0.09);
    --blob-color-2: rgba(120, 60,  0, 0.07);
    --blob-color-3: rgba(160, 95,  5, 0.06);
    --blob-color-4: rgba(100, 48,  0, 0.08);
  }
}

/* Explicit overrides via data-theme attribute */
[data-theme="light"] {
  --bg:        #f5f0e8;
  --bg-alt:    #ede8de;
  --fg:        #1a1814;
  --fg-muted:  #5c5650;
  --accent:    #8f5000;
  --accent-hi: #b86800;
  --rule:      rgba(0,0,0,0.09);
  --focus-ring: #8f5000;
  --toggle-bg: rgba(0,0,0,0.06);
  --toggle-bg-hover: rgba(0,0,0,0.1);
  --lava-blend:  multiply;
  --blob-color-1: rgba(143, 80,  0, 0.09);
  --blob-color-2: rgba(120, 60,  0, 0.07);
  --blob-color-3: rgba(160, 95,  5, 0.06);
  --blob-color-4: rgba(100, 48,  0, 0.08);
}

/* [data-theme="dark"] — explicitly forced dark, uses :root defaults */

/* ── Base ────────────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ── Noise overlay ───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
}

/* ── Lava lamp background ────────────────────────────────── */
.lava-bg {
  position: fixed;
  inset: 0;
  z-index: 2;          /* above in-flow content, below header (100) */
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: var(--lava-blend);
}

.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  filter: blur(90px);
}

.blob-1 {
  width: 620px; height: 620px;
  background: var(--blob-color-1);
  top: -8%; left: -6%;
  animation: blob-move-1 67s ease-in-out infinite alternate;
}

.blob-2 {
  width: 480px; height: 480px;
  background: var(--blob-color-2);
  top: 25%; right: -8%;
  animation: blob-move-2 53s ease-in-out infinite alternate;
}

.blob-3 {
  width: 360px; height: 360px;
  background: var(--blob-color-3);
  bottom: 8%; left: 18%;
  animation: blob-move-3 43s ease-in-out infinite alternate;
}

.blob-4 {
  width: 290px; height: 290px;
  background: var(--blob-color-4);
  top: 55%; left: 55%;
  animation: blob-move-4 37s ease-in-out infinite alternate;
}

@keyframes blob-move-1 {
  0%   { transform: translate(0, 0)          scale(1);    }
  33%  { transform: translate(38vw, 42vh)    scale(1.12); }
  66%  { transform: translate(58vw, 8vh)     scale(0.91); }
  100% { transform: translate(18vw, 78vh)    scale(1.07); }
}

@keyframes blob-move-2 {
  0%   { transform: translate(0, 0)          scale(1);    }
  33%  { transform: translate(-42vw, 12vh)   scale(0.87); }
  66%  { transform: translate(-22vw, 52vh)   scale(1.13); }
  100% { transform: translate(-58vw, 28vh)   scale(0.94); }
}

@keyframes blob-move-3 {
  0%   { transform: translate(0, 0)          scale(1);    }
  50%  { transform: translate(28vw, -62vh)   scale(1.16); }
  100% { transform: translate(-32vw, -28vh)  scale(0.88); }
}

@keyframes blob-move-4 {
  0%   { transform: translate(0, 0)          scale(1);    }
  25%  { transform: translate(-28vw, 22vh)   scale(1.22); }
  50%  { transform: translate(12vw, 38vh)    scale(0.84); }
  75%  { transform: translate(-18vw, -32vh)  scale(1.1);  }
  100% { transform: translate(22vw, -18vh)   scale(0.94); }
}

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Focus styles ────────────────────────────────────────── */
/* Remove browser default, apply our own on keyboard navigation */
*:focus { outline: none; }

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

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
}

section {
  padding: 7rem 0;
  border-top: 1px solid var(--rule);
}

section:first-of-type { border-top: none; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Section labels styled as small-caps headings */
.label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Reduced-motion: disable all decorative animation ──── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .section-rule {
    transform: scaleX(1) !important;
  }
  /* Lava is pure motion — remove it entirely for motion-sensitive users */
  .lava-bg { display: none; }
  html { scroll-behavior: auto; }
}

/* ── Load animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes drawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.reveal {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal-1  { animation-delay: 0.1s; }
.reveal-2  { animation-delay: 0.25s; }
.reveal-3  { animation-delay: 0.4s; }
.reveal-4  { animation-delay: 0.55s; }
.reveal-5  { animation-delay: 0.7s; }

/* ── Header ──────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  transition: background 0.25s ease;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.2s;
  transition: color 0.25s;
}

.logo:hover { color: var(--accent); }

.logo-mark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
  position: relative;
  top: 2px;
  transition: color 0.25s;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.4s;
}

/* ── Theme toggle button ─────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--rule);
  background: var(--toggle-bg);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--toggle-bg-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* Default: dark mode — show sun (to switch to light) */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }

/* Light mode — show moon (to switch to dark) */
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

/* ── CTA Button ──────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--accent);
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--accent);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-lg {
  font-size: 0.85rem;
  padding: 0.9rem 2.2rem;
}

/* ── Hero ────────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.hero-content { padding-bottom: 4rem; }

.hero-turnstile {
  font-family: var(--font-display);
  font-size: clamp(14rem, 22vw, 20rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 131, 10, 0.18);
  line-height: 0.85;
  text-align: right;
  user-select: none;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 1.5s ease forwards 0.8s;
  position: relative;
  right: -1rem;
}

[data-theme="light"] .hero-turnstile {
  -webkit-text-stroke: 1px rgba(143, 80, 0, 0.15);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-turnstile {
    -webkit-text-stroke: 1px rgba(143, 80, 0, 0.15);
  }
}

.hero-label { margin-bottom: 2rem; }

.hero-title {
  font-size: clamp(3.2rem, 6vw, 5.5rem);
  margin-bottom: 2rem;
  color: var(--fg);
  max-width: 14ch;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  max-width: 42ch;
  line-height: 1.8;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hero-note {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-top: 1.5rem;
}

.section-rule {
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
  transform-origin: left;
  transform: scaleX(0);
  animation: drawLine 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 1.2s;
}

/* ── Scroll reveals ──────────────────────────────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.scroll-reveal.delay-1 { transition-delay: 0.1s; }
.scroll-reveal.delay-2 { transition-delay: 0.2s; }
.scroll-reveal.delay-3 { transition-delay: 0.3s; }
.scroll-reveal.delay-4 { transition-delay: 0.45s; }

/* ── Problem ─────────────────────────────────────────────── */
#problem .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

#problem .section-label-col { padding-top: 0.4rem; }

.problem-statements {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}

.problem-item {
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

.problem-item:first-child { border-top: 1px solid var(--rule); }

.problem-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.6;
  padding-top: 0.35rem;
}

.problem-item h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.problem-item p { color: var(--fg-muted); font-size: 0.82rem; }

/* ── Services ────────────────────────────────────────────── */
#services { background: var(--bg-alt); transition: background 0.25s ease; }

#services .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  list-style: none;
}

.service-item {
  padding: 0 2rem 2rem 0;
  border-right: 1px solid var(--rule);
}

.service-item:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 2rem;
}

.service-item:nth-child(2) { padding-left: 2rem; }

.service-icon {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  opacity: 0.7;
}

.service-item h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 0.8rem;
}

.service-item p { font-size: 0.8rem; color: var(--fg-muted); line-height: 1.75; }

/* ── Proof ───────────────────────────────────────────────── */
#proof .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.proof-cases { display: flex; flex-direction: column; gap: 2.5rem; }

.proof-case {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.proof-case-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-family: var(--font-sans);
}

.proof-case h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.proof-case p { color: var(--fg-muted); font-size: 0.82rem; line-height: 1.75; }

.proof-stat {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid rgba(212, 131, 10, 0.3);
  padding: 0.25rem 0.6rem;
}

[data-theme="light"] .proof-stat,
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .proof-stat {
    border-color: rgba(143, 80, 0, 0.25);
  }
}

/* ── About ───────────────────────────────────────────────── */
#about { background: var(--bg-alt); transition: background 0.25s ease; }

#about .container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: center;
}

.about-text { max-width: 60ch; }

.about-text p {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  line-height: 1.4;
  font-weight: 400;
  color: var(--fg);
}

.about-text p + p {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.75;
}

/* ── CTA section ─────────────────────────────────────────── */
#cta-section {
  border-top: 1px solid var(--rule);
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.cta-bg-mark {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 28rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 131, 10, 0.06);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

[data-theme="light"] .cta-bg-mark {
  -webkit-text-stroke: 1px rgba(143, 80, 0, 0.06);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .cta-bg-mark {
    -webkit-text-stroke: 1px rgba(143, 80, 0, 0.06);
  }
}

#cta-section .container { position: relative; z-index: 1; }

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  max-width: 20ch;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

.cta-sub {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
  max-width: 48ch;
}

.cta-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.cta-divider { color: var(--fg-muted); font-size: 0.75rem; }

.cta-email {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.cta-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Site footer ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  background: var(--bg);
  transition: background 0.25s ease;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

.footer-logo {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-logo-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
  position: relative;
  top: 1px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .container { padding: 0 2rem; }
  header { padding: 1.2rem 2rem; }

  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-turnstile { display: none; }
  .hero-content { padding-bottom: 2rem; }

  #problem .container,
  #services .container,
  #proof .container,
  #about .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .services-grid { grid-template-columns: 1fr; gap: 2rem; }

  .service-item,
  .service-item:last-child,
  .service-item:nth-child(2) {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 2rem 0;
  }

  .service-item:last-child { border-bottom: none; }
  .cta-bg-mark { display: none; }
}

@media (max-width: 600px) {
  .btn-lg { width: 100%; text-align: center; }
  .cta-links { flex-direction: column; align-items: flex-start; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
