/* Lucia marketing site · base tokens, type, controls, nav, footer
   Single visual world (cream / ink / gold). Every surface paints its own ground. */

:root {
  /* palette · the three brand colors and their working tints */
  --cream: #fffef2;
  --cream-2: #f3f2e7;
  --cream-3: #eceadf;
  --line: #e3e2d8;
  --line-strong: #cfcdc0;
  --ink: #191918;
  --ink-2: #3a3936;
  --muted: #555550;           /* lightest text allowed on cream */
  --gold: #fcaa2d;            /* surfaces and rules only on cream */
  --gold-ink: #8a5e08;        /* gold as text on cream */
  --gold-wash: #f9f5e2;
  /* on ink */
  --paper: #fffef2;
  --paper-2: rgba(255, 254, 242, 0.76);
  --paper-line: rgba(255, 254, 242, 0.16);
  --ink-elevated: #22221f;
  /* credit health · the only semantic colors */
  --ok: #3f6d4f;
  --ok-soft: #dfe9e1;
  --watch: #b8860d;
  --watch-soft: #f4ead2;
  --risk: #8b2f2f;
  --risk-soft: #efdcdc;
  /* type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --text-display: clamp(2.75rem, 1.6rem + 4.2vw, 5.4rem);
  --text-h2: clamp(2rem, 1.3rem + 2.4vw, 3.4rem);
  --text-h3: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --text-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;
  --text-label: 0.75rem;     /* 12px floor */
  /* rhythm */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(72px, 6vw + 40px, 140px);
  --radius: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; } /* sticky nav is 72px */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--gold); }
/* skip link · shared by every page (was in sections.css, which sub-pages do not load) */
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--cream); padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
em.gold { font-style: italic; color: var(--gold-ink); }
.dark em.gold { color: var(--gold); }

/* labels · mono, uppercase, never below 12px */
.label {
  font-family: var(--mono);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}
.dark .label { color: var(--paper-2); }
/* keep a product name's own case inside uppercase labels, chips and chart axes (SITE-PLAN D10) */
.cased { text-transform: none !important; }

/* section rail · entry number + hairline + running head */
.rail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: baseline; /* number sits on the running head's first line even when the head wraps */
  margin-bottom: clamp(32px, 4vw, 56px);
}
.rail::after { content: ""; grid-column: 2; height: 1px; background: var(--line-strong); align-self: start; margin-top: calc(var(--text-label) * 0.7); }
.dark .rail::after { background: var(--paper-line); }
.rail .label { grid-row: 1; }
.rail .label:first-child { grid-column: 1; color: var(--gold-ink); }
.dark .rail .label:first-child { color: var(--gold); }
.rail .label:last-child { grid-column: 3; }

/* section heads */
.head { max-width: 62ch; }
.head h2 {
  font-family: var(--serif);
  font-size: var(--text-h2);
  line-height: 1.06;
  letter-spacing: -0.012em;
  font-weight: 500;
}
.head p { margin-top: 18px; font-size: var(--text-lede); color: var(--ink-2); max-width: 58ch; }
.dark .head p { color: var(--paper-2); }

/* buttons · primary gold is for marketing CTAs only; outline is secondary */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent; /* every button shares one box height */
  border-radius: 999px;
  font-weight: 500;
  font-size: var(--text-small);
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms var(--ease), background-color 160ms, border-color 160ms, color 160ms;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: #f5a11f; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--cream); }
.dark .btn-secondary { color: var(--paper); border-color: var(--paper-2); }
.dark .btn-secondary:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn .arrow { transition: transform 200ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
/* --- CHANGE: textlink touch target (padding 10px 0, negative margin to keep visual rhythm) --- */
.textlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: var(--text-small);
  color: var(--gold-ink); text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 10px 0;
  margin: -10px 0;
}
/* --- END: textlink touch target --- */
.textlink:hover { border-bottom-color: currentColor; }
.dark .textlink { color: var(--gold); }

