/* ============================================================
   Elaiah: Brand Book v2.0 design system
   Colors, type, radius, spacing and motion all derive from the book.
   ============================================================ */

/* ---------- Fonts (vendored) ---------- */
/* Display / headings: Space Grotesk (open substitute for Söhne, per book) */
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("vendor/fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url("vendor/fonts/space-grotesk-600.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("vendor/fonts/space-grotesk-700.woff2") format("woff2"); }
/* Body / UI: Inter */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("vendor/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("vendor/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("vendor/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("vendor/fonts/inter-700.woff2") format("woff2"); }
/* Mono: kickers, code, data */
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url("vendor/fonts/space-mono-400.woff2") format("woff2"); }

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  /* Core palette */
  --bg: #f8f6f1;
  --bg-alt: #efebe2;
  --ink: #16181d;
  --ink-soft: #55514a;
  --ink-faint: #7a756e;
  --line: #ddd6ca;
  --accent: #456b58;
  --accent-deep: #33513f;
  --accent-soft: #8fb3a0;
  --card-bg: #ffffff;
  /* Surfaces & controls (flip per theme) */
  --header-bg: rgba(248, 246, 241, 0.85);
  --invert-bg: #16181d;
  --invert-fg: #f4f1ea;
  --invert-muted: rgba(244, 241, 234, 0.66);
  --invert-line: rgba(244, 241, 234, 0.14);
  --btn-bg: #16181d;
  --btn-fg: #ffffff;
  --module-empty: #ffffff;
  --values-bg: #12231b;
  --values-fg: #eef1ea;
  --values-muted: rgba(238, 241, 234, 0.6);
  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Radius (0 / 6 / 10 / full) */
  --r-sm: 6px;
  --r-md: 10px;
  --r-full: 999px;
  --max-width: 1120px;
  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171b;
  --bg-alt: #1b1e23;
  --ink: #f4f1ea;
  --ink-soft: #b9b4ab;
  --ink-faint: #8a857d;
  --line: #2b2f35;
  --accent: #74a98e;
  --accent-deep: #8fbfa3;
  --accent-soft: #9cc4ac;
  --card-bg: #1b1e23;
  --header-bg: rgba(21, 23, 27, 0.85);
  --invert-bg: #1f2b24;
  --invert-fg: #f4f1ea;
  --invert-muted: rgba(244, 241, 234, 0.7);
  --invert-line: rgba(244, 241, 234, 0.14);
  --btn-bg: #74a98e;
  --btn-fg: #14161a;
  --module-empty: #23272e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15171b;
    --bg-alt: #1b1e23;
    --ink: #f4f1ea;
    --ink-soft: #b9b4ab;
    --ink-faint: #8a857d;
    --line: #2b2f35;
    --accent: #74a98e;
    --accent-deep: #8fbfa3;
    --accent-soft: #9cc4ac;
    --card-bg: #1b1e23;
    --header-bg: rgba(21, 23, 27, 0.85);
    --invert-bg: #1f2b24;
    --invert-fg: #f4f1ea;
    --invert-muted: rgba(244, 241, 234, 0.7);
    --btn-bg: #74a98e;
    --btn-fg: #14161a;
    --module-empty: #23272e;
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-lead {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 62ch;
  margin-top: 16px;
}

/* Mono kicker/label */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease-out, border-color 0.12s ease-out, color 0.12s ease-out;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { filter: brightness(0.92); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { padding: 9px 16px; font-size: 0.85rem; }
.btn-large { padding: 15px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }

.logo { display: flex; flex-direction: column; justify-content: center; margin-right: auto; line-height: 1; }
.logo-word { display: flex; align-items: center; gap: 0.5rem; }
.logo-mark { width: 1.2rem; height: 1.2rem; color: var(--ink); transform: translateY(0.06rem); }
.logo-accent { fill: var(--accent); }
.logo-ai { color: var(--accent); }
.logo-name { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.03em; }
.logo-tagline {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 6px;
}

.nav { display: flex; gap: 28px; }
.nav a { font-size: 0.92rem; color: var(--ink-soft); transition: color 0.12s ease-out; }
.nav a:hover { color: var(--ink); }
.header-inner .btn-small { margin-left: 4px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: border-color 0.12s ease-out;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; background: transparent;
  border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 18px; margin: 0 auto; background: var(--ink); }

/* ---------- Hero (two-column, module grid) ---------- */
.hero { padding: 88px 0 96px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 7px 16px;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.7rem + 3vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 28px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 0.85rem; color: var(--ink-faint); }

/* Straight accent underline under the key word (geometric, draws in) */
.mark-word { position: relative; white-space: nowrap; }
.mark-word::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -0.06em;
  height: 0.12em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: mark-in 0.5s var(--ease-out) 0.35s forwards;
}
@keyframes mark-in { to { transform: scaleX(1); } }

/* Module grid — the brand's core motif (squares, right angles, one accent) */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
}
.module {
  background: var(--module-empty);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  opacity: 0;
  transform: translateY(8px);
  animation: module-in 0.18s ease-out forwards;
}
.module.is-accent { background: var(--accent); border-color: var(--accent); }
.module:nth-child(1) { animation-delay: 0.00s; }
.module:nth-child(2) { animation-delay: 0.04s; }
.module:nth-child(3) { animation-delay: 0.08s; }
.module:nth-child(4) { animation-delay: 0.12s; }
.module:nth-child(5) { animation-delay: 0.16s; }
.module:nth-child(6) { animation-delay: 0.20s; }
.module:nth-child(7) { animation-delay: 0.24s; }
.module:nth-child(8) { animation-delay: 0.28s; }
.module:nth-child(9) { animation-delay: 0.32s; }
@keyframes module-in { to { opacity: 1; transform: none; } }

