@font-face { font-family: Poppins; font-weight: 400; src: url(../poppins-v19-latin-regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 500; src: url(../poppins-v19-latin-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 600; src: url(../poppins-v19-latin-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 700; src: url(../poppins-v19-latin-700.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Electrolize; font-weight: 400; src: url(../electrolize-v14-latin-regular.woff2) format("woff2"); font-display: swap; }
:root { --cyan: #38e1ff; --pink: #ff3ea5; --orange: #ff923e; --ink: #eaf6ff; --bg: #060a14; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: Poppins, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--cyan); }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#flash { position: fixed; inset: 0; background: #dff6ff; opacity: 0; pointer-events: none; z-index: 5; }
.grain { position: fixed; inset: -50%; pointer-events: none; z-index: 4; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite; }
@keyframes grain { 20% { transform: translate(-4%, 3%) } 40% { transform: translate(3%, -5%) } 60% { transform: translate(-2%, 4%) } 80% { transform: translate(5%, 1%) } }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6)); }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 18px 26px; background: linear-gradient(180deg, rgba(6,10,20,.75), transparent); }
.logo { display: flex; align-items: center; gap: 10px; font: 600 15px Poppins; letter-spacing: .32em; color: #fff; text-decoration: none; }
.ring { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cyan); box-shadow: 0 0 12px var(--cyan), inset 0 0 8px var(--cyan); position: relative; }
.ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--cyan); }
#nav { display: flex; gap: 4px; margin: 0 auto; }
#nav button { background: none; border: 0; color: rgba(234,246,255,.55); font: 500 11px Poppins; letter-spacing: .22em; padding: 8px 10px; position: relative; }
#nav button:hover, #nav button:focus-visible { color: #fff; outline: none; }
#nav button.on { color: #fff; }
#nav button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.right { display: flex; align-items: center; gap: 10px; }
.tc { font: 400 12px Electrolize, monospace; letter-spacing: .14em; color: rgba(234,246,255,.75); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--orange); color: #0b1020; font: 600 12px Poppins; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; box-shadow: 0 0 24px rgba(255,146,62,.45); }
.pill:hover, .pill:focus-visible { background: #fff; outline: none; }
.pill.ghost { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.25); box-shadow: none; }
.pill.ghost:hover, .pill.ghost:focus-visible { border-color: var(--cyan); color: var(--cyan); }
.icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; display: grid; place-items: center; padding: 0; }
.icon svg { width: 18px; height: 18px; }
.icon.off .w { opacity: .15; }
.icon.off { color: rgba(255,255,255,.5); }

/* chapter title (film title card) */
#chapter-title { position: fixed; left: 34px; bottom: 74px; z-index: 6; pointer-events: none; }
#chapter-title em { display: block; font: 400 14px Electrolize, monospace; font-style: normal; color: var(--cyan); letter-spacing: .3em; margin-bottom: 4px; }
#chapter-title h2 { margin: 0; font: 700 clamp(56px, 10vw, 150px)/.9 Poppins; letter-spacing: .02em; color: #fff; text-shadow: 0 0 40px rgba(56,225,255,.25), 0 8px 30px rgba(0,0,0,.5); }
#chapter-title h2 span { display: inline-block; }

/* info panel */
#panel { position: fixed; right: 26px; bottom: 74px; z-index: 6; width: min(380px, calc(100vw - 52px)); max-height: 52vh; overflow: auto; padding: 18px 20px; border-radius: 18px; opacity: 0;
  background: rgba(8,14,30,.62); border: 1px solid rgba(56,225,255,.28); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 0 40px rgba(56,225,255,.12); font-size: 14.5px; line-height: 1.55; }
