/* =====================================================================================================================
   Lumehush design system: tokens + components shared by every lumehush.com page (marketing, help, account).
   Rules and reasoning: DESIGN.md. Pages add layout only; they never redefine tokens or restyle components.
   No inline styles anywhere (the CSP forbids them).
   ===================================================================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-var-latin.woff2') format('woff2'); /* Inter 4: weight 100-900 + optical size 14-32 */
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Colour: charcoal, cream, one gold accent used sparingly. Contrast on --bg: text 16.9:1, text-2 8.6:1, text-3 5.0:1. */
  --bg: #0b0a09;          /* page */
  --surface: #131210;     /* cards, panels */
  --raised: #1a1816;      /* inputs */
  --line: rgba(242, 237, 228, .09);
  --line-strong: rgba(242, 237, 228, .18);
  --text: #f2ede4;        /* cream: headings, emphasis, primary button */
  --text-2: #b4ada2;      /* body copy */
  --text-3: #8a8378;      /* captions, meta (still AA for normal text) */
  --gold: #d9a95f;        /* accent: eyebrows, focus ring, icons, the mark. Never large fills, never text gradients */
  --gold-soft: rgba(217, 169, 95, .16);
  --danger: #f0a090;

  /* Type: Inter, display optical size for headings, text optical size for body (automatic via font-optical-sizing) */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-display: clamp(44px, 6.4vw, 80px);
  --fs-h1: clamp(36px, 4.8vw, 60px);
  --fs-h2: clamp(30px, 3.6vw, 44px);
  --fs-h3: clamp(20px, 1.9vw, 24px);
  --fs-lead: clamp(18px, 1.6vw, 21px);
  --fs-body: 17px;
  --fs-small: 15px;
  --fs-caption: 13px;
  --fs-eyebrow: 12px;

  /* Space: 4 px base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 160px;
  --section: clamp(96px, 12vw, 168px);
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1200px;        /* page content */
  --max-wide: 1320px;   /* hero product shot */
  --max-text: 680px;    /* prose, legal, centred intros */
  --max-narrow: 560px;  /* forms */

  /* Shape and depth */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  --shadow-shot: 0 30px 80px -24px rgba(0, 0, 0, .75), 0 12px 24px -12px rgba(0, 0, 0, .5);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 160ms; --t-base: 260ms; --t-slow: 480ms;

  /* Legacy aliases for pages written before DESIGN.md. Do not use in new CSS. */
  --bg0: var(--bg); --bg1: var(--surface); --s2c: var(--raised); --text1: var(--text); --text2: var(--text-2); --text3: var(--text-3);
  --gold-hi: var(--text); --gold-lo: var(--gold);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text-2);
  font: 400 var(--fs-body)/1.6 var(--font); font-optical-sizing: auto; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
::selection { background: var(--gold-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
.skip { position: absolute; left: -9999px; top: var(--s3); z-index: 20; background: var(--text); color: var(--bg); padding: var(--s2) var(--s4); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip:focus { left: var(--s3); }
.visually-hidden, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 3. Type ---------- */
h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 600; text-wrap: balance; }
.t-display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -.035em; }
h1, .t-h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -.03em; }
h2, .t-h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -.025em; }
h3, .t-h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -.012em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.small { font-size: var(--fs-small); }
.caption { font-size: var(--fs-caption); color: var(--text-3); line-height: 1.5; }
.eyebrow { display: block; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 var(--s4); }
.muted { color: var(--text-3); }
strong { color: var(--text); font-weight: 600; }

