/* Heartwood — shared stylesheet across index, docs, pricing, signin.
   Warm humanist palette per DESIGN.md. Dark mode keeps the warmth:
   near-black with a slight brown tone, off-white with a cream tint. */

:root {
  /* Light (default) — cream parchment */
  --cream: #f7f4ed;
  --cream-surface: #f7f4ed;
  --cream-elev: #f0ece1;
  --cream-light: #eceae4;
  --charcoal: #1c1c1c;
  --charcoal-82: rgba(28,28,28,0.82);
  --charcoal-40: rgba(28,28,28,0.4);
  --charcoal-12: rgba(28,28,28,0.12);
  --charcoal-04: rgba(28,28,28,0.04);
  --charcoal-03: rgba(28,28,28,0.03);
  --muted: #5f5f5d;
  --offwhite: #fcfbf8;
  --nav-bg: rgba(247,244,237,0.82);
  --code-bg: #f0ece1;
  --code-text: #1c1c1c;

  --inset-dark:
    rgba(255,255,255,0.2) 0 0.5px 0 0 inset,
    rgba(0,0,0,0.2) 0 0 0 0.5px inset,
    rgba(0,0,0,0.05) 0 1px 2px 0;
  --focus-shadow: rgba(0,0,0,0.1) 0 4px 12px;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

body.dark {
  /* Dark — warm near-black, preserves humanist feel. Not pure black. */
  --cream: #17130e;          /* page bg, warm near-black */
  --cream-surface: #1e1a14;  /* elevated surface */
  --cream-elev: #241f18;     /* deeper elevation */
  --cream-light: #2d271e;    /* borders */
  --charcoal: #f3ecd8;       /* primary text — warm off-white */
  --charcoal-82: rgba(243,236,216,0.82);
  --charcoal-40: rgba(243,236,216,0.4);
  --charcoal-12: rgba(243,236,216,0.12);
  --charcoal-04: rgba(243,236,216,0.06);
  --charcoal-03: rgba(243,236,216,0.04);
  --muted: #9c9280;
  --offwhite: #1e1a14;       /* used as btn-dark text color → flips to dark so light buttons read clean */
  --nav-bg: rgba(23,19,14,0.82);
  --code-bg: #241f18;
  --code-text: #f3ecd8;

  --inset-dark:
    rgba(255,255,255,0.08) 0 0.5px 0 0 inset,
    rgba(0,0,0,0.4) 0 0 0 0.5px inset,
    rgba(0,0,0,0.3) 0 1px 2px 0;
  --focus-shadow: rgba(255,255,255,0.15) 0 4px 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 1.5px; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--charcoal); }
img { max-width: 100%; display: block; }
::selection { background: var(--charcoal); color: var(--cream); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ================= Nav ================= */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  transition: background-color .25s ease;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.3px;
  color: var(--charcoal);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 9999px;
  background: radial-gradient(ellipse at 30% 30%, #ffb6c6 0%, #ff8da1 40%, #e5b8ff 70%, #a5c8ff 100%);
  box-shadow: var(--inset-dark);
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--charcoal); font-size: 15px; opacity: 0.85;
  transition: opacity .15s ease;
}
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.active { opacity: 1; font-weight: 500; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.nav-right .login-link {
  font-size: 14px; color: var(--charcoal); opacity: 0.85;
  padding: 8px 4px; text-decoration: none;
}
.nav-right .login-link:hover { opacity: 1; text-decoration: none; }

/* Theme toggle — pill button with sun/moon swap */
.theme-toggle {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--cream-light);
  border-radius: 9999px;
  color: var(--charcoal-82);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  padding: 0;
}
.theme-toggle:hover { background: var(--charcoal-04); color: var(--charcoal); border-color: var(--charcoal-40); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body.dark .theme-toggle .icon-sun { display: block; }
body.dark .theme-toggle .icon-moon { display: none; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px; line-height: 1.35;
  transition: opacity .15s ease, box-shadow .2s ease, transform .2s ease, background .15s ease, color .15s ease;
  user-select: none;
  text-decoration: none;
  border: 0;
}
.btn:hover { text-decoration: none; }
.btn:active { opacity: 0.8; transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-shadow); }
.btn-dark {
  background: var(--charcoal); color: var(--offwhite);
  box-shadow: var(--inset-dark);
}
.btn-dark:hover { box-shadow: var(--inset-dark), 0 6px 20px rgba(0,0,0,0.12); }
.btn-ghost {
  background: transparent; color: var(--charcoal);
  border: 1px solid var(--charcoal-40);
}
.btn-ghost:hover { background: var(--charcoal-04); }
.btn-cream { background: var(--cream-surface); color: var(--charcoal); border: 1px solid var(--cream-light); }
.btn-cream:hover { background: var(--cream-elev); }

