/* world.css — the Doria 3D world page. Page chrome is lime-only per the
   brand manual; product severity colours live inside the scene only. */
:root {
  --ink: #ffffff;
  --mid: #abaeb0;
  --light: #808b96;
  --rule: rgba(255, 255, 255, 0.12);
  --accent: #c8ff00;
  --ground: #050607;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--ground); color: var(--ink); font-family: 'DM Sans', sans-serif; }
a { color: inherit; text-decoration: none; }

#map { position: absolute; inset: 0; }

/* Atmosphere: the engine has no sky, so a haze fades the horizon and a
   vignette holds the eye in the middle of the frame. */
.w-atmos {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(to bottom, #07090b 0%, rgba(7, 9, 11, .92) 9%, rgba(7, 9, 11, 0) 34%),
    radial-gradient(ellipse at 50% 58%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .55) 100%);
}

/* HUD layer: zone tags and (later) reticle cards */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.w-tag { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .44s var(--ease); }
.w-tag__stem { position: absolute; left: 0; bottom: 0; width: 1px; height: 46px; background: linear-gradient(to top, rgba(255, 255, 255, .7), rgba(255, 255, 255, .15)); }
.w-tag__dot { position: absolute; left: -3px; bottom: -3px; width: 7px; height: 7px; border: 1px solid rgba(255, 255, 255, .85); transform: rotate(45deg); }
.w-tag__label {
  position: absolute; left: 0; bottom: 46px; padding: 0 0 6px 8px; white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .88);
  border-left: 1px solid rgba(255, 255, 255, .7);
}
.w-tag.is-hidden { opacity: 0; }

/* zone tags only in the opening chapter and in free explore */
body:not(.show-tags) .w-tag { opacity: 0; }

/* ── HUD markers: product glyph on the ground, stem, card ── */
.h-mk { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; transition: opacity .2s; --sev: #fff; --drop: 0px; }
.h-mk__glyph { position: absolute; left: -10px; top: -14px; }
.h-mk__glyph svg { display: block; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .9)); }
.h-mk.is-follow .h-mk__glyph { display: none; }
.h-mk__drop { position: absolute; left: 0; top: 0; width: 1px; height: var(--drop); background: linear-gradient(to bottom, var(--sev), transparent); opacity: .55; }
.h-mk__ping { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border: 1px solid var(--sev); border-radius: 50%; opacity: 0; }
.h-mk.is-ping .h-mk__ping { animation: hPing 1.2s var(--ease) 2; }
@keyframes hPing { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(2.2); } }
.h-mk__stem { position: absolute; left: 0; bottom: 12px; width: 1px; height: 0; background: linear-gradient(to top, var(--sev), rgba(255, 255, 255, .25)); transition: height .26s var(--ease); }
.h-mk.is-open .h-mk__stem { height: calc(58px + var(--card-up, 0px)); }
.h-card {
  position: absolute; left: 0; bottom: calc(70px + var(--card-up, 0px)); width: 232px; padding: 10px 12px 11px;
  background: rgba(3, 5, 6, .86); border: 1px solid rgba(255, 255, 255, .14); border-left: 2px solid var(--sev);
  font-family: var(--mono); color: rgba(255, 255, 255, .86);
  visibility: hidden; opacity: 0; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.h-card::after { content: ''; position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-top: 1px solid rgba(255, 255, 255, .35); border-right: 1px solid rgba(255, 255, 255, .35); }
.h-mk.is-open { z-index: 2; }
.h-mk.is-open .h-card { visibility: visible; }
.h-mk.is-below .h-card { bottom: auto; top: 22px; }
.h-mk.is-below.is-open .h-mk__stem { bottom: auto; top: 8px; height: 14px; background: var(--sev); }
.h-mk.is-flip .h-card { left: auto; right: 0; border-left-width: 1px; border-right: 2px solid var(--sev); }
.h-mk.is-flip .h-card::after { right: auto; left: -1px; border-right: 0; border-left: 1px solid rgba(255, 255, 255, .35); }
.h-card__kind { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sev); }
.h-card__dev { display: inline-block; margin-top: 5px; padding: 1px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(200, 255, 0, .5); }
.h-card__title { margin: 4px 0 7px; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; line-height: 1.2; color: #fff; }
.h-card__rows { border-top: 1px solid rgba(255, 255, 255, .08); }
.h-card__rows div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.h-card__rows dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.h-card__rows dd { font-size: 11px; text-align: right; color: rgba(255, 255, 255, .9); }
.h-card__conf { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.h-card__conf i { flex: 1; height: 3px; background: rgba(255, 255, 255, .1); }
.h-card__conf b { display: block; height: 100%; background: var(--sev); transition: width .6s var(--ease); }
.h-card__steps { list-style: none; margin-top: 8px; display: grid; gap: 3px; }
.h-card__steps li { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .35); padding-left: 14px; position: relative; }
.h-card__steps li::before { content: ''; position: absolute; left: 0; top: 4px; width: 6px; height: 6px; border: 1px solid currentColor; }
.h-card__steps li.is-done { color: rgba(255, 255, 255, .7); }
.h-card__steps li.is-done::before { background: rgba(255, 255, 255, .7); }
.h-card__steps li.is-now { color: var(--sev); }
.h-card__steps li.is-now::before { background: var(--sev); animation: hBlink 1s steps(2) infinite; }
@keyframes hBlink { 50% { opacity: .2; } }

.h-mk--tag .h-tg { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; font: 500 11px/1 var(--mono); letter-spacing: .1em; color: var(--sev); text-shadow: 0 0 6px rgba(0, 0, 0, .95), 0 0 2px #000; }

/* ── the story panel ── */
.w-story {
  position: absolute; z-index: 6; left: max(28px, env(safe-area-inset-left)); bottom: max(56px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 56px)); padding: 18px 20px 16px;
  background: rgba(4, 6, 7, .78); border: 1px solid var(--rule); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.w-story__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.w-story__kicker { font: 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--light); }
.w-story__kicker span:first-child { color: var(--accent); }
.w-story__dev { font: 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(200, 255, 0, .5); padding: 4px 7px; }
.w-story__title { margin: 8px 0 8px; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px; line-height: 1.2; }
.w-story__summary { font-size: 14px; line-height: 1.55; color: var(--mid); }
.w-story__bar { height: 2px; margin: 14px 0 12px; background: rgba(255, 255, 255, .1); }
.w-story__bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.w-story__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.w-ctl {
  min-width: 44px; min-height: 44px; padding: 0 12px; cursor: pointer; background: transparent; color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .25); font: 600 11px/1 'Syne', sans-serif; letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.w-ctl:first-child, #w-next { font-size: 20px; font-weight: 400; letter-spacing: 0; }
.w-ctl:hover, .w-ctl:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.w-ctl--main { min-width: 92px; border-color: rgba(200, 255, 0, .6); color: var(--accent); }
.w-ctl--list { margin-left: auto; }
.w-tour { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; font: 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mid); cursor: pointer; }
.w-tour input { accent-color: #c8ff00; width: 16px; height: 16px; }
.w-list { list-style: none; margin-top: 12px; max-height: 40vh; overflow: auto; border-top: 1px solid var(--rule); }
.w-list button {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .7); text-align: left; cursor: pointer;
  font: 600 11px/1.3 'Syne', sans-serif; letter-spacing: .12em; text-transform: uppercase;
}
.w-list button:hover, .w-list button:focus-visible { color: #fff; outline: none; background: rgba(255, 255, 255, .03); }
.w-list button.is-current { color: #fff; }
.w-list__n { font: 11px var(--mono); color: var(--light); }
.w-list button.is-current .w-list__n { color: var(--accent); }
.w-list__dev { font: 11px var(--mono); letter-spacing: .08em; color: var(--accent); }
body.is-exploring .w-story__summary, body.is-exploring .w-story__bar { opacity: .4; }

@media (max-width: 760px) {
  .w-story { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; padding: 14px 14px 12px; }
  .w-story__title { font-size: 17px; }
  .w-story__summary { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .w-foot { display: none; }
  .h-card { width: 200px; }
}


/* chrome */
.w-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left)); pointer-events: none;
}
.w-brand { pointer-events: auto; display: flex; flex-direction: column; gap: 6px; }
.w-brand__mark { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .22em; text-transform: uppercase; }
.w-brand__mark span { color: var(--accent); }
.w-brand__sub { font: 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--light); }
.w-actions { pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.w-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer;
  background: rgba(5, 6, 7, .55); color: var(--ink); border: 1px solid rgba(255, 255, 255, .28);
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .14s var(--ease), color .14s var(--ease), background .14s var(--ease);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.w-btn:hover, .w-btn:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }

.w-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 max(28px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); pointer-events: none;
}
.w-readout { font: 11px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--light); }
.w-readout b { color: var(--ink); font-weight: 500; }
.w-note { font: 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--light); text-align: right; max-width: 280px; }

/* loader */
.w-loader {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--ground); transition: opacity .6s var(--ease), visibility .6s;
}
.w-loader.is-done { opacity: 0; visibility: hidden; }
.w-loader__ring { width: 96px; height: 96px; position: relative; }
.w-loader__ring::before, .w-loader__ring::after { content: ''; position: absolute; inset: 0; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; }
.w-loader__ring::after { inset: 14px; border-color: rgba(200, 255, 0, .6); border-style: dashed; animation: wSpin 6s linear infinite; }
.w-loader__cross { position: absolute; inset: 0; background:
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) center/1px 100% no-repeat,
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) center/100% 1px no-repeat; }
.w-loader__text { font: 11px/1.6 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mid); text-align: center; }
.w-loader__text b { color: var(--accent); font-weight: 500; }
@keyframes wSpin { to { transform: rotate(360deg); } }

/* fallback (no WebGL) */
.w-fallback { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 32px; background: var(--ground); }
.w-fallback.is-on { display: flex; }
.w-fallback__card { max-width: 460px; border: 1px solid var(--rule); padding: 32px; }
.w-fallback__card h1 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.w-fallback__card p { color: var(--mid); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }

@media (max-width: 640px) {
  .w-note { display: none; }
  .w-top { padding-top: max(16px, env(safe-area-inset-top)); }
  .w-brand__sub { display: none; }
  .w-long { display: none; }
  .w-brand__mark { font-size: 13px; letter-spacing: .18em; white-space: nowrap; }
  .w-btn { padding: 0 12px; white-space: nowrap; }
  .w-actions { gap: 8px; }
  .w-tag__label { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
