/* Emi public site v2 — shared styles. Same brand DNA as Apex. */
:root {
  --bg: #0a0a0b;
  --bg-2: #111114;
  --panel: #15151a;
  --line: #1f1f26;
  --text: #ededf0;
  --muted: #8a8a95;
  --dim: #5a5a64;
  --accent: #FF1801;
  --accent-soft: rgba(255, 24, 1, 0.12);
  --cyan: #00e0ff;
  --green: #36d399;
  --yellow: #fbbf24;
  --violet: #a78bfa;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }

/* ----- background ----- */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px; opacity: 0.3;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}
.glow {
  position: fixed; width: 600px; height: 600px; border-radius: 50%;
  filter: blur(140px); opacity: 0.15; z-index: 0; pointer-events: none;
}
.glow.red { background: var(--accent); top: -180px; right: -120px; }
.glow.cyan { background: var(--cyan); top: 70vh; left: -200px; }

/* ----- nav ----- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(14px); background: rgba(10, 10, 11, 0.7);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 13px;
}
.nav-brand { color: var(--text); font-weight: 600; letter-spacing: 0.02em; }
.nav-brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--muted); transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--accent); }
@media (max-width: 720px) {
  .nav-inner { flex-wrap: wrap; gap: 6px 0; padding: 12px 16px; }
  .nav-brand { order: 1; }
  .ver-toggle { order: 2; }
  .nav-links {
    order: 3; width: 100%; gap: 18px; font-size: 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-top: 4px; scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  main { padding-top: 92px; }
}

/* ----- layout ----- */
main { position: relative; z-index: 1; padding-top: 60px; }
section { padding: 80px 24px; max-width: 1100px; margin: 0 auto; }
section.hero { padding: 120px 24px 80px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.18em; margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ''; width: 24px; height: 1px; background: var(--accent);
}
h1, h2, h3, h4 {
  font-family: var(--sans); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
}
h1 {
  font-size: clamp(40px, 7vw, 88px); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1; margin-bottom: 24px;
}
h1 .accent { color: var(--accent); }
h1 .stroke { -webkit-text-stroke: 2px var(--accent); color: transparent; letter-spacing: -0.02em; }
h2 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 24px; }
h3 { font-size: 20px; margin-bottom: 10px; }
h4 { font-size: 15px; margin-bottom: 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
p { color: var(--muted); }
p.lead { font-size: 18px; line-height: 1.6; max-width: 720px; }
p.lead strong { color: var(--text); font-weight: 500; }

/* ----- stats strip ----- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  border-top: 1px solid var(--line); padding-top: 28px; max-width: 720px;
}
.stat .num {
  font-family: var(--mono); font-size: 26px; font-weight: 600;
  color: var(--text); line-height: 1; margin-bottom: 6px;
}
.stat .num .unit { color: var(--accent); font-size: 14px; }
.stat .label {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.15em;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ----- subpage cards on landing ----- */
.chapters {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  margin-top: 40px;
}
.chapter-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; transition: transform 0.25s, border-color 0.25s;
  display: flex; flex-direction: column; gap: 8px;
}
.chapter-card:hover {
  transform: translateY(-3px); border-color: var(--accent-soft);
}
.chapter-card .num {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.2em;
}
.chapter-card h3 {
  font-size: 22px; color: var(--text); margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.chapter-card p {
  font-size: 14px; line-height: 1.55;
}
.chapter-card .read {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  margin-top: 10px;
}
@media (max-width: 720px) { .chapters { grid-template-columns: 1fr; } }

/* ----- subpage common ----- */
.subpage-hero { padding: 100px 24px 40px; max-width: 1100px; margin: 0 auto; }
.subpage-hero h1 { font-size: clamp(36px, 6vw, 64px); }
.section-block { padding: 40px 24px 60px; max-width: 1100px; margin: 0 auto; }
.divider {
  max-width: 1100px; margin: 20px auto; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.2em;
}
.divider .line { flex: 1; height: 1px; background: var(--line); }

/* ----- generic cards ----- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-top: 24px;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px;
}
.card .role {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 8px;
}
.card .name {
  font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.card .desc { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ----- key-value rows ----- */
.kv {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--mono); font-size: 13px;
}
.kv > div {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 16px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.kv .k {
  color: var(--muted); text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.12em;
}
.kv .v { color: var(--text); }

/* ----- pills ----- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg-2); color: var(--cyan);
  padding: 4px 10px; border-radius: 3px;
  border: 1px solid var(--line);
}

/* ----- live link ----- */
.live-link {
  font-family: var(--mono); font-size: 12px; color: var(--cyan);
  border-bottom: 1px dashed var(--cyan); padding-bottom: 1px;
}
.live-link:hover { color: var(--text); border-color: var(--text); }

/* ----- product card ----- */
.product {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 32px; margin-top: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.product .info h3 { font-size: 28px; color: var(--text); margin-bottom: 4px; }
.product .info .tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  background: var(--accent); color: #fff; padding: 3px 8px;
  border-radius: 3px; letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 14px;
}
.product .info p { font-size: 14px; margin-bottom: 16px; }
.product .visual {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; aspect-ratio: 16/10; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}
@media (max-width: 720px) {
  .product { grid-template-columns: 1fr; padding: 24px; }
}

/* ----- footer ----- */
footer {
  padding: 40px 24px; text-align: center; font-family: var(--mono);
  font-size: 11px; color: var(--dim); border-top: 1px solid var(--line);
  margin-top: 60px;
}
footer .accent { color: var(--accent); }
footer a { color: var(--muted); border-bottom: 1px dashed var(--dim); }
footer a:hover { color: var(--text); }
.footer-meta {
  display: inline-flex; gap: 20px; padding-bottom: 12px;
  flex-wrap: wrap; justify-content: center;
}

/* ----- back link ----- */
.back-link {
  display: inline-block; margin-bottom: 32px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.back-link:hover { color: var(--accent); }

/* ----- reveal ----- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ----- v1 / v2 version toggle ----- */
.ver-toggle {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px; background: var(--bg-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
}
.ver-toggle button {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  padding: 4px 12px; border-radius: 999px;
  font-family: inherit; font-size: inherit; letter-spacing: inherit;
  transition: background 0.18s, color 0.18s;
}
.ver-toggle button:hover { color: var(--text); }
.ver-toggle button.on { color: #fff; }
body[data-view="v1"] .ver-toggle button[data-v="v1"] { background: var(--dim); color: #fff; }
body[data-view="v2"] .ver-toggle button[data-v="v2"] { background: var(--accent); color: #fff; }

/* show/hide whole-page view blocks */
.view { display: none; }
body[data-view="v1"] .view-v1 { display: block; }
body[data-view="v2"] .view-v2 { display: block; }

/* thin "you are viewing the old design" banner, v1 only */
.v1-banner { display: none; }
body[data-view="v1"] .v1-banner {
  display: block; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  background: rgba(90,90,100,0.08); border-bottom: 1px solid var(--line);
  padding: 7px 24px; letter-spacing: 0.06em;
}
body[data-view="v1"] .v1-banner b { color: var(--muted); font-weight: 500; }

/* ----- "what improved in v2" inline change tags ----- */
.chg {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px; vertical-align: middle;
  letter-spacing: 0.12em; text-transform: uppercase; margin-left: 8px;
}
.chg.new { background: rgba(54,211,153,0.15); color: var(--green); border: 1px solid rgba(54,211,153,0.3); }
.chg.upd { background: rgba(0,224,255,0.10); color: var(--cyan); border: 1px solid rgba(0,224,255,0.25); }

/* small "what v2 improved" note line under a section lead */
.improved {
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  color: var(--green); border-left: 2px solid rgba(54,211,153,0.4);
  padding: 8px 0 8px 14px; margin: 4px 0 24px; max-width: 720px;
}
.improved b { color: var(--text); font-weight: 600; }

/* product-kpis (used on products page, kept here so it's shared) */
.product-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
}
.product-kpis .kpi { font-family: var(--mono); }
.product-kpis .kpi-num { font-size: 18px; color: var(--text); font-weight: 500; line-height: 1; margin-bottom: 4px; }
.product-kpis .kpi-num .accent { color: var(--accent); font-size: 13px; }
.product-kpis .kpi-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