/* ================= Typography (shared scale) ================= */
.h-display {
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 600; letter-spacing: -1.5px; line-height: 1.03;
  margin: 0 0 20px;
}
.h2 {
  font-size: clamp(34px, 4vw, 48px); font-weight: 600;
  letter-spacing: -1.2px; line-height: 1.02;
  margin: 0 0 16px;
}
.h3 { font-size: 20px; font-weight: 400; letter-spacing: -0.3px; line-height: 1.25; margin: 0 0 8px; }

/* ================= Page header (for non-hero pages) ================= */
.page-head {
  padding: 64px 0 24px;
  border-bottom: 1px solid var(--cream-light);
  background: var(--cream);
  transition: background-color .25s ease, border-color .25s ease;
}
.breadcrumb {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--charcoal); text-decoration: underline; }
.breadcrumb .sep { color: var(--charcoal-40); }
.breadcrumb .current { color: var(--charcoal); }
.page-title {
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 600; line-height: 1.04;
  letter-spacing: -1.2px;
  margin: 0 0 10px;
  color: var(--charcoal);
}
.page-tagline {
  font-size: 18px; color: var(--muted);
  margin: 0;
  max-width: 640px;
  line-height: 1.5;
}

/* ================= Footer ================= */
footer {
  margin: 80px 24px 24px;
  border-radius: 16px;
  padding: 80px 56px 40px;
  background:
    radial-gradient(60% 60% at 10% 100%, rgba(255,183,201,0.35), transparent 60%),
    radial-gradient(50% 60% at 90% 100%, rgba(180,200,255,0.35), transparent 60%),
    var(--cream-surface);
  border: 1px solid var(--cream-light);
  transition: background-color .25s ease, border-color .25s ease;
}
body.dark footer {
  background:
    radial-gradient(60% 60% at 10% 100%, rgba(255,183,201,0.12), transparent 60%),
    radial-gradient(50% 60% at 90% 100%, rgba(180,200,255,0.12), transparent 60%),
    var(--cream-surface);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px; padding-bottom: 40px;
}
footer h5 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 0 0 16px; font-weight: 500;
}
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
footer li a { text-decoration: none; color: var(--charcoal); font-size: 14px; }
footer li a:hover { text-decoration: underline; }
.footer-foot {
  border-top: 1px solid var(--cream-light); padding-top: 20px;
  display: flex; justify-content: space-between; font-size: 13px; color: var(--muted);
  flex-wrap: wrap; gap: 12px;
}
.big-word {
  font-size: clamp(80px, 18vw, 180px); font-weight: 600; letter-spacing: -6px;
  line-height: 0.9; margin: 56px 0 0;
  background: linear-gradient(180deg, var(--charcoal) 0%, rgba(28,28,28,0.15) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body.dark .big-word {
  background: linear-gradient(180deg, var(--charcoal) 0%, rgba(243,236,216,0.15) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  footer { padding: 48px 24px 24px; margin: 56px 16px 16px; }
}