/* Links: cream with a hairline underline that turns gold on hover. */
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
a:hover { text-decoration-color: var(--gold); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; }
.link-arrow::after { content: '\2192'; transition: transform var(--t-fast) var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- 4. Layout ---------- */
.wrap { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(var(--max-wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { max-width: calc(var(--max-text) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
section, .section { padding-top: var(--section); }
.head { max-width: var(--max-text); margin-bottom: var(--s8); }
.head.center { margin-left: auto; margin-right: auto; text-align: center; }
.head .lead, .head p { margin-top: var(--s5); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- 5. Components ---------- */
/* Header / nav */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 10, 9, .82); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand .mark { width: 28px; height: 28px; }
.brand .word { width: 108px; height: auto; }
.nav { display: flex; align-items: center; gap: var(--s6); }
.nav a { color: var(--text-2); text-decoration: none; font-size: var(--fs-small); font-weight: 500; transition: color var(--t-fast) var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } .brand .word { width: 96px; } }

/* Buttons: primary (cream), secondary (hairline), small size. One primary per view. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5);
  border-radius: var(--r-pill); border: 1px solid var(--text); background: var(--text); color: var(--bg) !important;
  font: 600 var(--fs-small)/1 var(--font); letter-spacing: -.005em; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { background: #fffaf1; border-color: #fffaf1; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.secondary, .btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text) !important; }
.btn.secondary:hover, .btn.ghost:hover { border-color: var(--text-2); background: rgba(242, 237, 228, .04); }
.btn.small { min-height: 36px; padding: 0 var(--s4); font-size: 14px; }
.actions, .cta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.actions.center { justify-content: center; }

/* Cards: flat surface, hairline. No glow, no lift. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); }
.card h3 { margin-bottom: var(--s3); }
.card p { font-size: var(--fs-small); }
.icon { width: 24px; height: 24px; color: var(--gold); margin-bottom: var(--s4); }
.icon svg { width: 24px; height: 24px; }
.list { margin: var(--s4) 0 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.list li { padding: var(--s2) 0; border-top: 1px solid var(--line); }

/* Product shots: crisp, hairline frame, soft neutral shadow. No tilt, no coloured glow. */
.shot, .frame { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-shot); }
.shot img, .frame img { width: 100%; }
figure { margin: 0; }
figcaption { margin-top: var(--s3); font-size: var(--fs-caption); color: var(--text-3); }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--s2); }
.label { font-size: var(--fs-small); font-weight: 500; color: var(--text); }
.input {
  width: 100%; min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text); font: 400 16px var(--font);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px var(--gold-soft); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.help { font-size: var(--fs-caption); color: var(--text-3); }
.status { min-height: 1.5em; font-size: var(--fs-small); color: var(--text-2); }
.status.ok { color: var(--text); }
.status.err { color: var(--danger); }

/* Disclosure (FAQ) */
.faq { max-width: var(--max-text); margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s5) var(--s7) var(--s5) 0; color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: -.01em; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 4px; top: 50%; width: 12px; height: 1.5px; background: var(--text-2); }
.faq summary::before { content: ''; position: absolute; right: 9.25px; top: calc(50% - 5.25px); width: 1.5px; height: 12px; background: var(--text-2); transition: transform var(--t-base) var(--ease); }
.faq details[open] summary::before { transform: scaleY(0); }
.faq details p { padding: 0 0 var(--s5); max-width: 62ch; }

/* Footer */
body > footer { margin-top: var(--section); border-top: 1px solid var(--line); padding: var(--s7) 0 var(--s8); font-size: var(--fs-small); color: var(--text-3); }
body > footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: center; justify-content: space-between; }
body > footer nav { display: flex; flex-wrap: wrap; gap: var(--s5); }
body > footer a { color: var(--text-2); text-decoration: none; }
body > footer a:hover { color: var(--text); }

/* Long-form prose. .legal = a centred single-column page container (privacy, terms); .prose = the type rules,
   usable inside any layout (help, changelog). */
.legal { max-width: calc(var(--max-text) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s9) var(--gutter) 0; }
.prose p, .prose li { max-width: 68ch; }
.prose h1, .legal h1 { margin-bottom: var(--s3); }
.prose .meta, .legal .meta { color: var(--text-3); font-size: var(--fs-small); margin-bottom: var(--s6); }
.prose .notice, .legal .draft { border-left: 2px solid var(--gold); padding: var(--s1) 0 var(--s1) var(--s4); margin: 0 0 var(--s7); color: var(--text); font-size: var(--fs-small); }
.prose h2, .legal h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.012em; margin: var(--s7) 0 var(--s3); }
.prose p + p, .legal p + p { margin-top: var(--s4); }
.prose ul, .legal ul { padding-left: 1.2em; margin: var(--s3) 0 0; }
.prose li, .legal li { margin-top: var(--s2); }
.prose li::marker, .legal li::marker { color: var(--text-3); }

/* ---------- 6. Home page sections ---------- */
.hero { padding-top: var(--s10); text-align: center; }
.hero .mark { width: 56px; height: 56px; margin: 0 auto var(--s6); }
.hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -.035em; max-width: 13ch; margin: 0 auto; }
.hero h1 .soft { color: var(--text-3); }
.hero .lead { max-width: 32em; margin: var(--s5) auto 0; }
.hero .actions { justify-content: center; margin-top: var(--s7); }
.hero .caption { margin-top: var(--s4); }
.hero-shot { margin-top: var(--s9); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s8) var(--s6); }
.features .feature { border-top: 1px solid var(--line); padding-top: var(--s5); }
.features h3 { margin-bottom: var(--s3); }
.features p { font-size: var(--fs-small); }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; gap: var(--s7); } }

.show { display: grid; grid-template-columns: 4fr 8fr; gap: var(--s8); align-items: center; }
.show + .show { margin-top: var(--s10); }
.show.flip { grid-template-columns: 8fr 4fr; }
.show.flip .copy { order: 2; }
.show .copy p { margin-top: var(--s4); }
@media (max-width: 900px) { .show, .show.flip { grid-template-columns: 1fr; gap: var(--s6); } .show.flip .copy { order: 0; } .show + .show { margin-top: var(--s9); } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: var(--s10); align-items: start; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; margin-top: var(--s9); } }

.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s6); border-top: 1px solid var(--line); padding-top: var(--s6); }
.principles h3 { font-size: 17px; margin-bottom: var(--s2); }
.principles p { font-size: var(--fs-small); color: var(--text-3); }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .principles { grid-template-columns: 1fr; } }

.join { text-align: center; }
.join .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s9) var(--gutter); }
.join .lead { max-width: 30em; margin: var(--s4) auto 0; }
.signup { display: flex; gap: var(--s3); max-width: var(--max-narrow); margin: var(--s7) auto 0; }
.signup .input { flex: 1; min-width: 0; border-radius: var(--r-pill); padding: 0 var(--s5); }
@media (max-width: 520px) { .signup { flex-direction: column; } }
.join .status { margin-top: var(--s4); }
.join .caption { max-width: 46em; margin: var(--s4) auto 0; }
.feature-more { margin-top: var(--s7); }
