/* The demo frame, in brand guidelines v1.2 (brand/guidelines.md): navy bar, brand blue actions,
   paper ground, Manrope. The screens inside keep the app's own design system. */
:root {
  --navy: #000919;
  --blue: #275bda;
  --blue-soft: #e9effc;
  --ink: #202123;
  --muted: #5a6275;
  --paper: #f7f4ee;
  --soft: #f3f6fd;
  --cyan: #24cfff;
  --line: #e3e0d8;
  --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Manrope, Montserrat, "Open Sans", system-ui, sans-serif; color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; }
:focus-visible { outline: 3px solid rgba(39, 91, 218, .45); outline-offset: 2px; }

/* ---------- bar ---------- */
.bar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.word { font-weight: 800; letter-spacing: .14em; font-size: 14px; white-space: nowrap; }
.word .ai { color: var(--cyan); }
.now { flex: 1 1 auto; min-width: 0; color: #c8cfdd; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; border-left: 1px solid #2b3550; }
.now:empty { border: 0; }
.barbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: #fff; color: var(--navy); font-weight: 800; font-size: 14px; cursor: pointer; flex: none; }
.sample { font-size: 12px; font-weight: 800; color: var(--navy); background: var(--cyan); border-radius: 999px; padding: 3px 10px; white-space: nowrap; flex: none; }

/* ---------- home ---------- */
.home { max-width: 1080px; margin: 0 auto; padding: 36px 16px 72px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--blue); }
.hero h1 { font-weight: 800; font-size: clamp(30px, 5.2vw, 48px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.01em; }
.hero h1 em { font-family: "EB Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: 1.15em; color: var(--blue); }
.lede { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 680px; margin: 0 0 30px; }
.h2 { font-size: 15px; font-weight: 800; margin: 0 0 12px; }
.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 36px; }
.fcard { position: relative; display: flex; flex-direction: column; gap: 10px; text-align: left; padding: 20px 18px 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.fcard:hover { border-color: var(--blue); box-shadow: 0 10px 28px rgba(0, 9, 25, .1); transform: translateY(-1px); }
.fcard .num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; font-size: 14px; }
.fcard b { font-size: 18px; font-weight: 800; line-height: 1.25; }
.fcard .out { color: var(--muted); font-size: 14px; line-height: 1.5; }
.path { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.path span { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: #34405c; }
.path i { font-style: normal; color: #a7aebd; }
.fcard .go { margin-top: auto; color: var(--blue); font-weight: 800; font-size: 14px; }
.explore-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 800; font-size: 14px; cursor: pointer; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip .c { color: var(--muted); font-weight: 600; margin-left: 4px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on .c { color: #b9c2d6; }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.row { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: inherit; }
.row:hover { border-color: var(--blue); }
.row.on { border-color: var(--blue); background: var(--blue-soft); }
.row .id { flex: none; min-width: 32px; height: 24px; padding: 0 6px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--soft); color: #34405c; }
.row .id.C { background: #fce9dd; color: #9a3412; } .row .id.A { background: #eef3fe; color: #1747b8; } .row .id.T { background: #e3f3ea; color: #1f6b45; } .row .id.S { background: #fdecea; color: #b42318; } .row .id.D { background: #f3e9de; color: #7a4b1f; } .row .id.F { background: var(--blue); color: #fff; }
.row .t { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.row .s { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }

/* ---------- picker drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 9, 25, .45); }
.picker { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--paper); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 9, 25, .2); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--navy); color: #fff; }
.picker-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.x { width: 38px; height: 38px; border-radius: 10px; border: 0; background: #1b2540; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.picker-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: calc(24px + var(--safe-b)); }
.picker-group { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.picker .list { grid-template-columns: 1fr; }
.picker-body > * { flex-shrink: 0; }
.chips { min-height: 48px; align-items: center; }

/* ---------- journey view ---------- */
.stage-wrap { padding: 0 0 calc(176px + var(--safe-b)); }
.rail { position: sticky; top: var(--bar-h); z-index: 30; display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; background: rgba(247, 244, 238, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.rail::-webkit-scrollbar { display: none; }
.seg { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; gap: 6px; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); }
.seg .bar-s { height: 4px; border-radius: 4px; background: #dcd8cf; }
.seg.done .bar-s { background: #9fb6ec; }
.seg.on .bar-s { background: var(--blue); }
.seg .lbl { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.on .lbl { color: var(--ink); }
.viewport { padding: 16px; overflow: hidden; }
.stage { width: 1280px; transform-origin: top left; margin: 0 auto; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 30px rgba(0, 9, 25, .12); background: #f6f5f1; }
.stage.dialog { width: 720px; background: transparent; box-shadow: none; }
.screen-root { min-height: 0; }
.screen-root > div { min-height: 900px !important; }
.stage.dialog .screen-root > div { min-height: 0 !important; }
.screen-root .demo-focus { box-shadow: 0 0 0 3px var(--blue), 0 0 0 9px rgba(39, 91, 218, .18) !important; border-radius: 10px; position: relative; z-index: 1; animation: pulse 1.6s ease-out 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 3px var(--blue), 0 0 0 0 rgba(39, 91, 218, .45); } 100% { box-shadow: 0 0 0 3px var(--blue), 0 0 0 16px rgba(39, 91, 218, 0); } }

.caption { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(860px, calc(100vw - 24px)); z-index: 45; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 44px rgba(0, 9, 25, .2); }
.cap-top { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; min-width: 0; }
.count { flex: none; font-size: 12px; font-weight: 800; color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 9px; }
.meta { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom { display: none; flex: none; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.zoom button { border: 0; background: #fff; color: var(--muted); font-size: 12px; font-weight: 800; padding: 5px 10px; cursor: pointer; }
.zoom button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.cap-text { margin: 0; font-size: 15.5px; line-height: 1.5; font-weight: 500; }
.cap-nav { display: flex; gap: 8px; }
.btn { min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid #cfd5e3; background: #fff; color: var(--ink); font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn.p { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
  .now { display: none; }
}
@media (max-width: 640px) {
  :root { --bar-h: 52px; }
  .bar { gap: 8px; padding: 0 12px; }
  .word { font-size: 12px; letter-spacing: .1em; }
  .barbtn { padding: 0 12px; }
  .sample { display: none; }
  .home { padding-top: 24px; }
  .lede { font-size: 16px; }
  .list { grid-template-columns: 1fr; }
  .seg { min-width: 92px; }
  .viewport { padding: 10px 0 10px 10px; overflow: auto; -webkit-overflow-scrolling: touch; }
  .viewport.fit { overflow: hidden; padding-right: 10px; }
  .stage { margin: 0; }
  .caption { grid-template-columns: 1fr; width: calc(100vw - 16px); bottom: calc(8px + var(--safe-b)); padding: 12px; gap: 8px; border-radius: 14px; }
  .zoom { display: inline-flex; }
  .cap-text { font-size: 15px; }
  .cap-nav .btn { flex: 1 1 0; }
  .picker { top: auto; width: 100vw; height: 86vh; border-radius: 18px 18px 0 0; animation-name: rise; }
  .picker-head { border-radius: 18px 18px 0 0; }
  @keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
