@font-face { font-family: "Fixel Display"; src: url(/fonts/FixelDisplay-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url(/fonts/FixelText-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fixel Text"; src: url(/fonts/FixelText-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --ink: #0B0C12; --orange: #FF6A00; --cream: #F4EFE6; --blue: #0636B2; --green: #2EDB72; --muted: #5A6070;
  --display: "Fixel Display", system-ui, sans-serif; --text: "Fixel Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #E9E6EF; color: var(--ink); font: 500 16px/1.4 var(--text); }
#lab { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
.small { font-size: 13px; color: var(--muted); }
.eyebrow { margin: 0 0 6px; font: 600 13px var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }

/* parent gate */
.gate { position: fixed; inset: 0; display: grid; place-items: center end; padding: 16px max(16px, 5vw); background: linear-gradient(90deg, transparent 30%, rgba(233,230,239,.75) 60%); }
.sheet { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--cream); border: 3px solid var(--ink); border-radius: 24px; padding: 24px; box-shadow: 8px 8px 0 var(--ink); }
.sheet h1 { font: 700 28px/1.12 var(--display); margin: 0 0 12px; }
.langs { float: right; display: flex; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; margin: -4px -4px 0 8px; }
.langs button { border: 0; background: #fff; padding: 5px 11px; font: 700 13px var(--display); cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.promises { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.promises li { padding-left: 26px; position: relative; }
.promises li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.row { display: flex; gap: 12px; margin-bottom: 12px; }
.row label { flex: 1; display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
select { padding: 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); margin-top: 1px; }
.go { display: block; width: 100%; text-align: center; text-decoration: none; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 16px; background: var(--orange); color: var(--ink); font: 700 18px var(--display); cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.go:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.go.ghost { background: var(--cream); width: auto; display: inline-block; }

/* HUD */
.hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: max(12px, env(safe-area-inset-top)) 16px 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { font: 700 20px var(--display); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--orange); border: 2px solid var(--ink); }
.badge { font: 600 11px var(--text); padding: 3px 8px; border-radius: 99px; background: var(--ink); color: var(--cream); letter-spacing: .03em; }
.badge.demo { background: #fff; color: var(--muted); border: 1.5px solid var(--muted); }
.strands { display: flex; gap: 5px; list-style: none; margin: 0 auto 0 8px; padding: 0; }
.strands li { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; position: relative; }
.strands li.got_it { background: var(--green); }
.strands li.partly, .strands li.not_yet { background: #FFC93C; }
.strands li:hover::after { content: attr(data-label); position: absolute; top: 20px; left: -8px; white-space: nowrap; font-size: 12px; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; }
.timer { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: var(--cream); stroke-width: 4; }
.timer .track { stroke: rgba(11,12,18,.15); }
.timer .ring { fill: none; stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset .3s linear; }
.timer span { position: relative; font: 700 12px var(--display); }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--cream); cursor: pointer; }

/* talk bar */
.talk { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 16px max(14px, env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.talk > * { pointer-events: auto; width: min(760px, 100%); }
.subtitle { margin: 0; padding: 12px 18px; background: var(--cream); border: 3px solid var(--ink); border-radius: 20px; font: 600 clamp(16px, 2.2vw, 21px)/1.3 var(--text); box-shadow: 4px 4px 0 var(--ink); min-height: 1em; }
.subtitle b { color: var(--orange); font-family: var(--display); font-weight: 700; }
.child-line { margin: 0 max(0px, calc((100vw - 32px - 760px) / 2)) 0 0; justify-self: end; width: auto !important; max-width: min(560px, 85%); padding: 8px 14px; background: var(--blue); color: #fff; border-radius: 16px 16px 4px 16px; font-weight: 600; }
.child-line.live { opacity: .75; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chips button { padding: 8px 14px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; font-weight: 600; cursor: pointer; }
.chips button:hover { background: #FFE3CC; }
.ask { display: flex; gap: 8px; align-items: center; }
.ask input { flex: 1; min-width: 0; padding: 14px 16px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; }
.send { width: 52px; height: 52px; border-radius: 16px; border: 3px solid var(--ink); background: var(--cream); font-size: 20px; cursor: pointer; }
.mic { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 3px solid var(--ink); background: var(--orange); cursor: pointer; display: grid; place-items: center; box-shadow: 3px 3px 0 var(--ink); }
.mic span { width: 16px; height: 26px; border-radius: 9px; background: var(--ink); box-shadow: 0 0 0 4px var(--orange), 0 0 0 7px var(--ink); clip-path: inset(-10px -10px 0 -10px); }
.mic.on { animation: pulse 1s infinite; background: var(--green); }
.mic.on span { box-shadow: 0 0 0 4px var(--green), 0 0 0 7px var(--ink); }
.mic:disabled { opacity: .4; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.busy .ask input, .busy .chips button { opacity: .5; pointer-events: none; }

/* end + pause */
.end { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 16px; background: rgba(11,12,18,.9); animation: fade 1.2s ease both; }
@keyframes fade { from { opacity: 0; } }
.mission { width: min(520px, 100%); background: var(--cream); border: 3px solid var(--ink); border-radius: 22px; padding: 26px; transform: rotate(-1.5deg); box-shadow: 8px 8px 0 var(--orange); }
.mission h2 { font: 700 clamp(22px, 4vw, 30px)/1.15 var(--display); margin: 4px 0 16px; }
.boxes { display: flex; gap: 12px; margin-bottom: 10px; }
.boxes span { width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; }
.pause .mission { box-shadow: 8px 8px 0 var(--blue); }

@media (max-width: 700px) {
  .gate { place-items: end center; background: linear-gradient(180deg, transparent 20%, rgba(233,230,239,.85) 45%); }
  .sheet { padding: 18px; border-radius: 20px; }
  .sheet h1 { font-size: 22px; }
  .strands { display: none; }
  .brand { font-size: 17px; margin-right: auto; }
  .mic { width: 56px; height: 56px; }
  .chips button { padding: 6px 11px; font-size: 14px; }
}