#panel.on { opacity: 1; }
.p-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; font: 400 12px Electrolize, monospace; letter-spacing: .25em; text-transform: uppercase; color: rgba(234,246,255,.6); }
.p-head b { color: var(--cyan); font-weight: 400; }
#panel p { margin: 0 0 8px; color: rgba(234,246,255,.88); }
#panel .lead { font-size: 18px; font-weight: 600; color: #fff; line-height: 1.35; }
.svc, .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.svc li, .steps li { display: grid; gap: 1px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border-left: 2px solid var(--cyan); }
.steps li { counter-increment: s; border-left-color: var(--orange); }
.steps li b::before { content: "0" counter(s) "  "; font: 400 12px Electrolize, monospace; color: var(--orange); }
.svc b, .steps b { color: #fff; } .svc span, .steps span { font-size: 13px; color: rgba(234,246,255,.7); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(56,225,255,.4); color: #dff7ff; background: rgba(56,225,255,.08); }
.proj { display: grid; gap: 10px; }
.pr { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.05); }
.pr img { width: 92px; height: 62px; object-fit: cover; border-radius: 8px; }
.pr b { display: block; color: #fff; font-size: 14px; } .pr span { display: block; font-size: 11.5px; color: var(--cyan); } .pr p { font-size: 12.5px; margin: 2px 0 4px !important; }
.pr a, .pr i { font-size: 12px; font-style: normal; color: var(--orange); }
.mail a { font-size: 17px; font-weight: 600; color: var(--orange); text-decoration: none; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); color: #fff; text-decoration: none; }
.links a:hover { border-color: var(--cyan); color: var(--cyan); }

/* bottom: chapter ticks like a film scrubber */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 18px 26px; background: linear-gradient(0deg, rgba(6,10,20,.75), transparent); }
#pause-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; gap: 4px; }
#pause-btn i { width: 3px; height: 12px; background: #fff; border-radius: 2px; }
#pause-btn.paused i:first-child { width: 0; height: 0; background: none; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-radius: 0; margin-left: 3px; }
#pause-btn.paused i:last-child { display: none; }
.bars { flex: 1; display: grid; gap: 6px; }
#ticks { display: flex; gap: 6px; }
#ticks span { height: 3px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
#ticks i { display: block; height: 100%; background: var(--cyan); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 8px var(--cyan); }
.prog { height: 1px; background: rgba(255,255,255,.08); } .prog i { display: block; height: 100%; background: rgba(255,255,255,.5); transform-origin: left; transform: scaleX(0); }