/* chips · one family for status, wash + deep text */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 3px;
  font-family: var(--mono); font-size: var(--text-label); letter-spacing: 0.06em; text-transform: uppercase;
  line-height: 1.5; white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-watch { background: var(--watch-soft); color: #7a5806; }
.chip-risk { background: var(--risk-soft); color: var(--risk); }
.chip-neutral { background: var(--cream-3); color: var(--ink-2); }
.chip-gold { background: var(--gold-wash); color: var(--gold-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-watch { background: var(--watch); }
.dot-risk { background: var(--risk); }

/* ledger rules · the subject's own convention: single rule above a subtotal, double below a total */
.rule-total { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.dark .rule-total { border-color: var(--paper); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 32px; height: 72px; }
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); border-radius: 6px; }
.lockup svg { width: 28px; height: 28px; flex: none; }
.lockup .wordmark { font-family: var(--sans); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; line-height: 1; }
/* Product lockup — "Lucia by eSapiens" (2026-09 family standard, same values as Derek and Magnum) */
.lockup-name { display: inline-flex; align-items: baseline; gap: 6px; }
.lockup-by { font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0; line-height: 1; color: var(--ink-2); white-space: nowrap; transition: color 160ms var(--ease); }
.lockup:hover .lockup-by { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .lockup-by { transition: none; } }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-links a { font-size: var(--text-small); font-weight: 500; text-decoration: none; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--gold); }

/* --- CHANGE: Platform dropdown (pure CSS hover + focus-within) --- */
.has-menu { position: relative; display: flex; align-items: center; } /* the Platform label sits on the same baseline as its siblings */
.has-menu > a { cursor: default; } /* Platform label is not itself a link */
.nav-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 0;
  min-width: 240px;
  z-index: 60;
  box-shadow: 0 4px 16px rgba(25, 25, 24, 0.08);
}
/* 14px transparent bridge so hover does not break crossing the gap */
.has-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
}
.has-menu:hover::after,
.has-menu:focus-within::after { pointer-events: auto; }
.has-menu.menu-dismissed .nav-menu { opacity: 0 !important; pointer-events: none !important; visibility: hidden; } /* Esc closes it even while focus stays on the trigger */
.has-menu:hover .nav-menu,
.has-menu:focus-within .nav-menu {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-menu a {
  display: block;
  padding: 8px 20px;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 0;
}
.nav-menu a:hover { color: var(--ink); background: var(--cream-2); }
.nav-menu .nav-menu-sub {
  display: block;
  font-family: var(--sans);
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 2px;
  text-transform: none;
}
/* --- END: Platform dropdown --- */

.nav-actions { display: flex; align-items: center; gap: 20px; }
/* Sign in is the only bright thing in the header, at every width — there is no second door
   (Isaac 2026-09-02), so it must never be the button that the narrow breakpoint hides. */
/* --- CHANGE: Sign in button touch target ≥ 44px at all breakpoints --- */
.nav-actions .btn { padding: 10px 18px; min-height: 44px; }
/* --- END: Sign in button touch target --- */
/* --- CHANGE: nav-toggle 44×44 touch target --- */
.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--radius); }
/* --- END: nav-toggle touch target --- */
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 1.5px; background: var(--ink); position: relative; content: ""; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav.is-open .nav-links { display: flex; flex-direction: column; gap: 4px; position: absolute; left: 0; right: 0; top: 72px; background: var(--cream); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; margin: 0; }
  .nav.is-open .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  /* --- CHANGE: dropdown flattens inside mobile drawer --- */
  .has-menu::after { display: none; }
  .nav-menu {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 0 16px;
    min-width: 0;
  }
  .nav-menu a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-menu a:hover { background: transparent; }
  /* --- END: dropdown mobile --- */
}
@media (max-width: 359px) { .nav .lockup-by { display: none; } }
@media (max-width: 400px) { .nav-inner { gap: 16px; } .nav-actions { gap: 12px; } .nav-actions .btn { padding: 9px 13px; font-size: var(--text-small); min-height: 44px; } }

/* footer */
.footer { background: var(--cream); border-top: 1px solid var(--line); padding: 56px 0 40px; }

/* --- CHANGE: footer-mark — Newsreader italic "The Loan Book." above the border-top --- */
.footer-mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 1rem + 5vw, 6rem);
  color: var(--line);
  letter-spacing: -0.02em;
  line-height: 1;
  padding-bottom: clamp(24px, 3vw, 40px);
  display: block;
}
/* --- END: footer-mark --- */

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer .lockup { min-height: 44px; }
.footer p { margin-top: 16px; max-width: 34ch; font-size: var(--text-small); color: var(--ink-2); }
.footer h4, .footer .footer-h { font-family: var(--mono); font-size: var(--text-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 14px; } /* column labels are not document headings (h2 → h4 skip) */
.footer li + li { margin-top: 8px; }
/* --- CHANGE: footer link touch target (display block, 10px padding, visual spacing preserved) --- */
.footer li a { display: block; padding: 10px 0; margin: -6px 0; font-size: var(--text-small); color: var(--ink-2); text-decoration: none; }
/* --- END: footer link touch target --- */
.footer li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: var(--text-label); letter-spacing: 0.06em; color: var(--muted); }
/* --- CHANGE: footer ≤760 three columns with brand spanning full width --- */
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } .footer-grid > :first-child { grid-column: 1 / -1; } }
/* --- END: footer responsive --- */

/* motion hygiene */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
