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

:root {
  --bg:            #0A0A0B;
  --bg-surface:    #111113;
  --bg-elevated:   #1A1A1E;
  --accent:        #C8892A;
  --accent-hot:    #F0A830;
  --accent-cool:   #3D6B8E;
  --accent-glow:   rgba(200, 137, 42, 0.18);
  --accent-border: rgba(200, 137, 42, 0.28);
  --text-primary:  #E8E4DC;
  --text-secondary:#8A8580;
  --text-muted:    #4A4845;
  --border:        #1E1E22;
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'DM Mono', 'Courier New', monospace;
  --ease-out:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg:            #F5F0E8;
  --bg-surface:    #EDE8DF;
  --bg-elevated:   #E4DECE;
  --text-primary:  #1C1810;
  --text-secondary:#6A6460;
  --text-muted:    #908C88;
  --accent:        #B07822;
  --accent-hot:    #C8892A;
  --accent-cool:   #3D6B8E;
  --accent-glow:   rgba(176,120,34,0.12);
  --accent-border: rgba(176,120,34,0.3);
  --border:        #D5CFC8;
}

html { scroll-behavior: smooth; font-size: 16px; }

/* ─── FONT SIZE SCALE (accessibility) ──────────────────────────────────────── */
html[data-fontsize="112"] { font-size: 112%; }
html[data-fontsize="125"] { font-size: 125%; }
html[data-fontsize="137"] { font-size: 137%; }

/* ─── HIGH CONTRAST MODE (accessibility) ───────────────────────────────────── */
html[data-contrast="high"] {
  --bg:            #000000;
  --bg-surface:    #000000;
  --bg-elevated:   #0D0D0D;
  --text-primary:  #FFFFFF;
  --text-secondary:#FFFFFF;
  --text-muted:    #E0E0E0;
  --border:        #FFFFFF;
  --accent:        #FFD166;
  --accent-hot:    #FFE08A;
  --accent-glow:   rgba(255, 209, 102, 0.35);
  --accent-border: #FFD166;
}

html[data-contrast="high"][data-theme="light"] {
  --bg:            #FFFFFF;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #F0F0F0;
  --text-primary:  #000000;
  --text-secondary:#000000;
  --text-muted:    #1A1A1A;
  --border:        #000000;
  --accent:        #7A4A00;
  --accent-hot:    #5C3800;
  --accent-glow:   rgba(122, 74, 0, 0.2);
  --accent-border: #7A4A00;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: default;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* Grain texture */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─── TYPOGRAPHY ────────────────────────────────────────────────────────────── */
.label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.1; }

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

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  transition: background 0.3s var(--ease-out), box-shadow 0.3s, transform 0.3s var(--ease-out);
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  box-shadow: 0 0 50px rgba(200, 137, 42, 0.35), 0 4px 20px rgba(200, 137, 42, 0.2);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--accent-border);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(200, 137, 42, 0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}

.btn-primary:hover .btn-arrow,
.btn-ghost:hover .btn-arrow { transform: translateX(4px); }

/* ─── SECTIONS ──────────────────────────────────────────────────────────────── */
section { position: relative; }

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 2.5rem;
}

.section-header { margin-bottom: 4rem; }

.section-header h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-top: 0.75rem;
  font-weight: 300;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
  .reveal.revealed { opacity: 1; transform: none; }
}

/* ─── THEME TOGGLE ──────────────────────────────────────────────────────────── */
.theme-toggle {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color .2s, border-color .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
