/* ════════════════════════════════════════════════════════════════════
   Sol del Sur — shared foundation
   Tokens · typography · primitives · both themes
   Used by index.html, design-system.html, platform.html
   Font paths are relative to this file (assets/ → ../fonts/)
   ════════════════════════════════════════════════════════════════════ */

/* ── Self-hosted WOFF2 fonts ────────────────────────────────────────── */
@font-face { font-family:'Cormorant Garamond'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/cormorant-garamond-400.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant Garamond'; font-style:italic; font-weight:400; font-display:swap; src:url('../fonts/cormorant-garamond-400-italic.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant Garamond'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/cormorant-garamond-500.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant Garamond'; font-style:italic; font-weight:500; font-display:swap; src:url('../fonts/cormorant-garamond-500-italic.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Cormorant Garamond'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/cormorant-garamond-600.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Geist'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/geist-400.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Geist'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/geist-500.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Geist'; font-style:normal; font-weight:600; font-display:swap; src:url('../fonts/geist-600.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Geist Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('../fonts/geist-mono-400.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family:'Geist Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('../fonts/geist-mono-500.woff2') format('woff2'); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

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

/* ── Tokens · Light (default) ──────────────────────────────────────── */
:root {
  --accent:        #C8813A;
  --accent-hover:  #B0702C;
  --accent-tint:   #FADDC0;
  --accent-text:   #7A4010;
  --accent-on:     #FFF5EA;
  --teal:          #1A7A6E;
  --teal-tint:     #A8E8E2;
  --teal-text:     #0A504A;
  --canary:        #D4A843;
  --canary-tint:   #FCF2D0;
  --canary-text:   #7A5800;
  --bg:            #F5F1EA;
  --surface:       #FDFAF5;
  --surface-2:     #EDE8DE;
  --surface-3:     #E3DDD4;
  --border:        rgba(42,36,32,0.12);
  --border-strong: rgba(42,36,32,0.22);
  --text:          #2A2420;
  --text-muted:    #7A7268;
  --text-subtle:   #B0A898;
  --success:       #1A7A6E;
  --success-bg:    #D6F2EE;
  --warning:       #D4A843;
  --warning-bg:    #FCF2D0;
  --error:         #B84040;
  --error-bg:      #FAE0E0;
  --shadow-sm:     0 1px 2px rgba(42,36,32,0.06);
  --shadow-md:     0 2px 8px rgba(42,36,32,0.08), 0 1px 3px rgba(42,36,32,0.04);
  --shadow-lg:     0 8px 32px rgba(42,36,32,0.12), 0 2px 8px rgba(42,36,32,0.06);
  --shadow-focus:  0 0 0 3px rgba(200,129,58,0.18);
  --focus:         var(--shadow-focus);
  --serif:         'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --serif-long:    'Lora', Georgia, serif;
  --sans:          'Geist', system-ui, -apple-system, sans-serif;
  --mono:          'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  --space-32: 128px;
  --radius-badge: 3px;   --radius-chip: 4px;    --radius-btn: 6px;
  --radius-card-sm: 8px; --radius-card: 10px;   --radius-card-lg: 12px;
  --radius-panel: 16px;
  --duration-fast: 100ms;   --duration-default: 150ms;
  --duration-smooth: 200ms; --duration-modal: 250ms;  --duration-page: 300ms;
  --ease-default: ease;
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-modal:   cubic-bezier(0.2, 0, 0, 1);
  --ease-sig:     var(--ease-modal);
  --ease-out:     var(--ease-smooth);
  --width-marketing: 1200px; --width-app: 1100px; --width-prose: 680px;
  --width-form: 560px;       --width-chat: 760px;
  --width-sidebar: 240px;    --width-rail: 48px;
  --max:   var(--width-marketing);
  --prose: var(--width-prose);
  color-scheme: light dark;
}

/* ── Tokens · Dark ─────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --accent:        #E09B52;
  --accent-hover:  #ECAE6B;
  --accent-tint:   #3A2010;
  --accent-text:   #F5C990;
  --accent-on:     #1C1814;
  --teal:          #23A093;
  --teal-tint:     #0F3A36;
  --teal-text:     #6DDDD2;
  --canary:        #E8C467;
  --canary-tint:   #3A2E08;
  --canary-text:   #F5DC9A;
  --bg:            #1C1814;
  --surface:       #242018;
  --surface-2:     #2E2820;
  --surface-3:     #382E26;
  --border:        rgba(255,240,220,0.08);
  --border-strong: rgba(255,240,220,0.16);
  --text:          #F0EBE2;
  --text-muted:    #9A9288;
  --text-subtle:   #5A5450;
  --success:       #23A093;
  --success-bg:    #0A2A22;
  --warning:       #E8C467;
  --warning-bg:    #2E2008;
  --error:         #E06060;
  --error-bg:      #2A0E0E;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:     none;
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);
  --shadow-focus:  0 0 0 3px rgba(224,155,82,0.28);
  --focus:         var(--shadow-focus);
}

/* ── Base ──────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
::selection { background: var(--accent-tint); color: var(--accent-text); }

/* ── Typography — design system §3 ────────────────────────────────── */
.display {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3rem);
  line-height: 1.08; letter-spacing: -0.02em;
}
h1, .h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  line-height: 1.12; letter-spacing: -0.02em;
}
h2, .h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.2; letter-spacing: -0.015em;
}
h3, .h3 { font-family: var(--sans); font-weight: 500; font-size: 1.0625rem; line-height: 1.35; }

.eyebrow {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.65rem; display: inline-flex; align-items: center; gap: 0.6rem;
}
.accent-rule { width: 36px; height: 2px; background: var(--accent); border-radius: 1px; margin: 0.85rem 0 1.4rem; }

.divider {
  display: flex; align-items: center; justify-content: center; gap: 0.9rem;
  margin: clamp(3rem, 7vw, 5rem) 0; color: var(--accent);
}
.divider::before, .divider::after {
  content: ''; height: 1px; flex: 1; max-width: 220px;
  background: color-mix(in oklab, var(--accent) 25%, transparent);
}
.divider span { font-size: 0.85rem; letter-spacing: 0.3em; opacity: 0.9; }

.meta { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.03em; color: var(--text-muted); }

/* ── Tags ──────────────────────────────────────────────────────────── */
.tag { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.02em; padding: 3px 8px; border-radius: 3px; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.tag-sol    { background: var(--accent-tint); color: var(--accent-text); }
.tag-teal   { background: var(--teal-tint);   color: var(--teal-text); }
.tag-canary { background: var(--canary-tint);  color: var(--canary-text); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; line-height: 1;
  padding: 0 1.15rem; height: 40px; border-radius: 6px;
  border: 1.5px solid transparent; text-decoration: none; cursor: pointer;
  transition: background 0.15s var(--ease-out), border-color 0.15s, color 0.15s;
}
.btn-primary  { background: var(--accent); color: var(--accent-on); }
.btn-primary:hover  { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { height: 34px; font-size: 0.8125rem; padding: 0 0.85rem; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.15s var(--ease-out); }
.card:hover { border-color: var(--border-strong); }
.card-featured { border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }

/* ── Focus ─────────────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--focus);
}

/* ── Layout ────────────────────────────────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 40px; }
@media (max-width: 1023px) { .wrap { padding: 0 24px; } }
@media (max-width: 639px)  { .wrap { padding: 0 16px; } }

/* ── Scroll reveal (homepage) ──────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease-sig), transform 0.6s var(--ease-sig); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
