/* ============================================================
   Ejoshi — v8 Design System
   Locked palette: Gold #D4AF37 · Cream #FAF0DC · Black #000000
   Type: Fraunces (display) · Inter (body) · JetBrains Mono (eyebrow)
   Built 2026-05-25. Authored to ship on GitHub Pages.
   ============================================================ */

:root {
  /* Brand palette — locked 2026-05-24 (Gold + Cream replaces Bronze) */
  --gold:        #D4AF37;
  --gold-soft:   #E5C570;
  --gold-deep:   #A8862A;
  --cream:       #FAF0DC;
  --cream-muted: #C8C0B2;
  --cream-dim:   #7A7268;
  --black:       #000000;
  --ink:         #0B0907;          /* near-black for body bg */
  --ink-2:       #14110D;          /* card bg */
  --ink-3:       #1C1813;          /* raised surfaces */

  /* Functional */
  --rule:        rgba(212,175,55,0.18);
  --rule-soft:   rgba(250,240,220,0.08);

  /* Type stack */
  --font-serif:  'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:   'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Layout */
  --max-w:       1120px;
  --max-w-prose: 680px;
  --pad-y:       clamp(72px, 10vw, 120px);
  --pad-x:       clamp(20px, 4vw, 32px);
  --r-sm:        4px;
  --r-md:        8px;
  --r-lg:        12px;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--gold-soft); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
::selection { background: var(--gold); color: var(--black); }

/* ── Layout primitives ──────────────────────────────────────── */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }
.wrap-prose { max-width: var(--max-w-prose); margin: 0 auto; padding: 0 var(--pad-x); }

section { padding: var(--pad-y) 0; border-bottom: 1px solid var(--rule); position: relative; }
section.no-rule { border-bottom: none; }
section.cream-mode { background: var(--cream); color: var(--ink); }
section.cream-mode a { color: var(--gold-deep); }
section.cream-mode a:hover { color: var(--black); }

/* ── Typography ─────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  display: inline-block;
}
.cream-mode .eyebrow { color: var(--gold-deep); }

h1, .h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--cream);
}
.cream-mode h1, .cream-mode .h1 { color: var(--ink); }

h2, .h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.cream-mode h2, .cream-mode .h2 { color: var(--ink); }

h3, .h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  line-height: 1.25;
  color: var(--cream);
}
.cream-mode h3, .cream-mode .h3 { color: var(--ink); }

.italic-accent { font-style: italic; color: var(--gold); }
.cream-mode .italic-accent { color: var(--gold-deep); }

.lead {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--cream-muted);
  max-width: 58ch;
  line-height: 1.75;
}
.cream-mode .lead { color: var(--cream-dim); }

p { max-width: 64ch; }
p + p { margin-top: 1em; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 14px 26px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-gold {
  background: var(--gold);
  color: var(--black);
}
.btn-gold:hover { background: var(--gold-soft); color: var(--black); }

.btn-outline {
  background: transparent;
  color: var(--cream);
  border-color: var(--rule);
}
.btn-outline:hover { color: var(--gold); border-color: var(--gold); }
.cream-mode .btn-outline { color: var(--ink); border-color: rgba(0,0,0,.18); }
.cream-mode .btn-outline:hover { color: var(--gold-deep); border-color: var(--gold-deep); }

.link-arrow {
  color: var(--gold);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-arrow::after {
  content: '→';
  transition: transform .18s ease;
}
.link-arrow:hover::after { transform: translateX(3px); }

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 9, 7, .92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { height: 32px; width: auto; }
.nav-brand-text {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--cream);
  letter-spacing: .02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--cream-muted);
  font-size: .95rem;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--gold); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.lang-toggle {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--cream-muted);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.lang-toggle:hover, .lang-toggle.is-active { color: var(--gold); border-color: var(--gold); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--cream);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

@media (max-width: 820px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--ink-2);
    border-bottom: 1px solid var(--rule);
    padding: 18px var(--pad-x);
    align-items: flex-start;
    gap: 14px;
  }
  .nav.is-open .nav-cta .btn { display: inline-flex; }
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding-top: clamp(80px, 12vw, 140px);
  padding-bottom: clamp(80px, 12vw, 140px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(212,175,55,0.10), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(212,175,55,0.04), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { margin: 0 auto 26px; max-width: 22ch; }
.hero .lead { margin: 0 auto 36px; }
.hero-ctas {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.hero-brand-line {
  margin-top: 56px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--gold);
  letter-spacing: .02em;
}

/* ── Section header ─────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 56px;
}
.section-head .lead { margin-top: 14px; }
.section-head .right { flex-shrink: 0; }

/* ── Cards ──────────────────────────────────────────────────── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 32px 28px;
  transition: border-color .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.card:hover { border-color: rgba(212,175,55,0.4); transform: translateY(-2px); }
.cream-mode .card {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.08);
}
.cream-mode .card:hover { border-color: var(--gold-deep); }

.card-eyebrow {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.cream-mode .card-eyebrow { color: var(--gold-deep); }

.card h3 { margin: 0; }
.card p { color: var(--cream-muted); font-size: .98rem; }
.cream-mode .card p { color: var(--cream-dim); }
.card .link-arrow { margin-top: auto; }

/* ── Resource card variant ──────────────────────────────────── */
.resource-card .resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.resource-card .resource-meta span {
  padding: 4px 10px;
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--gold);
}

/* ── Video card variant ─────────────────────────────────────── */
.video-card .video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--ink-3), var(--ink-2));
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
}
.video-card .video-thumb::after {
  content: '▶';
  font-size: 2rem;
  color: var(--gold);
  opacity: .6;
}

/* ── Email signup ───────────────────────────────────────────── */
.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}
.email-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule);
  background: var(--ink-2);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
}
.email-form input[type="email"]::placeholder { color: var(--cream-dim); }
.email-form input[type="email"]:focus { border-color: var(--gold); }
.cream-mode .email-form input[type="email"] {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.18);
  color: var(--ink);
}
.email-microcopy {
  font-size: .82rem;
  color: var(--cream-dim);
  margin-top: 14px;
  text-align: center;
}

/* ── Values grid (3 columns of plain prose, no card chrome) ─── */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 56px;
}
@media (max-width: 820px) { .values-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .values-grid { grid-template-columns: 1fr; } }
.value h3 { margin-bottom: 10px; }
.value p { font-size: .98rem; color: var(--cream-muted); }
.cream-mode .value p { color: var(--cream-dim); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--black);
  color: var(--cream-muted);
  padding: 72px 0 36px;
  border-top: 1px solid var(--rule);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 540px) {
  .footer-top { grid-template-columns: 1fr; }
}
.footer-brand img { height: 36px; width: auto; margin-bottom: 18px; }
.footer-brand p { font-size: .95rem; color: var(--cream-muted); }
.footer h4 {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: var(--cream-muted); font-size: .94rem; }
.footer ul a:hover { color: var(--gold); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 30px;
  border-top: 1px solid var(--rule-soft);
  font-size: .82rem;
  color: var(--cream-dim);
}
.footer-bottom .built-with {
  font-family: var(--font-mono);
  letter-spacing: .08em;
}

/* ── Utility ────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 72px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.muted { color: var(--cream-muted); }
.cream-mode .muted { color: var(--cream-dim); }

/* ── Reduce motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
