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

/* ── Design Tokens — Dark-first (matches app & Stitch) ───── */
:root {
  /* Core surfaces */
  --surface: #12121A;
  --surface-dim: #0C0C12;
  --card: #1A1B2F;
  --card-gradient: linear-gradient(135deg, #2a2b45 0%, #1A1B2F 100%);

  /* Glass / overlay */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(226, 226, 231, 0.10);
  --glass-border-hover: rgba(226, 226, 231, 0.18);

  /* Text */
  --text-primary: #E2E2E7;
  --text-secondary: #A1A1AA;
  --text-white: #FFFFFF;

  /* Accents */
  --accent: #D4AF37;
  --teal: #2D6A6A;

  /* Semantic */
  --error: #E53935;
  --success: #43A047;

  /* Radius */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 20px;
  --sp-2xl: 24px;
  --sp-3xl: 32px;
  --sp-4xl: 48px;
  --sp-5xl: 64px;
  --sp-6xl: 80px;

  /* Fonts */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width: 1100px;
  --nav-height: 64px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-editorial: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ── Light Theme Override ────────────────────────────────── */
[data-theme="light"] {
  --surface: #F8F8FA;
  --surface-dim: #EEEEF2;
  --card: #EEEEF2;
  --card-gradient: linear-gradient(135deg, #F2F2F5 0%, #EEEEF2 100%);

  --glass: rgba(0, 0, 0, 0.04);
  --glass-hover: rgba(0, 0, 0, 0.06);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.14);

  --text-primary: #1A1A2E;
  --text-secondary: #5C5C68;
  --text-white: #1A1A2E;

  --accent: #8B6F1F;
  --teal: #1F5252;

  --error: #C62828;
  --success: #2E7D32;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-editorial: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ── Base ──────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--text-primary);
}

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

/* ── Typography ───────────────────────────────────────────── */
h1 {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-white);
}

h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-white);
}

p {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Editorial Label — tracking-[0.25em] like Stitch ──────── */
.label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Glass Panel ──────────────────────────────────────────── */
.glass {
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-sm);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
}

/* ── Editorial Frame — the Stitch signature ───────────────── */
.editorial-frame {
  position: relative;
  background: var(--card-gradient);
  border-radius: var(--r-xs);
  overflow: hidden;
}

.editorial-frame::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 0.5px solid rgba(226, 226, 231, 0.12);
  pointer-events: none;
  z-index: 2;
}

[data-theme="light"] .editorial-frame::after {
  border-color: rgba(0, 0, 0, 0.06);
}

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0.5px solid var(--glass-border);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 14px;
  height: 14px;
}

/* Default is dark — show sun icon to switch to light */
:root .theme-toggle .icon-sun { display: block; }
:root .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 0.5px solid var(--glass-border);
  padding: var(--sp-4xl) var(--sp-2xl);
  background: var(--surface-dim);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--sp-3xl);
  list-style: none;
}

.footer-links a {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--text-white);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2xl);
}

.footer-copy {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: var(--sp-xl);
    text-align: center;
  }

  .footer-right {
    gap: var(--sp-lg);
  }
}

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

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

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

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.05); }
}

.animate-in {
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }
.animate-in-delay-5 { animation-delay: 0.5s; }
.animate-in-delay-6 { animation-delay: 0.6s; }
