/* =========================================================================
   Trendini — France DC Roadmap · presentation chrome
   ========================================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #05080d; }
body {
  font-family: var(--font-body);
  color: var(--fg-1);
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

/* ---- stage ------------------------------------------------------------- */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

/* loading veil */
#veil {
  position: fixed; inset: 0; z-index: 50; background: #05080d;
  display: grid; place-items: center; transition: opacity .8s var(--ease);
}
body.ready #veil { opacity: 0; pointer-events: none; }
#veil .vk { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--fg-2); }
#veil .vw { font-family: var(--font-display); font-weight: 800; font-size: 42px; letter-spacing: -.03em; margin-top: 10px; }
#veil .vw .b { color: var(--accent); }

/* ---- HUD layer --------------------------------------------------------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }

/* top bar */
#topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 34px;
  pointer-events: none;
}
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.wordmark .b { color: var(--accent); }
.toptag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--fg-2); display: flex; gap: 18px; align-items: center;
}
.toptag .dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; display: inline-block; }

/* ---- content (left narrative) ----------------------------------------- */
#content {
  position: absolute; left: 34px; top: 50%; transform: translateY(-50%);
  width: min(38vw, 470px); max-width: 470px;
  pointer-events: none;
}
#content.anim #kicker { animation: rise .5s var(--ease) both; }
#content.anim #title  { animation: rise .5s .05s var(--ease) both; }
#content.anim #lead   { animation: rise .5s .12s var(--ease) both; }
#content.anim #controls { animation: rise .5s .18s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

#kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent); display: inline-block; margin-bottom: 18px;
  border-left: 2px solid var(--accent); padding-left: 12px;
}
#title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(38px, 4.6vw, 74px); line-height: .98; letter-spacing: -.035em;
  margin-bottom: 22px;
}
#lead {
  font-family: var(--font-body); font-weight: 300;
  font-size: clamp(15px, 1.2vw, 19px); line-height: 1.5; color: #c4cee0;
  max-width: 420px;
}

/* ---- controls ---------------------------------------------------------- */
#controls { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; pointer-events: auto; }
#controls.empty { display: none; }
.ctrl { display: flex; align-items: center; gap: 14px; }
.ctrl-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-2); min-width: 96px;
}
.seg-group { display: flex; gap: 6px; }
.seg {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--fg-2); background: rgba(255,255,255,.03);
  border: 1px solid var(--line-1); padding: 8px 13px; cursor: pointer;
  border-radius: 2px; transition: all var(--dur-fast) var(--ease); position: relative;
}
.seg:hover { color: var(--fg-1); border-color: var(--line-2); }
.seg.on { color: var(--fg-1); background: rgba(58,107,255,.12); border-color: var(--line-accent); }
.seg.rec .rec-dot { position: absolute; top: 4px; right: 4px; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; }
.seg.rec.on { box-shadow: inset 0 0 0 1px var(--line-accent); }
.toggle {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-1);
  padding: 7px 13px 7px 9px; border-radius: 999px; transition: all var(--dur-fast) var(--ease);
}
.toggle i { width: 30px; height: 16px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; transition: background var(--dur-base) var(--ease); }
.toggle i::after { content:""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--fg-2); transition: all var(--dur-base) var(--ease); }
.toggle.on i { background: var(--accent); }
.toggle.on i::after { left: 16px; background: #fff; }
.toggle span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-1); }

/* ---- panel (right dashboard) ------------------------------------------ */
#panel {
  position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  width: min(34vw, 410px);
  animation: fadepanel .5s .1s var(--ease) both;
}
body[data-chapter="title"] #panel { animation: fadepanel .6s .3s var(--ease) both; }
@keyframes fadepanel { from { opacity: 0; transform: translateY(-50%) translateX(16px); } to { opacity: 1; transform: translateY(-50%); } }

.p-card {
  background: rgba(8,11,17,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-1); border-top: 1px solid var(--line-2);
  padding: 26px; border-radius: 2px;
  display: flex; flex-direction: column; gap: 16px;
}
.divider { height: 1px; background: var(--line-1); margin: 2px 0; }
.tbl-cap { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); }
.src { font-family: var(--font-body); font-weight: 300; font-size: 12.5px; line-height: 1.5; color: var(--fg-2); }

