/* ============================================================
   base.css — Design tokens, themes, typography
   ------------------------------------------------------------
   COLOR SYSTEM  (60 : 30 : 10  →  neutral : secondary : accent)
   • 9-shade warm neutral scale (dominant 60%)
   • Warm secondary: #5b3e36 / #b5a58c  (30%)
   • Brand accent: #9a55bc (purple, 10%)
   • Status: #c1e0af (success / contact) · amber · red
   • Role tokens: bg · surface · text · brand · status · content
   • Contrast: primary text ≥ 8.4:1 · accents meet WCAG AAA (7:1)
     where used as text; accents on large text/decoration per WCAG.
   • Instant dark mode via [data-theme].
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=Syne:wght@600;700;800&family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=DM+Serif+Display&display=swap');

:root {
  /* ===== 9-shade warm neutral scale (dominant) ===== */
  --n-900: #0c0a09;   /* bg-black      */
  --n-800: #1a1714;   /* surface-900   */
  --n-700: #2a2420;   /* surface-800   */
  --n-600: #5b3e36;   /* surface-700 / warm brown */
  --n-500: #7a6b5d;   /* text-mute    */
  --n-400: #9c8d7c;   /* text-soft-2  */
  --n-300: #b5a58c;   /* text-soft / warm tan   */
  --n-200: #d4c9b8;   /* surface-200   */
  --n-100: #faf8f4;   /* bg-light / text on dark */

  /* ===== Brand (accent 10%) — purple #9a55bc ===== */
  --brand-700: #7a3ea0;
  --brand-600: #9a55bc;
  --brand-500: #b074d0;
  --brand-400: #c79ae0;

  /* ===== Status ===== */
  --success: #c1e0af;     /* mint green — contact form / success */
  --success-ink: #1f3a14; /* dark text on success bg (≥ 8.4:1) */
  --warning: #e0b876;
  --error: #e0858a;

  /* ===== Type ===== */
  --font-display: "Playfair Display", Georgia, serif;
  --font-head: "Syne", system-ui, -apple-system, sans-serif;
  --font-nav: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "DM Serif Display", Georgia, serif;

  /* ===== Layout ===== */
  --maxw: 1140px;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
}

/* ---------- DARK (default) ---------- */
:root,
[data-theme="dark"] {
  --bg: var(--n-900);            /* dominant neutral 60% */
  --bg-2: var(--n-800);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(181, 165, 140, 0.14);     /* tan-tinted */
  --border-strong: rgba(181, 165, 140, 0.26);
  --text: var(--n-100);          /* #faf8f4 on #0c0a09 ≈ 18:1 */
  --text-soft: var(--n-300);     /* #b5a58c ≈ 8.2:1 */
  --text-mute: var(--n-500);      /* non-essential */
  --nav-bg: rgba(12, 10, 9, 0.72);
  --shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6);

  --accent-1: var(--brand-600);  /* #9a55bc */
  --accent-2: var(--success);    /* #c1e0af — mint, high contrast on dark */
  --accent-3: var(--n-300);       /* #b5a58c */
  --brand: var(--brand-600);
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  --grad-warm: linear-gradient(135deg, var(--n-300), var(--brand-600));
}

/* ---------- LIGHT ---------- */
[data-theme="light"] {
  --bg: var(--n-100);            /* #faf8f4 cream */
  --bg-2: #ffffff;
  --surface: rgba(12, 10, 9, 0.03);
  --surface-2: rgba(12, 10, 9, 0.05);
  --border: rgba(91, 62, 54, 0.14);        /* brown-tinted */
  --border-strong: rgba(91, 62, 54, 0.26);
  --text: var(--n-900);           /* #0c0a09 on #faf8f4 ≈ 18:1 */
  --text-soft: var(--n-600);      /* #5b3e36 ≈ 9.3:1 */
  --text-mute: var(--n-500);
  --nav-bg: rgba(250, 248, 244, 0.8);
  --shadow: 0 24px 50px -24px rgba(20, 22, 31, 0.18);

  --accent-1: var(--brand-700);   /* darker purple for contrast on light */
  --accent-2: #2f6b22;            /* dark green — mint's high-contrast pair */
  --accent-3: var(--n-600);       /* #5b3e36 brown */
  --brand: var(--brand-700);
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  --grad-warm: linear-gradient(135deg, var(--n-300), var(--brand-600));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

/* Aurora background */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(154, 85, 188, 0.14), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(193, 224, 175, 0.08), transparent 55%),
    var(--bg);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: float 18s var(--ease) infinite;
}
.orb-1 { width: 420px; height: 420px; background: #9a55bc; top: -120px; left: -80px; }
.orb-2 { width: 360px; height: 360px; background: #c1e0af; bottom: -100px; right: -60px; animation-delay: -6s; opacity: 0.3; }
.orb-3 { width: 300px; height: 300px; background: #b5a58c; top: 40%; left: 55%; animation-delay: -12s; opacity: 0.3; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.96); }
}

/* Typography helpers */
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -0.02em; line-height: 1.15; }
a { color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* Layout container */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Section base */
.section { padding: 110px 0; position: relative; }
.section-head { margin-bottom: 56px; max-width: 660px; }
.section-tag {
  display: inline-block;
  font-family: var(--font-nav);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 14px;
}
.section-title { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Page hero (sub-pages) */
.page-hero { padding: calc(var(--nav-h) + 90px) 0 50px; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 700; margin-bottom: 14px; }
.page-hero p { color: var(--text-soft); font-size: 18px; max-width: 600px; }

/* Noscript */
.noscript-warn { background: var(--error); color: #1a1714; text-align: center; padding: 10px; font-size: 14px; }

/* Top loading bar */
.loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 200; transition: width 0.3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
