/* ============================================================
   Kylume - Design System tokens
   Source: Docs/Vol1_Kylume_Design_System.html (v1.0)
   ============================================================ */

:root {
  --ink-navy: #0E1A2E;      /* dominant base, 60% */
  --deep-navy: #081120;     /* long shadows, recessed planes */
  --signal-amber: #F5B23E;  /* the "aha" - never decorative */
  --slate: #63728B;         /* secondary / inactive / labels */
  --ivory: #F2EEE4;         /* text on navy, light surfaces */
  --navy-mid: #12213A;
  --shield-teal: #2F7A78;   /* FamilyShield product accent - protection, verification */
  --alert-red: #C1443A;     /* genuinely urgent moments only */

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ease-calm: cubic-bezier(.22,.61,.36,1);

  /* dark theme (default - matches the design system's native canvas) */
  --bg: var(--deep-navy);
  --surface: var(--ink-navy);
  --surface-2: var(--navy-mid);
  --text: var(--ivory);
  --text-dim: rgba(242,238,228,0.72);
  --text-faint: rgba(242,238,228,0.55);
  --border: rgba(242,238,228,0.12);
  --border-soft: rgba(242,238,228,0.09);
  --accent: var(--signal-amber);
  --accent-ink: #0E1A2E;
  --shadow-color: rgba(8,17,32,0.5);
  --selection-bg: #F5B23E;
  --selection-text: #0E1A2E;
}

:root[data-theme="light"] {
  --bg: var(--ivory);
  --surface: #FFFFFF;
  --surface-2: #EAE5D8;
  --text: var(--ink-navy);
  --text-dim: rgba(14,26,46,0.72);
  --text-faint: rgba(14,26,46,0.55);
  --border: rgba(14,26,46,0.1);
  --border-soft: rgba(14,26,46,0.08);
  --accent: var(--signal-amber);
  --accent-ink: #0E1A2E;
  --shadow-color: rgba(14,26,46,0.16);
  --selection-bg: #0E1A2E;
  --selection-text: #F5B23E;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: var(--ivory);
    --surface: #FFFFFF;
    --surface-2: #EAE5D8;
    --text: var(--ink-navy);
    --text-dim: rgba(14,26,46,0.72);
    --text-faint: rgba(14,26,46,0.55);
    --border: rgba(14,26,46,0.1);
    --border-soft: rgba(14,26,46,0.08);
    --shadow-color: rgba(14,26,46,0.16);
    --selection-bg: #0E1A2E;
    --selection-text: #F5B23E;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .35s var(--ease-calm), color .35s var(--ease-calm);
}

::selection { background: var(--selection-bg); color: var(--selection-text); }

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 40px; }
}

/* ---------- header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 10px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

nav.primary {
  display: none;
  align-items: center;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

nav.primary a { transition: color .2s var(--ease-calm); }
nav.primary a:hover { color: var(--accent); }

@media (min-width: 860px) {
  nav.primary { display: flex; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- mobile menu (nav.primary hides below 860px) ---------- */

.nav-toggle {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s var(--ease-calm), transform .2s var(--ease-calm);
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle:active { transform: scale(0.94); }
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-burger { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
}

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a.is-active { color: var(--accent); }

@media (min-width: 720px) { .mobile-nav a { padding: 16px 40px; } }
@media (min-width: 860px) { .mobile-nav { display: none !important; } }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s var(--ease-calm), transform .2s var(--ease-calm);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: transform .2s var(--ease-calm), opacity .2s var(--ease-calm), border-color .2s var(--ease-calm);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- eyebrow / pills ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 15px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- hero ---------- */

.hero {
  padding: 88px 0 80px;
  position: relative;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 7vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 26px 0 24px;
  max-width: 15ch;
  text-wrap: balance;
}

.hero h1 .accent { color: var(--accent); }

.hero p.lede {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 58ch;
  margin: 0 0 40px;
}

.hero .cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-mark {
  position: absolute;
  right: 40px;
  top: 60px;
  opacity: 0.9;
  animation: kyFloat 7s ease-in-out infinite;
}

@media (max-width: 900px) { .hero-mark { display: none; } }

@keyframes kyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- section shell ---------- */

section.block {
  padding: 40px 0 92px;
  border-top: 1px solid var(--border);
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 44px 0 12px;
}

.block-num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--accent); }
.block-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--slate); text-transform: uppercase; }

.block h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  max-width: 20ch;
}

.block p.desc {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0 0 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
}

