/* ============================================================
   Electra Consumer — shared presentation theme v2
   Aligned to the prototype's design system:
   Figtree · indigo #5b6ef5 · navy ink · 4px corners ·
   bordered badges · black primary buttons · compact scale.
   Used by: index.html, prd.html, ia.html, prototype.html
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand (prototype tokens) */
  --brand:        #5b6ef5;   /* indigo accent      */
  --brand-2:      #4a5be0;
  --brand-050:    #eef0fe;
  --brand-brd:    #ccd4fc;
  --accent:       #f5a623;   /* energy amber       */
  --accent-soft:  #fdf1dc;

  /* Neutrals */
  --ink:          #26313f;
  --ink-2:        #5f6b7a;
  --muted:        #98a2b3;
  --line:         #e9ecf1;
  --line-2:       #f0f2f5;
  --bg:           #f5f6f9;
  --surface:      #ffffff;
  --surface-2:    #f8f9fb;
  --tile:         #f3f5f8;
  --black:        #17181a;

  /* Status */
  --ok:           #23a05a;
  --ok-soft:      #e9f7ef;
  --ok-brd:       #bfe8cf;
  --warn:         #c97a00;
  --warn-soft:    #fdf1dc;
  --warn-brd:     #f3dca6;
  --info:         #5b6ef5;
  --info-soft:    #eef0fe;
  --info-brd:     #ccd4fc;
  --p0:           #e2544a;
  --p0-soft:      #fdefee;
  --p0-brd:       #f8cdca;

  /* Shape */
  --radius:       4px;
  --radius-sm:    4px;
  --shadow:       0 1px 2px rgba(20,23,35,.04), 0 8px 24px rgba(20,23,35,.06);
  --shadow-sm:    0 1px 2px rgba(20,23,35,.04);

  --maxw:         1180px;
  --nav-h:        58px;

  --font: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 4px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff; font-size: 15px;
}
.brand__name { font-size: 15px; }
.brand__name small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }

.nav__links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav__link {
  padding: 7px 13px; border-radius: 4px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2);
}
.nav__link:hover { background: var(--line-2); text-decoration: none; }
.nav__link.is-active { background: var(--brand); color: #fff; }
.nav__link .dot { font-size: 10px; opacity: .6; margin-left: 5px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Hero (index) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(760px 340px at 85% -12%, rgba(91,110,245,.10), transparent 60%),
    radial-gradient(620px 320px at 4% 0%, rgba(91,110,245,.07), transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero__inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 22px 48px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--brand); background: var(--brand-050); border: 1px solid var(--brand-brd);
  padding: 5px 11px; border-radius: 4px;
}
.hero h1 { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.1; letter-spacing: -1px; margin: 18px 0 12px; max-width: 760px; font-weight: 700; }
.hero p.lead { font-size: 17.5px; color: var(--ink-2); max-width: 620px; margin: 0; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 26px; }
.hero__meta div { font-size: 12.5px; color: var(--muted); }
.hero__meta strong { display: block; font-size: 14.5px; color: var(--ink); font-weight: 700; }

/* ---------- Deliverable cards ---------- */
.deck { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 36px 0; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #d7deea; text-decoration: none; }
.card__step { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.card__icon { width: 40px; height: 40px; border-radius: 4px; display: grid; place-items: center; font-size: 19px; margin: 8px 0 12px; background: var(--tile); }
.card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.2px; color: var(--ink); font-weight: 700; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.card__cta { margin-top: 14px; font-weight: 700; font-size: 13.5px; color: var(--brand); }
.card.is-soon { opacity: .96; }
.card.is-soon .card__icon { background: var(--line-2); }

/* ---------- Generic sections ---------- */
.section { padding: 36px 0; }
.section h2 { font-size: 22px; letter-spacing: -.3px; margin: 0 0 6px; font-weight: 700; }
.section .sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 7px 12px; border-radius: 4px; }

/* ============================================================
   Document layout (PRD / IA) — sticky TOC + content
   ============================================================ */
.doc { display: grid; grid-template-columns: 250px 1fr; gap: 36px; align-items: start; padding: 30px 0 72px; }

.toc { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; max-height: calc(100vh - var(--nav-h) - 40px); overflow: auto; }
.toc__title { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; padding-left: 12px; }
.toc a {
  display: block; padding: 7px 12px; border-radius: 4px; font-size: 13.5px;
  color: var(--ink-2); border-left: 2px solid transparent; line-height: 1.35;
}
.toc a:hover { background: var(--line-2); text-decoration: none; }
.toc a.is-active { color: var(--brand); background: var(--brand-050); border-left-color: var(--brand); font-weight: 600; }
.toc a .num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 7px; font-weight: 600; }

.content { min-width: 0; }

/* Doc header block */
.doc-head { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 24px 26px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.doc-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.5px; font-weight: 700; }
.doc-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.meta-grid { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.meta-grid div { font-size: 12px; color: var(--muted); }
.meta-grid strong { display: block; color: var(--ink); font-size: 13.5px; font-weight: 700; margin-top: 2px; }

/* Section blocks inside content */
.content section { scroll-margin-top: calc(var(--nav-h) + 20px); padding: 24px 0 4px; }
.content section > h2 {
  font-size: 21px; letter-spacing: -.3px; margin: 0 0 4px; font-weight: 700;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.content section:first-of-type > h2 { border-top: 0; padding-top: 0; }
.content h2 .sec-num { color: var(--brand); font-weight: 800; margin-right: 8px; font-variant-numeric: tabular-nums; }
.content h3 { font-size: 16.5px; margin: 20px 0 8px; letter-spacing: -.1px; font-weight: 700; }
.content h4 { font-size: 14.5px; margin: 15px 0 6px; color: var(--ink); font-weight: 700; }
.content p { color: var(--ink-2); margin: 8px 0; font-size: 14.5px; }
.content ul, .content ol { color: var(--ink-2); margin: 8px 0; padding-left: 22px; font-size: 14.5px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--muted); }

/* Callout */
.callout {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: 4px;
  background: var(--info-soft); border: 1px solid var(--info-brd); margin: 16px 0;
  font-size: 14px; color: var(--ink-2);
}
.callout .ic { font-size: 15px; line-height: 1.4; }
.callout.warn { background: var(--warn-soft); border-color: var(--warn-brd); }
.callout.note { background: var(--surface); border-color: var(--line); }

/* Cards / grids inside docs */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 15px; box-shadow: var(--shadow-sm); }
.tile h4 { margin: 0 0 6px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tile .emoji { font-size: 17px; }
.tile p { margin: 0; font-size: 13.5px; }
.tile ul { margin: 6px 0 0; font-size: 13.5px; }

/* Persona card */
.persona { border-left: 3px solid var(--brand); }
.persona .who { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; margin: 14px 0; box-shadow: var(--shadow-sm); }
table.req { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); min-width: 640px; }
table.req thead th { background: var(--surface-2); text-align: left; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.req td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
table.req tbody tr:last-child td { border-bottom: 0; }
table.req tbody tr:hover { background: var(--surface-2); }
table.req td.id { font-family: var(--mono); font-size: 12px; color: var(--ink); white-space: nowrap; font-weight: 600; }
table.req td.feat { font-weight: 600; color: var(--ink); }

/* Badges — bordered, like the app */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2.5px 8px; border-radius: 4px; letter-spacing: .2px; white-space: nowrap; border: 1px solid transparent; }
.badge.mvp   { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-brd); }
.badge.ff    { background: var(--info-soft); color: var(--info); border-color: var(--info-brd); }
.badge.later { background: var(--line-2);    color: var(--muted); border-color: var(--line); }
.badge.p0    { background: var(--p0-soft);   color: var(--p0);   border-color: var(--p0-brd); }
.badge.p1    { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-brd); }
.badge.p2    { background: var(--line-2);    color: var(--ink-2); border-color: var(--line); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Timeline / phases */
.phase { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.phase:last-child { border-bottom: 0; }
.phase__tag { font-weight: 800; color: var(--brand); font-size: 14px; }
.phase__tag small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }

/* Journey steps */
.journey { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; }
.journey .step { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 5px 11px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.journey .arr { color: var(--brand); font-size: 12px; font-weight: 700; }

/* ---------- Stub / coming-soon pages ---------- */
.stub { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 60px 22px; }
.stub__box { max-width: 620px; }
.stub__badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brand); background: var(--brand-050); border: 1px solid var(--brand-brd); padding: 5px 11px; border-radius: 4px; }
.stub h1 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -.5px; margin: 18px 0 10px; font-weight: 700; }
.stub p { color: var(--ink-2); font-size: 16px; margin: 0 auto 14px; max-width: 520px; }
.stub__list { text-align: left; display: inline-block; margin: 8px auto 22px; color: var(--ink-2); font-size: 14.5px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--black); color: #fff; padding: 11px 20px; border-radius: 4px; font-weight: 600; font-size: 14px; }
.btn:hover { text-decoration: none; background: var(--black); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot__inner { max-width: var(--maxw); margin: 0 auto; padding: 24px 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; gap: 8px; }
  .toc {
    position: static; max-height: none; overflow: visible;
    background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
    padding: 12px; margin-bottom: 12px;
  }
  .toc.is-collapsible .toc__list { display: none; }
  .toc.is-collapsible.is-open .toc__list { display: block; }
  .toc__toggle { display: flex; }
  .phase { grid-template-columns: 1fr; gap: 4px; }
}
@media (min-width: 901px) { .toc__toggle { display: none; } }

@media (max-width: 620px) {
  .nav__inner { padding: 0 14px; }
  .brand__name small { display: none; }
  .nav__link { padding: 6px 10px; font-size: 12px; }
  .wrap, .hero__inner, .foot__inner { padding-left: 16px; padding-right: 16px; }
  .hero__inner { padding-top: 40px; padding-bottom: 36px; }
}

.toc__toggle { align-items: center; gap: 8px; width: 100%; justify-content: space-between; background: none; border: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; padding: 2px; }
.toc__toggle .chev { transition: transform .2s ease; color: var(--muted); }
.toc.is-open .toc__toggle .chev { transform: rotate(180deg); }