/* hero stat */
.hero-stat { display: flex; flex-direction: column; gap: 8px; }
.hero-num { font-family: var(--font-display); font-weight: 800; font-size: 60px; letter-spacing: -.04em; line-height: .9; }
.hero-num em { font-style: normal; font-size: .42em; color: var(--fg-2); margin-left: 4px; letter-spacing: 0; }
.hero-num.accent { color: var(--accent); }
.hero-cap { font-size: 13.5px; line-height: 1.45; color: #c4cee0; font-weight: 300; max-width: 320px; }

/* stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-1); border: 1px solid var(--line-1); }
.stat { background: #080b11; padding: 15px 14px; display: flex; flex-direction: column; gap: 5px; }
.stat-k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); }
.stat-v { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; line-height: 1; }
.stat-v em { font-style: normal; font-size: .5em; color: var(--fg-2); margin-left: 2px; }
.stat-n { font-size: 11.5px; line-height: 1.35; color: var(--fg-2); font-weight: 300; }
.stat.accent .stat-v { color: var(--accent); }

/* mini bar chart */
.mchart { display: flex; flex-direction: column; gap: 9px; }
.mrow { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; }
.mrow-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--fg-2); }
.mrow.hi .mrow-k { color: var(--fg-1); }
.mrow-v { font-family: var(--font-mono); font-size: 12px; color: var(--fg-1); text-align: right; min-width: 56px; }
.bar { display: block; height: 8px; background: rgba(255,255,255,.06); border-radius: 1px; overflow: hidden; }
.bar i { display: block; height: 100%; background: rgba(255,255,255,.28); transition: width .6s var(--ease); }
.bar.accent i { background: var(--accent); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); text-align: right; padding: 0 0 9px; font-weight: 500; }
.tbl th:first-child { text-align: left; }
.tbl td { padding: 8px 0; text-align: right; border-top: 1px solid var(--line-1); font-family: var(--font-mono); font-size: 12.5px; color: #c4cee0; }
.tbl td:first-child { text-align: left; color: var(--fg-1); }
.tbl tr.hi td { color: var(--fg-1); }
.tbl tr.hi td:first-child { color: var(--accent); }
.tbl td.strong { color: var(--fg-1); font-weight: 500; }
.tbl tr.hi td.strong { color: var(--accent); }

/* title panel */
.p-title { gap: 10px; }
.p-row { display: flex; align-items: baseline; gap: 10px; }
.p-row .big { font-family: var(--font-display); font-weight: 800; font-size: 44px; letter-spacing: -.04em; }
.p-row .unit { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--accent); }
.p-row.alt .unit { color: var(--fg-2); }
.p-row .cap { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); margin-left: auto; }
.p-foot { font-size: 12px; color: var(--fg-2); font-weight: 300; margin-top: 8px; border-top: 1px solid var(--line-1); padding-top: 14px; }

/* split (two paths) */
.p-split { gap: 0; padding: 0; }
.split-col { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.split-col.muted-col { border-top: 1px solid var(--line-1); }
.split-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2); }
.split-tag.accent { color: var(--accent); }
.split-h { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.03em; margin-bottom: 4px; }
.split-num { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; margin-top: 6px; }
.split-num em { font-style: normal; font-size: .55em; color: var(--fg-2); font-weight: 500; margin-left: 4px; }
.muted-col .split-h, .muted-col .split-num { color: var(--fg-2); }

/* ticks */
.ticks { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ticks li { font-size: 13px; line-height: 1.4; color: #c4cee0; font-weight: 300; padding-left: 18px; position: relative; }
.ticks li::before { content: "→"; position: absolute; left: 0; color: var(--fg-2); }
.big-ticks li { font-size: 14px; color: var(--fg-2); transition: color var(--dur-base) var(--ease); }
.big-ticks li.on { color: var(--fg-1); }
.big-ticks li.on::before { color: var(--accent); }

/* role grid */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-1); border: 1px solid var(--line-1); }
.role { background: #080b11; padding: 15px 14px; display: flex; flex-direction: column; gap: 5px; }
.role-n { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: .1em; }
.role-k { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.role-v { font-size: 11.5px; line-height: 1.4; color: var(--fg-2); font-weight: 300; }

/* roadmap */
.road { list-style: none; display: flex; flex-direction: column; }
.road li { display: flex; gap: 14px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line-1); }
.road li:first-child { border-top: 0; }
.road-n { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--accent); min-width: 22px; letter-spacing: -.02em; }
.road-b { display: flex; flex-direction: column; gap: 2px; }
.road-k { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.road-v { font-size: 12px; line-height: 1.4; color: var(--fg-2); font-weight: 300; }

/* customers table */
.tbl-cust td { vertical-align: top; padding: 11px 0; }
.cust-t { display: block; font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: -.02em; color: var(--fg-1); }
.cust-tag { display: inline-block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .14em; color: var(--accent); border: 1px solid var(--line-accent); padding: 2px 5px; border-radius: 2px; margin: 4px 0; }
.cust-i { display: block; font-size: 11px; color: var(--fg-2); font-weight: 300; line-height: 1.35; }
.cust-need { color: #c4cee0 !important; font-family: var(--font-body) !important; font-weight: 300; font-size: 12.5px !important; line-height: 1.4; max-width: 180px; }

/* decision */
.decide-list { display: flex; flex-direction: column; gap: 12px; }
.decide { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 2px solid var(--line-accent); }
.decide-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.decide-v { font-size: 13.5px; color: var(--fg-1); font-weight: 300; line-height: 1.4; }
.decide-n { font-size: 11.5px; color: var(--fg-2); font-weight: 300; }

/* ---- bottom nav -------------------------------------------------------- */
#nav {
  position: absolute; left: 34px; right: 34px; bottom: 24px;
  display: flex; align-items: center; gap: 22px;
}
#rail { flex: 1; display: flex; gap: 4px; height: 30px; align-items: center; }
.rail-seg { flex: 1; height: 3px; background: rgba(255,255,255,.1); border: 0; cursor: pointer; padding: 0; transition: background var(--dur-base) var(--ease), height var(--dur-fast) var(--ease); border-radius: 1px; }
.rail-seg:hover { height: 7px; background: rgba(255,255,255,.25); }
.rail-seg.done { background: rgba(58,107,255,.4); }
.rail-seg.active { background: var(--accent); height: 7px; }

#nav-meta { display: flex; align-items: center; gap: 18px; }
#nav-chap { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#nav-index { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--fg-2); display: flex; gap: 5px; }
#nav-index .now { color: var(--accent); }
#nav-index .sep { opacity: .4; }

.nav-btns { display: flex; gap: 8px; }
.nav-btn {
  width: 42px; height: 42px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02);
  color: var(--fg-1); cursor: pointer; border-radius: 50%;
  display: grid; place-items: center; transition: all var(--dur-fast) var(--ease);
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.nav-btn:disabled:hover { border-color: var(--line-2); color: var(--fg-1); }
.nav-btn svg { width: 18px; height: 18px; }

/* hint */
#hint {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-2); opacity: .7; pointer-events: none; white-space: nowrap;
  transition: opacity var(--dur-slow) var(--ease);
}
body[data-chapter]:not([data-chapter="title"]) #hint { opacity: 0; }

/* ---- building hover tooltip -------------------------------------------- */
#hover-tip {
  position: fixed; top: 0; left: 0; z-index: 9; pointer-events: none;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  background: rgba(8,11,17,.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-accent); padding: 9px 13px 10px; border-radius: 2px;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease);
  will-change: transform;
}
#hover-tip.show { opacity: 1; }
.ht-k { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.ht-v { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; line-height: 1; }
.ht-cta { font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); margin-top: 2px; }

/* ---- 3D pop-up labels -------------------------------------------------- */
#labels { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.pop {
  position: absolute; top: 0; left: 0; will-change: transform;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: rgba(8,11,17,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); padding: 8px 12px 9px; border-radius: 2px;
  transition: opacity var(--dur-base) var(--ease);
  margin-top: -14px;
}
.pop-k { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.pop-v { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; line-height: 1; }
.pop-s { font-family: var(--font-mono); font-size: 9.5px; color: var(--fg-2); white-space: nowrap; letter-spacing: .04em; }
.pop-stem { position: absolute; left: 16px; bottom: -14px; width: 1px; height: 14px; background: var(--line-2); }
.pop.accent { border-color: var(--line-accent); }
.pop.accent .pop-k { color: var(--accent); }
.pop.accent .pop-v { color: var(--accent); }
.pop.accent .pop-stem { background: var(--line-accent); }

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 1100px) {
  #panel { display: none; }
  #content { width: min(70vw, 470px); }
}
@media (max-width: 720px) {
  #content { left: 20px; right: 20px; width: auto; top: auto; bottom: 130px; transform: none; }
  #topbar { padding: 18px 20px; }
  #nav { left: 20px; right: 20px; }
  #nav-chap { display: none; }
}