/* ---------- reveal-on-scroll (calm, no shake) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-calm), transform .7s var(--ease-calm);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-mark { animation: none; }
}

/* ---------- worlds ---------- */

.worlds-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 820px) { .worlds-grid { grid-template-columns: repeat(3, 1fr); } }

.world-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s var(--ease-calm), border-color .3s var(--ease-calm);
}
.world-card:hover { transform: translateY(-4px); border-color: rgba(245,178,62,0.3); }

.world-card .art {
  aspect-ratio: 16/10;
  background: var(--deep-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
:root[data-theme="light"] .world-card .art { background: var(--ink-navy); }

.world-card .art .tag {
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.world-card .body { padding: 24px 26px 28px; }

.world-card .kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--slate);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.world-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  line-height: 1.15;
}

.world-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-faint);
  margin: 0 0 18px;
}

.world-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
}
.world-stats strong { color: var(--accent); font-family: var(--font-display); font-size: 15px; display: block; }

/* ---------- traits ---------- */

.traits { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 40px; }
@media (min-width: 720px) { .traits { grid-template-columns: repeat(3, 1fr); } }

.trait { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; }
.trait .k { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-bottom: 14px; letter-spacing: 0.04em; }
.trait h4 { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; margin: 0 0 8px; }
.trait p { font-size: 13.5px; color: var(--text-faint); line-height: 1.5; margin: 0; }

/* ---------- CTA / end card ---------- */

.end-card {
  background: var(--deep-navy);
  border: 1px solid rgba(245,178,62,0.18);
  border-radius: 20px;
  padding: 64px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}
:root[data-theme="light"] .end-card { background: var(--ink-navy); }

.end-card .quote {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ivory);
  max-width: 16ch;
}
.end-card .quote .accent { color: var(--accent); }

.subscribe-form {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 13px 18px;
  border-radius: 100px;
  border: 1px solid rgba(242,238,228,0.25);
  background: rgba(242,238,228,0.06);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 14px;
}
.subscribe-form input[type="email"]::placeholder { color: rgba(242,238,228,0.45); }
.subscribe-form input[type="email"]:focus { outline: none; border-color: var(--accent); }

.subscribe-note { font-family: var(--font-mono); font-size: 11px; color: rgba(242,238,228,0.4); margin-top: 14px; }

.socials {
  display: flex;
  gap: 16px;
  margin-top: 30px;
}
.socials a {
  width: 38px;
  height: 38px;
  border-radius: 100px;
  border: 1px solid rgba(242,238,228,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  transition: border-color .2s var(--ease-calm), color .2s var(--ease-calm), transform .2s var(--ease-calm);
}
.socials a svg { width: 17px; height: 17px; }
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- product card (From Kylume) ---------- */

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 30px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 760px) {
  .product-card { grid-template-columns: 220px 1fr; padding: 44px; gap: 46px; }
}

.product-card-visual { display: flex; justify-content: center; }
.product-card-visual img {
  width: 100%;
  max-width: 230px;
  border-radius: 14px;
  box-shadow: 5px 6px 0 var(--shadow-color);
}
@media (min-width: 760px) {
  .product-card-visual img { max-width: 240px; }
}

.product-sub {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--shield-teal);
  margin: 6px 0 18px;
}
:root[data-theme="light"] .product-sub { color: var(--shield-teal); }

.product-card .desc { margin-bottom: 18px; }

.product-emphasis {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 26px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 30px; }
.chip {
  border: 1px solid rgba(47,122,120,0.35);
  background: rgba(47,122,120,0.08);
  color: var(--text-dim);
  border-radius: 100px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.product-cta-row { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.product-microcopy { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--border);
  padding: 34px 0 60px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .lines { line-height: 1.1; }
.footer-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.footer-brand .sub { font-family: var(--font-mono); font-size: 9.5px; color: var(--slate); letter-spacing: 0.08em; margin-top: 3px; }
.footer-meta { font-family: var(--font-mono); font-size: 11px; color: var(--slate); letter-spacing: 0.03em; }
.footer-links { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.footer-links a:hover { color: var(--accent); }

.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
  width: 30px;
  height: 30px;
  border-radius: 100px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  transition: border-color .2s var(--ease-calm), color .2s var(--ease-calm);
}
.footer-socials a svg { width: 14px; height: 14px; }
.footer-socials a:hover { border-color: var(--accent); color: var(--accent); }

.footer-legal {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  opacity: 0.75;
}
