/* ============================================================
   KETTLE SYSTEMS — CORE DESIGN SYSTEM
   Shared across all pages. Page-specific styles stay inline.
   ============================================================ */

/* --- 1. THEME TOKENS --- */

:root {
  --serif: 'EB Garamond', Georgia, serif;
  --condensed: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;
  --nav-height: 56px;
  --max-w: 940px;
  --section-pad: 4rem;
}

[data-theme="dark"] {
  --ochre: #c4863a;
  --ochre-dim: #9e6c2e;
  --ochre-glow: #d9a05a;
  --ochre-border: rgba(196,134,58,0.12);
  --bg: #0e0d0b;
  --bg-raised: #141311;
  --bg-card: #1a1816;
  --border: rgba(196,134,58,0.08);
  --border-mid: rgba(196,134,58,0.14);
  --text-primary: #e8e4df;
  --text-body: #b0aaa1;
  --text-dim: #6b6560;
  --text-faint: #3d3935;
  --nav-bg: rgba(14,13,11,0.94);
}

[data-theme="light"] {
  --ochre: #c4863a;
  --ochre-dim: #9e6c2e;
  --ochre-glow: #a87420;
  --ochre-border: rgba(30,25,20,0.1);
  --bg: #f8f6f3;
  --bg-raised: #efecea;
  --bg-card: #ffffff;
  --bg-dark: #0e0d0b;
  --border: rgba(30,25,20,0.08);
  --border-mid: rgba(30,25,20,0.14);
  --text-primary: #1a1815;
  --text-body: #4a453d;
  --text-dim: #8a8379;
  --text-faint: #c2bdb5;
  --nav-bg: rgba(248,246,243,0.94);
  --green: #3d8c40;
  --yellow: #a07828;
  --gray-pill: #8a8379;
}

/* --- 2. BASE RESET & TYPOGRAPHY --- */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--text-primary); line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.5rem; max-width: 680px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.2rem; max-width: 600px; }
h1 em, h2 em { font-style: italic; color: var(--ochre-glow); }
.body-text { font-size: 1rem; color: var(--text-body); line-height: 1.85; max-width: 600px; margin-bottom: 1.5rem; }

/* --- 3. STRUCTURAL CLASSES --- */

section { padding: var(--section-pad) 2.5rem; max-width: var(--max-w); margin: 0 auto; }
.page-hero { padding-top: calc(var(--nav-height) + var(--section-pad)); }
.section-rule { width: 40px; height: 1px; background: var(--ochre); margin-bottom: 1.4rem; }
.label { font-family: var(--condensed); font-weight: 600; font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ochre); }
.divider { max-width: var(--max-w); margin: 0 auto; padding: 0 2.5rem; }
.divider-line { height: 1px; background: linear-gradient(to right, transparent, var(--border-mid), transparent); }
.page-border { max-width: var(--max-w); margin: 0 auto; padding: 0 2.5rem; }
.page-border-line { height: 1px; background: var(--border-mid); }

/* --- 4. NAVIGATION --- */

.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height); padding: 0 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
[data-theme="dark"] .site-nav.scrolled { box-shadow: 0 1px 6px rgba(0,0,0,0.3); border-bottom-color: var(--border-mid); }
[data-theme="light"] .site-nav.scrolled { box-shadow: 0 1px 6px rgba(0,0,0,0.08); border-bottom-color: var(--border-mid); }
.nav-mark { font-family: var(--condensed); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ochre); text-decoration: none; }
.nav-links { display: flex; gap: 1.8rem; list-style: none; align-items: center; }
.nav-links a { font-family: var(--condensed); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; transition: color 0.25s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--ochre); }
.nav-links a.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 1px; background: var(--ochre); }
.nav-contact { color: var(--bg) !important; background: var(--ochre); padding: 0.4rem 1.1rem; font-weight: 600; font-size: 0.62rem; letter-spacing: 0.15em; transition: background 0.25s; }
.nav-contact:hover { background: var(--ochre-glow); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--ochre); margin: 4px 0; }

/* --- 5. FOOTER --- */

.site-footer { padding: 2.5rem; text-align: center; border-top: 1px solid var(--border); }
.footer-nav { display: flex; justify-content: center; gap: 2rem; list-style: none; margin-bottom: 1.2rem; }
.footer-nav a { font-family: var(--condensed); font-size: 0.56rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-dim); text-decoration: none; transition: color 0.25s; }
.footer-nav a:hover { color: var(--ochre); }
.footer-mark { font-family: var(--condensed); font-weight: 600; font-size: 0.54rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-dim); opacity: 0.5; }

.site-footer.footer-dark { background: var(--bg-dark, #0e0d0b); border-top: none; }
.site-footer.footer-dark .footer-nav a { color: #6b6560; }
.site-footer.footer-dark .footer-nav a:hover { color: var(--ochre); }
.site-footer.footer-dark .footer-mark { color: #6b6560; }

/* --- 6. ANIMATION UTILITIES --- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-cascade > * { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-cascade.visible > * { opacity: 1; transform: translateY(0); }
.reveal-cascade.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-cascade.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-cascade.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-cascade.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-cascade.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-cascade.visible > *:nth-child(6) { transition-delay: 400ms; }

.page-fade-in { opacity: 0; animation: page-enter 0.4s ease 0.05s forwards; }
@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }

/* --- 7. SHARED INTERACTIVE STATES --- */

.pain-card, .use-card, .comp, .proof-cell { transition: background 0.25s ease; }
[data-theme="dark"] .pain-card:hover,
[data-theme="dark"] .use-card:hover { background: var(--bg-raised); }
[data-theme="light"] .comp:hover { background: var(--bg-raised); }
[data-theme="dark"] .comp:hover { background: var(--bg-raised); }

/* --- 8. RESPONSIVE --- */

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--nav-bg); backdrop-filter: blur(12px); flex-direction: column; padding: 1rem 1.5rem; gap: 0.8rem; border-bottom: 1px solid var(--border-mid); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  section, .page-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
  .footer-nav { flex-wrap: wrap; gap: 1rem; }
}
