:root {
  color-scheme: dark;
  --ink: #f7f2e8;
  --muted: #a5adbc;
  --line: rgba(224, 235, 251, 0.16);
  --panel: rgba(20, 32, 53, 0.66);
  --gold: #eac78a;
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 63% 69% at 53% 44%, rgba(49, 77, 109, .66), rgba(17, 31, 55, .22) 59%, transparent 83%),
    radial-gradient(ellipse 38% 42% at 81% 16%, rgba(50, 49, 83, .37), transparent 75%),
    linear-gradient(150deg, #101c32, #0b1428 58%, #101b2d);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(205, 224, 246, .032) 1px, transparent 1px), linear-gradient(90deg, rgba(205, 224, 246, .032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 72% 70% at 53% 55%, #000, transparent 87%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 600px; isolation: isolate; }
.scene { position: absolute; inset: 0; z-index: -1; }
.scene canvas { display: block; width: 100%; height: 100%; outline: none; }

.topbar {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  height: 84px;
  padding: 0 clamp(28px, 5.2vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(221, 232, 247, .10);
  background: linear-gradient(180deg, rgba(9, 17, 31, .43), rgba(9, 17, 31, 0));
}

.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 850; letter-spacing: -.075em; line-height: 1; white-space: nowrap; }
.brand-light { font-weight: 400; letter-spacing: -.07em; }
.brand-period { color: #f3bd74; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; align-content: center; justify-content: center; width: 30px; height: 30px; border: 1px solid rgba(251, 224, 176, .55); border-radius: 7px; background: rgba(242, 198, 126, .14); transform: rotate(-9deg); }
.brand-mark i { width: 5px; height: 5px; border-radius: 50%; background: #eec88f; box-shadow: 0 0 5px rgba(244, 199, 133, .38); }
.topbar-center { margin-left: -85px; color: #8896aa; font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .22em; white-space: nowrap; }
.topbar-center span { margin: 0 8px; color: #586a82; }
.live-badge { display: flex; gap: 9px; align-items: center; color: #b5c2ca; font: 650 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; white-space: nowrap; }
.live-dot, .small-dot { width: 7px; height: 7px; border-radius: 50%; background: #a3ddba; box-shadow: 0 0 11px rgba(100, 231, 160, .55); }

.interface { position: relative; width: 100%; height: 100%; pointer-events: none; }
.interface button, .interface input { pointer-events: auto; }

.intro { position: absolute; top: 19.5%; left: clamp(28px, 5.2vw, 88px); width: min(345px, 27vw); }
.eyebrow, .specs, .panel-heading, .metric > span, .telemetry-foot, .scene-key, .sequence, .controls-panel label, .rebuild-button, .control-hint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .18em; white-space: nowrap; }
.eyebrow > span { width: 19px; height: 1px; background: var(--gold); }
.intro h1 { margin: 26px 0 18px; font-size: clamp(43px, 4.75vw, 76px); line-height: .99; letter-spacing: -.075em; font-weight: 680; white-space: nowrap; text-wrap: balance; }
.intro h1 em { color: #e9bb7c; font-style: normal; }
.intro p { max-width: 305px; margin: 0; color: #b4bfcd; font-size: 13px; line-height: 1.75; }
.specs { display: flex; align-items: center; gap: 13px; margin-top: 30px; color: #8193a9; font-size: 9px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.specs b { width: 3px; height: 3px; border-radius: 50%; background: #7288a2; }

.telemetry { position: absolute; top: 19.3%; right: clamp(28px, 5.2vw, 88px); width: 185px; padding: 18px 19px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 50px rgba(2, 7, 16, .14), inset 0 1px rgba(255, 255, 255, .06); backdrop-filter: blur(16px); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; color: #8497ab; font-size: 9px; font-weight: 650; letter-spacing: .11em; white-space: nowrap; }
.panel-cross { color: #c6a77d; font-family: sans-serif; font-size: 16px; line-height: .6; }
.metric { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 15px 0 12px; border-bottom: 1px solid rgba(233, 243, 253, .11); }
.metric > span { color: #b0bccc; font-size: 10px; font-weight: 650; letter-spacing: .08em; white-space: nowrap; }
.metric strong { color: #faf7ef; font-size: 27px; line-height: 1; font-weight: 600; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.telemetry-foot { display: flex; align-items: center; gap: 8px; margin-top: 15px; color: #93a3b4; font-size: 8px; letter-spacing: .07em; white-space: nowrap; }
.small-dot { width: 5px; height: 5px; }

.scene-key { position: absolute; left: 50%; bottom: 11%; display: flex; gap: 15px; transform: translateX(-50%); color: #93a3b7; font-size: 9px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.scene-key span { display: flex; align-items: center; gap: 7px; }
.scene-key i { width: 5px; height: 5px; border-radius: 1px; display: block; }
.key-house { background: #e77465; } .key-tree { background: #6ac58c; } .key-car { background: #eac266; }

.sequence { position: absolute; left: clamp(28px, 5.2vw, 88px); bottom: 51px; width: 274px; }
.sequence-top, .sequence-bottom { display: flex; align-items: center; justify-content: space-between; }
.sequence-top { margin-bottom: 13px; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.sequence-top > div { display: flex; align-items: center; gap: 9px; }
.sequence-top strong { color: #ead0a9; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sequence-pulse { display: block; width: 7px; height: 7px; border-radius: 50%; background: #edc282; box-shadow: 0 0 13px rgba(248, 191, 117, .6); animation: pulse 1.4s infinite; }
.progress-track { height: 3px; overflow: hidden; border-radius: 8px; background: rgba(203, 217, 235, .19); }
#progress-bar { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ce9d70, #f1d293); box-shadow: 0 0 8px rgba(244, 198, 134, .5); transition: width .12s linear; }
.sequence-bottom { margin-top: 11px; color: #899aae; font-size: 9px; letter-spacing: .035em; }
.sequence-bottom span:last-child { font-variant-numeric: tabular-nums; }

.controls-panel { position: absolute; right: clamp(28px, 5.2vw, 88px); bottom: 42px; width: 261px; padding: 16px; border: 1px solid rgba(225, 237, 250, .17); border-radius: 15px; background: rgba(18, 30, 49, .77); box-shadow: 0 20px 65px rgba(2, 8, 18, .25), inset 0 1px rgba(255, 255, 255, .065); backdrop-filter: blur(18px); }
.controls-panel label { display: block; margin: 0 0 8px; color: #91a1b3; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.seed-field { display: flex; align-items: center; height: 40px; padding-left: 12px; border: 1px solid rgba(222, 233, 249, .18); border-radius: 7px; background: rgba(8, 17, 32, .55); }
.seed-field > span { color: #c6ab84; font: 700 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.seed-field input { width: 100%; min-width: 0; padding: 0 6px; color: #f1ede4; border: 0; outline: 0; background: none; font: 600 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
.seed-field:focus-within { border-color: #d6ba8e; box-shadow: 0 0 0 2px rgba(224, 181, 123, .10); }
.seed-field button { align-self: stretch; width: 37px; flex: 0 0 37px; padding: 0; color: #e9d2a6; border: 0; border-left: 1px solid rgba(222, 233, 249, .15); border-radius: 0 7px 7px 0; background: rgba(229, 186, 119, .06); font-size: 19px; line-height: 1; transition: background .2s; }
.seed-field button:hover { background: rgba(229, 186, 119, .17); }
.rebuild-button { display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%; min-height: 43px; margin-top: 10px; padding: 0 8px; color: #1c2636; border: 1px solid #f0d5a7; border-radius: 7px; background: linear-gradient(130deg, #f4dbad, #eac18a); box-shadow: 0 5px 18px rgba(226, 171, 104, .15), inset 0 1px rgba(255, 255, 255, .43); font-size: 10px; font-weight: 850; letter-spacing: .035em; transition: transform .2s, filter .2s; }
.rebuild-button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.rebuild-button:active { transform: translateY(0); }
.rebuild-button svg { width: 16px; height: 16px; flex: none; }
.control-hint { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 13px; color: #c8ba9d; font-size: 7px; font-weight: 700; white-space: nowrap; }
.control-hint b { color: #8292a3; font-weight: 600; }
.hint-divider { color: #5d7086; }

@keyframes pulse { 50% { opacity: .43; transform: scale(.75); } }

@media (max-width: 1050px) {
  .topbar-center { display: none; }
  .intro { top: 16%; }
  .intro h1 { font-size: clamp(42px, 5.4vw, 59px); }
  .intro p { max-width: 250px; }
  .scene-key { bottom: 17%; }
}

@media (max-width: 720px) {
  .app-shell { min-height: 670px; }
  .topbar { height: 65px; padding: 0 20px; }
  .brand { font-size: 15px; }
  .live-badge { font-size: 8px; }
  .intro { top: 90px; left: 20px; width: 230px; }
  .eyebrow { font-size: 8px; }
  .intro h1 { margin: 14px 0 0; font-size: 39px; }
  .intro p, .specs { display: none; }
  .telemetry { top: 221px; right: auto; left: 20px; display: flex; align-items: stretch; gap: 12px; width: auto; padding: 10px 13px; }
  .panel-heading, .telemetry-foot { display: none; }
  .metric { display: block; padding: 0 11px 0 0; border: 0; border-right: 1px solid rgba(233, 243, 253, .12); }
  .metric:last-of-type { padding-right: 0; border: 0; }
  .metric > span { display: block; margin-bottom: 3px; font-size: 8px; }
  .metric strong { font-size: 20px; }
  .scene-key { display: none; }
  .sequence { right: 20px; bottom: 196px; left: 20px; width: auto; }
  .controls-panel { right: 16px; bottom: 16px; left: 16px; width: auto; }
  .control-hint { justify-content: flex-start; }
}

@media (max-height: 700px) and (min-width: 721px) {
  .intro { top: 130px; }
  .intro h1 { font-size: 52px; }
  .intro p { display: none; }
  .specs { margin-top: 18px; }
  .telemetry { top: 132px; }
  .scene-key { bottom: 17%; }
  .sequence { bottom: 37px; }
  .controls-panel { bottom: 27px; }
}