/* play mode HUD */
.play-hud { position: fixed; top: 84px; left: 26px; z-index: 6; display: none; gap: 10px; flex-direction: column; }
body[data-mode="play"] .play-hud { display: flex; }
body[data-mode="play"] #pause-btn { visibility: hidden; }
#shard-hud, .spd { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(8,14,30,.6); border: 1px solid rgba(56,225,255,.3); backdrop-filter: blur(8px); width: max-content; transform-origin: left; }
#shard-hud i { width: 12px; height: 12px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 10px var(--cyan); align-self: center; }
#shard-hud b, .spd b { font: 400 22px Electrolize, monospace; color: #fff; } #shard-hud span, .spd span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(234,246,255,.6); }
.keys { font-size: 12px; color: rgba(234,246,255,.7); }
.keys kbd { font: 400 11px Electrolize, monospace; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); border-bottom-width: 3px; color: #fff; }
.touch { display: none; }
@media (pointer: coarse) {
  body[data-mode="play"] .touch { display: block; }
  .touch button { position: fixed; z-index: 9; border: 1px solid rgba(255,255,255,.3); background: rgba(8,14,30,.45); color: #fff; font: 600 13px Poppins; letter-spacing: .15em; border-radius: 18px; touch-action: none; user-select: none; -webkit-user-select: none; }
  #t-left, #t-right { bottom: 84px; width: 70px; height: 70px; font-size: 22px; }
  #t-left { left: 16px; } #t-right { left: 96px; }
  #t-boost, #t-jump { right: 16px; width: 92px; height: 52px; }
  #t-jump { bottom: 84px; } #t-boost { bottom: 146px; background: rgba(255,146,62,.75); color: #0b1020; border: 0; }
  .keys { display: none; }
}

/* menu */
#menu { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(4,7,15,.86); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .35s; }
#menu.open { opacity: 1; pointer-events: auto; }
#menu-close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: none; color: #fff; font-size: 22px; }
.menu-in { width: min(720px, 90vw); }
.m-name { font: 700 clamp(40px, 7vw, 80px) Poppins; letter-spacing: .12em; }
.m-name small { display: block; font: 400 13px Poppins; letter-spacing: .25em; text-transform: uppercase; color: var(--cyan); }
#menu-list { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 4px; }
#menu-list button { background: none; border: 0; color: #fff; font: 600 clamp(24px, 4vw, 40px) Poppins; letter-spacing: .06em; display: flex; gap: 18px; align-items: baseline; padding: 4px 0; transition: color .2s, transform .2s; }
#menu-list button em { font: 400 14px Electrolize, monospace; font-style: normal; color: var(--cyan); }
#menu-list button:hover, #menu-list button:focus-visible { color: var(--orange); transform: translateX(10px); outline: none; }
.m-foot { display: flex; gap: 20px; flex-wrap: wrap; }

/* run result */
#result { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; background: rgba(4,7,15,.55); opacity: 0; pointer-events: none; transition: opacity .4s; padding: 16px; }
#result.on { opacity: 1; pointer-events: auto; }
.r-card { width: min(480px, 100%); padding: 26px; border-radius: 22px; background: rgba(8,14,30,.85); border: 1px solid rgba(255,146,62,.5); box-shadow: 0 0 60px rgba(255,146,62,.2); text-align: center; }
.r-card em { font: 400 12px Electrolize, monospace; font-style: normal; letter-spacing: .4em; color: var(--orange); }
.r-card h3 { margin: 8px 0 16px; font-size: 24px; }
.r-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 10px; }
.r-card dt { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(234,246,255,.6); } .r-card dd { margin: 0; font: 400 24px Electrolize, monospace; color: #fff; }
#r-best { color: var(--cyan); font-weight: 600; margin: 0 0 14px; }
.r-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.r-card small { display: block; margin-top: 12px; color: rgba(234,246,255,.5); }

/* start screen */
#start { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; background: radial-gradient(ellipse at center, rgba(6,10,20,.55), rgba(6,10,20,.92)); transition: opacity .8s; }
#start.out { opacity: 0; pointer-events: none; }
#boot { font: 700 clamp(54px, 12vw, 140px)/1 Poppins; letter-spacing: .22em; padding-left: .22em; color: #fff; text-shadow: 0 0 30px rgba(56,225,255,.5); min-height: 1em; }
.s-bar { width: min(320px, 70vw); height: 2px; margin: 18px auto; background: rgba(255,255,255,.15); } .s-bar i { display: block; height: 100%; background: var(--cyan); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 10px var(--cyan); }
.s-sub { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: rgba(234,246,255,.7); margin: 0 0 26px; }
.s-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; opacity: 0; transform: translateY(10px); transition: opacity .6s, transform .6s; }
#start.ready .s-btns { opacity: 1; transform: none; }
.big { height: 58px; padding: 0 28px; border-radius: 999px; border: 0; font: 600 15px Poppins; letter-spacing: .14em; text-transform: uppercase; background: #fff; color: #0b1020; box-shadow: 0 0 40px rgba(56,225,255,.35); transition: transform .2s, background .2s; }
.big.alt { background: var(--orange); box-shadow: 0 0 40px rgba(255,146,62,.45); }
.big:hover, .big:focus-visible { transform: translateY(-3px) scale(1.03); outline: none; }
.s-hint { margin: 22px auto 0; max-width: 520px; font-size: 13px; color: rgba(234,246,255,.6); line-height: 1.6; }
.s-back { display: inline-block; margin-top: 16px; font-size: 13px; color: rgba(234,246,255,.6); text-decoration: none; } .s-back:hover { color: var(--cyan); }

body[data-mode="menu"] .top, body[data-mode="menu"] .bottom { opacity: 0; }

@media (max-width: 900px) {
  #nav { display: none; }
  .top { padding: 12px 14px; gap: 8px; } .right { margin-left: auto; gap: 6px; }
  .tc { display: none; }
  .pill { height: 34px; padding: 0 12px; font-size: 11px; }
  #chapter-title { left: 16px; bottom: auto; top: 70px; }
  #chapter-title h2 { font-size: clamp(44px, 14vw, 80px); }
  #panel { left: 12px; right: 12px; bottom: 64px; width: auto; max-height: 38vh; font-size: 13.5px; padding: 14px; }
  .bottom { padding: 12px 14px; }
  body[data-mode="play"] #panel { display: none; }
  .play-hud { top: auto; bottom: 170px; left: 16px; }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }
