@font-face {
  font-family: 'ForFuture Sans';
  src: url('assets/fonts/ForFutureSans-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'ForFuture Sans';
  src: url('assets/fonts/ForFutureSans-Bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}

:root {
  --ink: #001923;
  --petrol: #004254;
  --light: #00B0BD;          /* light and gradients only */
  --stone: #AAAA9F;
  --sand: #E3E2DA;
  --white: #fff;
  --line: rgba(227, 226, 218, .16);
  --bar: 64px;
  --panel: 420px;
  --cut: 14px;               /* chamfer */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --chamfer: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--ink); color: var(--sand);
  font: 400 16px/1.5 'ForFuture Sans', system-ui, sans-serif;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; overflow: hidden; }
.layer {
  position: absolute; opacity: 0; pointer-events: none;
  transition: transform 1s var(--ease);
  will-change: transform, opacity;
}
.layer.on { opacity: 1; pointer-events: auto; }
.layer img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.layer.fit img {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 2%, #000 98%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 2%, #000 98%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.hs { position: absolute; inset: 0; }

#clip { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .35s linear; }
#clip.on { opacity: 1; }

.scrim { position: fixed; inset: 0; pointer-events: none; transition: opacity .8s linear;
  background:
    linear-gradient(to bottom, rgba(0, 25, 35, .75), rgba(0, 25, 35, 0) 22%),
    linear-gradient(to top, rgba(0, 25, 35, .9), rgba(0, 25, 35, 0) 55%);
}
[data-scene="level"] .scrim { opacity: .45; }

/* ---------- hotspots ---------- */
.spot {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; padding: 0;
  opacity: 0; animation: spot-in .6s var(--ease) forwards; animation-delay: calc(.5s + var(--i) * 70ms);
}
@keyframes spot-in { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
.spot i {
  position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  font: 700 13px/1 'ForFuture Sans', sans-serif; font-style: normal; color: var(--ink);
  background: var(--white);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  transition: scale .3s var(--ease);
}
.spot::before {
  content: ''; position: absolute; left: 17px; top: 50%; width: 34px; height: 34px; translate: -50% -50%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 176, 189, .75), rgba(0, 176, 189, 0));
  animation: pulse 2.6s ease-out infinite; animation-delay: calc(var(--i) * 180ms);
}
@keyframes pulse { from { scale: 1; opacity: .9; } to { scale: 3; opacity: 0; } }
.spot span {
  position: absolute; left: 44px; white-space: nowrap; font-size: 13px; letter-spacing: .04em;
  padding: 5px 10px; background: rgba(0, 25, 35, .82); color: var(--sand);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: background .25s, color .25s;
}
.spot:hover i, .spot.hot i, .spot.active i { scale: 1.18; }
.spot:hover span, .spot.hot span, .spot.active span { background: var(--white); color: var(--ink); }
.spot.flip span { left: auto; right: 44px; }
.hs.has-active .spot:not(.active) { opacity: .5 !important; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar); z-index: 5;
  display: flex; align-items: center; gap: 18px; padding: 0 clamp(16px, 3vw, 36px);
}
.logo img { height: 22px; width: auto; display: block; }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); min-width: 0; flex: 1; }
.crumbs a:hover { color: var(--white); }
.crumbs b { font-weight: 400; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs em { font-style: normal; opacity: .5; }
.lang { display: flex; margin-left: auto; border: 1px solid var(--line); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.lang button { padding: 7px 12px; font-size: 12px; letter-spacing: .1em; color: var(--stone); }
.lang button[aria-pressed="true"] { background: var(--sand); color: var(--ink); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(0, 25, 35, .55); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: background .25s, color .25s; }
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }

/* ---------- scene UI visibility ---------- */
.intro, .levels, .panel, .viewer { opacity: 0; visibility: hidden; transition: opacity .5s linear, visibility 0s .5s, translate .7s var(--ease); }
[data-scene="intro"] .intro,
[data-scene="overview"] .levels, [data-scene="level"] .levels,
[data-scene="level"] .panel,
[data-scene="view"] .viewer { opacity: 1; visibility: visible; transition-delay: .35s, 0s, .35s; translate: 0 0; }

/* ---------- intro ---------- */
.intro { position: fixed; left: clamp(20px, 6vw, 96px); bottom: clamp(40px, 10vh, 120px); max-width: 620px; z-index: 3; translate: 0 16px; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); margin-bottom: 18px; }
.intro h1 { font-size: clamp(40px, 6.4vw, 88px); line-height: 1; font-weight: 700; letter-spacing: -.02em; color: var(--white); text-wrap: balance; }
.lead { margin-top: 22px; font-size: clamp(16px, 1.4vw, 19px); max-width: 44ch; color: var(--sand); }
.cta {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 32px; padding: 16px 26px;
  background: var(--white); color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: .03em;
  clip-path: var(--chamfer); transition: background .25s, gap .3s var(--ease);
}
.cta:hover { background: var(--sand); gap: 20px; }

/* ---------- level picker ---------- */
.levels { position: fixed; left: clamp(16px, 3vw, 36px); bottom: clamp(20px, 5vh, 48px); z-index: 4; display: flex; flex-direction: column; gap: 6px; width: 250px; translate: -12px 0; }
.levels p { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); margin-bottom: 8px; }
.levels a {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 8px; padding: 15px 16px;
  background: rgba(0, 25, 35, .78); border-left: 2px solid transparent; clip-path: var(--chamfer);
  transition: background .25s, color .25s;
}
.levels a small { font-size: 12px; color: var(--stone); letter-spacing: .08em; }
.levels a strong { font-weight: 700; font-size: 16px; color: var(--white); }
.levels a:hover { background: var(--petrol); }
.levels a[aria-current="true"] { background: var(--sand); }
.levels a[aria-current="true"] strong { color: var(--ink); }
.levels a[aria-current="true"] small { color: var(--petrol); }
.levels[data-mode="level"] { top: calc(var(--bar) + 4px); bottom: auto; flex-direction: row; width: 400px; }
.levels[data-mode="level"] p { display: none; }
.levels[data-mode="level"] a { flex: 1; padding: 11px 14px; grid-template-columns: auto 1fr; }
.levels[data-mode="level"] a small:last-child { display: none; }
.levels[data-mode="overview"] { bottom: 50%; translate: 0 50%; width: 290px; }
.levels[data-mode="overview"] a { padding: 22px 20px; }
.levels[data-mode="overview"] a strong { font-size: 20px; }

/* ---------- panel ---------- */
.panel {
  position: fixed; top: var(--bar); right: 0; bottom: 0; width: var(--panel); z-index: 4;
  padding: 28px clamp(20px, 2.4vw, 36px) 32px; overflow-y: auto; translate: 24px 0;
  background: linear-gradient(to bottom, rgba(0, 66, 84, .5), rgba(0, 25, 35, .94) 38%), var(--ink);
  border-left: 1px solid var(--line);
}
.panel::before { content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 180px; background: linear-gradient(to bottom, var(--light), transparent); }
.panel .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); display: flex; gap: 12px; align-items: center; }
.panel h2 { font-size: 34px; line-height: 1.08; font-weight: 700; color: var(--white); margin: 10px 0 12px; letter-spacing: -.01em; }
.panel p.text { color: var(--sand); max-width: 38ch; }
.panel h3 { font-size: 12px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); margin: 30px 0 6px; }
.zones { list-style: none; padding: 0; }
.zones a { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); transition: padding .3s var(--ease), color .2s; }
.zones a small { font-size: 12px; color: var(--stone); letter-spacing: .08em; }
.zones a svg { opacity: .45; transition: opacity .2s, translate .3s var(--ease); }
.zones a:hover, .zones a.hot { padding-left: 8px; color: var(--white); }
.zones a:hover svg, .zones a.hot svg { opacity: 1; translate: 4px 0; }
.specs { list-style: none; padding: 0; margin-top: 24px; border-top: 1px solid var(--line); }
.specs li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.thumb { position: relative; display: block; margin-top: 26px; aspect-ratio: 16 / 9; overflow: hidden; clip-path: var(--chamfer); background: var(--petrol); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: scale .8s var(--ease); }
.thumb:hover img { scale: 1.06; }
.thumb span { position: absolute; left: 0; bottom: 0; display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--white); color: var(--ink); font-weight: 700; font-size: 14px; }
.pending { margin-top: 26px; padding: 14px 16px; border: 1px dashed var(--line); color: var(--stone); font-size: 14px; }
.textlink { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; color: var(--stone); }
.textlink:hover { color: var(--white); }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: auto 0 0 0; z-index: 4; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 4vw, 56px) clamp(24px, 5vh, 48px); translate: 0 12px; }
.caption small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stone); }
.caption h2 { font-size: clamp(30px, 4vw, 54px); line-height: 1.05; font-weight: 700; color: var(--white); margin-top: 8px; }
.caption p { margin-top: 10px; max-width: 46ch; }
.pager { display: flex; align-items: center; gap: 14px; flex: none; font-size: 13px; letter-spacing: .1em; color: var(--stone); }

/* ---------- edit readout ---------- */
#edit { position: fixed; left: 50%; top: 76px; translate: -50% 0; z-index: 9; padding: 8px 14px; background: var(--white); color: var(--ink); font: 13px/1.4 ui-monospace, monospace; }

/* ---------- narrow screens ---------- */
@media (max-width: 859px) {
  :root { --bar: 56px; }
  .crumbs { display: none; }
  .panel { top: auto; left: 0; width: auto; height: 46vh; border-left: 0; border-top: 1px solid var(--line); padding-top: 22px; translate: 0 24px; background: linear-gradient(to bottom, rgba(0, 66, 84, .55), rgba(0, 25, 35, .97) 45%), var(--ink); }
  .panel::before { width: 180px; height: 1px; background: linear-gradient(to right, var(--light), transparent); }
  .panel h2 { font-size: 28px; }
  .levels { width: auto; right: 16px; }
  .levels[data-mode="level"] { left: 16px; right: 16px; width: auto; }
  .levels[data-mode="overview"] { bottom: clamp(20px, 5vh, 48px); translate: 0 0; width: auto; }
  .spot span { display: none; }
  .spot.active span { display: block; }
  .viewer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