/* ---------- Motion: scroll reveals ---------- */
.motion [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.motion [data-reveal].is-visible { opacity: 1; transform: none; }
.motion .grid [data-reveal]:nth-child(2), .motion .steps [data-reveal]:nth-child(2) { transition-delay: 0.06s; }
.motion .grid [data-reveal]:nth-child(3), .motion .steps [data-reveal]:nth-child(3) { transition-delay: 0.12s; }
.motion .grid [data-reveal]:nth-child(4), .motion .steps [data-reveal]:nth-child(4) { transition-delay: 0.18s; }

/* ---------- Grid / Cards ---------- */
.grid { display: grid; gap: 16px; margin-top: 48px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px 24px;
  transition: border-color 0.12s ease-out;
}
.card:hover { border-color: var(--ink-faint); }

.card-icon { color: var(--accent); margin-bottom: 18px; }
.card-icon svg { width: 30px; height: 30px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- Steps (numbered dark squares, per book) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 48px; }
.step { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px 24px; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Compare ---------- */
.compare-card ul { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.compare-card li { font-size: 0.94rem; color: var(--ink-soft); padding-left: 18px; position: relative; }
.compare-card li::before { content: "–"; position: absolute; left: 0; color: var(--ink-faint); }
.compare-card-highlight { background: var(--invert-bg); border-color: var(--invert-bg); color: var(--invert-fg); }
.compare-card-highlight h3 { color: var(--invert-fg); }
.compare-card-highlight li { color: var(--invert-muted); }
.compare-card-highlight li::before { content: "✓"; color: var(--accent-soft); }

/* ---------- CTA ---------- */
.cta { background: var(--invert-bg); color: var(--invert-fg); padding: 96px 0; }
.cta-inner { text-align: center; max-width: 560px; }
.cta h2 { margin-bottom: 14px; }
.cta p { color: var(--invert-muted); margin-bottom: 32px; font-size: 1.1rem; }
.cta .btn-primary { background: var(--invert-fg); color: var(--invert-bg); }
.cta .btn-primary:hover { filter: brightness(0.92); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-details { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.contact-details a { font-weight: 600; font-size: 1.1rem; }
.contact-details span { color: var(--ink-faint); font-size: 0.9rem; }
.contact-form {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.form-row input, .form-row textarea {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px;
  font: inherit; color: var(--ink); background: var(--bg); resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.form-note { font-size: 0.88rem; color: var(--accent); min-height: 1.2em; }

/* ---------- Values band + Footer ---------- */
.site-footer { background: var(--values-bg); color: var(--values-fg); }
.values { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 28px; align-items: start; padding: 48px 0 40px; }
.values-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-soft); padding-top: 4px; max-width: 90px; line-height: 1.5;
}
.value { display: flex; flex-direction: column; gap: 10px; }
.value-icon { color: var(--accent-soft); }
.value-icon svg { width: 26px; height: 26px; }
.value h4 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; }
.value p { font-size: 0.82rem; line-height: 1.5; color: var(--values-muted); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; border-top: 1px solid var(--invert-line);
  color: var(--values-muted); font-size: 0.85rem;
}
.footer-inner a:hover { color: var(--values-fg); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .module-grid { max-width: 340px; margin: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .values { grid-template-columns: repeat(2, 1fr); gap: 24px 28px; }
  .values-label { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 720px) {
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); flex-direction: column; padding: 16px 24px; gap: 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .header-inner .btn-small { display: none; }
  .hero { padding: 64px 0; }
  .grid-4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 22px; }
  .section { padding: 64px 0; }
  .values { grid-template-columns: 1fr; gap: 22px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .nav a, .theme-toggle { transition: none; }
  .mark-word::after { animation: none; transform: scaleX(1); }
  .module { animation: none; opacity: 1; transform: none; }
  .motion [data-reveal] { transition: none; opacity: 1; transform: none; }
}