/* ============================================================
   IA-specific components (ia.html)
   ============================================================ */

/* ---- Navigation model: phone + web mocks ---- */
.navmodel { display: grid; grid-template-columns: 280px 1fr; gap: 26px; align-items: start; margin: 16px 0; }
.phone { width: 260px; margin: 0 auto; border: 8px solid #14151a; border-radius: 30px; background: var(--surface-2); box-shadow: var(--shadow); overflow: hidden; }
.phone__scr { padding: 14px 12px 10px; min-height: 300px; display: flex; flex-direction: column; }
.phone__top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.phone__body { flex: 1; display: grid; gap: 8px; align-content: start; }
.ph-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow-sm); }
.ph-card.brandish { background: var(--brand); color: #fff; border: 0; }
.ph-card .big { font-size: 16px; font-weight: 800; display: block; }
.ph-quick { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.ph-quick div { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 8px 2px; text-align: center; font-size: 9.5px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.ph-quick div .ic { display: block; font-size: 16px; margin-bottom: 2px; }
.tabbar { display: flex; margin: 10px -12px -10px; background: var(--surface); border-top: 1px solid var(--line); }
.tabbar .tab { flex: 1; text-align: center; padding: 8px 2px 9px; font-size: 9.5px; font-weight: 700; color: var(--muted); }
.tabbar .tab .ic { display: block; font-size: 17px; margin-bottom: 2px; }
.tabbar .tab.is-active { color: var(--brand); }
.tabbar .tab.pay .ic { background: var(--brand); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin: -6px auto 2px; box-shadow: 0 4px 10px rgba(91,110,245,.35); }

.webnav { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow-sm); }
.webnav__bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px; }
.webnav__bar .logo { font-weight: 800; color: var(--brand); }
.webnav__bar .links { margin-left: auto; display: flex; gap: 6px; }
.webnav__bar .links span { padding: 5px 10px; border-radius: 4px; font-weight: 700; color: var(--ink-2); font-size: 11px; }
.webnav__bar .links span.on { background: var(--brand); color: #fff; }
.webnav__body { display: grid; grid-template-columns: 150px 1fr; min-height: 150px; }
.webnav__side { border-right: 1px solid var(--line); padding: 10px; display: grid; gap: 4px; align-content: start; }
.webnav__side span { font-size: 11px; font-weight: 700; color: var(--ink-2); padding: 6px 9px; border-radius: 4px; }
.webnav__side span.on { background: var(--brand-050); color: var(--brand); }
.webnav__main { padding: 14px; color: var(--muted); font-size: 12px; display: grid; gap: 8px; align-content: start; }
.webnav__main .row { height: 26px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; }
.tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tablist .t { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.tablist .t .ic { margin-right: 5px; }

/* ---- Sitemap tree ---- */
.tree { font-size: 13.5px; margin: 14px 0; }
.tree ul { list-style: none; margin: 0 0 0 14px; padding-left: 16px; border-left: 1px dashed #cdd5e2; }
.tree > ul { margin-left: 0; padding-left: 0; border-left: 0; }
.tree li { position: relative; padding: 4px 0; }
.tree ul li::before { content: ""; position: absolute; left: -16px; top: 17px; width: 12px; border-top: 1px dashed #cdd5e2; }
.node { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; font-weight: 600; box-shadow: var(--shadow-sm); color: var(--ink); }
.node .sid { font-family: var(--mono); font-size: 10px; color: var(--muted); font-weight: 700; }
.node.root { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 800; }
.node.root .sid { color: rgba(255,255,255,.7); }
.node.tab { background: var(--brand-050); border-color: var(--brand-brd); color: var(--brand); font-weight: 700; }
.node.flowlink { border-style: dashed; }

/* ---- Flow diagrams ---- */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; }
.flow .fnode { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 7px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm); text-align: center; }
.flow .fnode.start { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.flow .fnode.end { background: var(--ok-soft); border-color: var(--ok-brd); color: var(--ok); font-weight: 700; }
.flow .fnode.decision { background: var(--accent-soft); border-color: var(--warn-brd); color: #7a5200; }
.flow .fnode.alt { border-style: dashed; color: var(--ink-2); }
.flow .farr { color: var(--brand); font-weight: 800; font-size: 13px; }
.flow .fbranch { font-size: 10.5px; color: var(--muted); font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.flow-title { font-size: 14px; font-weight: 700; margin: 18px 0 2px; display: flex; align-items: center; gap: 8px; }
.flow-title .sid { font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: var(--line-2); padding: 2px 7px; border-radius: 4px; }

/* ---- Entity model ---- */
.entity { border-top: 3px solid var(--brand); }
.entity h4 { justify-content: flex-start; }
.entity ul { font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.entity .rel { font-size: 11.5px; color: var(--brand); font-weight: 700; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }

/* ---- State chips ---- */
.states { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.state-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 5px 10px; box-shadow: var(--shadow-sm); }
.state-chip .dotc { width: 8px; height: 8px; border-radius: 50%; }

@media (max-width: 900px) {
  .navmodel { grid-template-columns: 1fr; }
  .phone { margin: 0 0 8px; }
}
