:root {
  --bg: #0b0c0e;
  --ink: #f2f4f7;
  --ink-soft: rgba(242, 244, 247, 0.72);
  --pill: rgba(10, 11, 13, 0.62);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;          /* let the piece be dragged on touch screens */
}

/* ---------- name, in polished silver ---------- */
#nameplate {
  position: fixed;
  inset: auto 0 0 0;
  padding: 10vh 2.2vw 24px;
  /* the studio floor is light here: darken it so the silver stands out */
  background: linear-gradient(to top, rgba(5, 6, 8, 0.94) 0%, rgba(5, 6, 8, 0.8) 45%, rgba(5, 6, 8, 0) 100%);
  pointer-events: none;        /* dragging works straight through it */
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(.2,.8,.2,1);
}
#nameplate h1 {
  width: max-content;
  margin: 0;
  padding: 0 0.06em 0.02em 0;
  font-weight: 600;
  font-size: 10.45vw;          /* makes the whole name 65% of the page's width */
  line-height: 1.12;
  letter-spacing: -0.045em;
  color: #d5dae1;
  animation: name-in 1.2s cubic-bezier(.2,.8,.2,1) both;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  #nameplate h1 {
    color: transparent;
    /* a glint that crosses once, over polished metal: bright sky, dark horizon, light bounced from below */
    background-image:
      linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.95) 50%, transparent 58%),
      linear-gradient(180deg, #ffffff 18%, #dfe4ea 32%, #a9b1bc 47%, #59616d 56%, #8e97a4 61%, #dde2e8 74%, #f8fafc 82%, #8b94a1 96%);
    background-size: 300% 100%, 100% 100%;
    background-position: 0% 0, 0 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: name-in 1.2s cubic-bezier(.2,.8,.2,1) both, glint 2.4s 1s ease-in-out both;
  }
}
@keyframes name-in { from { opacity: 0; transform: translateY(18%); } }
@keyframes glint { from { background-position: 100% 0, 0 0; } to { background-position: 0% 0, 0 0; } }
body.zoomed #nameplate { opacity: 0; transform: translateY(30%); }
@media (max-width: 700px) { #nameplate { padding: 8vh 12px 44px; } }   /* clear of the two-line credit */
@media (prefers-reduced-motion: reduce) {
  #nameplate { transition: none; }
  #nameplate h1 { animation: none; }
}

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.4s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-soft);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.8); opacity: 0.3; } }

/* ---------- hint ---------- */
#hint {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 12px);
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--pill);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  font: 500 0.95rem/1.2 "Inter Tight", system-ui, sans-serif;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2,.8,.2,1);
}
#hint { top: clamp(16px, 4vh, 40px); transform: translate(-50%, -12px); }
#hint.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- a company's own page ---------- */
#detail {
  position: fixed;
  inset: 0;
  padding: clamp(20px, 3.2vh, 40px) 2.4vw 96px;
  overflow: hidden auto;
  outline: none;
  scrollbar-color: rgba(242, 244, 247, 0.25) transparent;
}
#detail[hidden] { display: none; }
#detail h2 {
  width: max-content;
  margin: 0;
  font-size: clamp(2.5rem, 8.6vw, 9rem);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--ink);
  transform-origin: 0 0;
  will-change: transform;
}
.detail-story { max-width: min(620px, 46vw); margin-top: clamp(28px, 7vh, 84px); }
.role {
  padding: 22px 0 34px;
  border-top: 1px solid rgba(242, 244, 247, 0.16);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.open .role {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(0.65s + var(--i) * 0.12s);
}
.role h3 { margin: 0; font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.role p, .role li { font-size: 1.05rem; line-height: 1.55; color: rgba(242, 244, 247, 0.82); }
.role .role-meta { margin: 6px 0 0; font: 400 0.85rem/1.5 "JetBrains Mono", monospace; color: rgba(242, 244, 247, 0.6); }
.role .role-soon { margin: 10px 0 0; color: rgba(242, 244, 247, 0.6); }
.role ul { margin: 16px 0 0; padding: 0; list-style: none; }
.role li { position: relative; margin-top: 12px; padding-left: 22px; }
.role li::before { content: ""; position: absolute; left: 2px; top: 0.66em; width: 6px; height: 6px; border-radius: 50%; background: #2f6bff; }
.detail-back {
  position: fixed;
  right: 2.4vw;
  bottom: 24px;
  padding: 10px 16px;
  border: 1px solid rgba(242, 244, 247, 0.22);
  border-radius: 999px;
  background: var(--pill);
  color: var(--ink);
  font: 500 0.95rem/1.2 "Inter Tight", system-ui, sans-serif;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, border-color 0.2s ease;
}
.open .detail-back { opacity: 1; transition: opacity 0.6s ease 0.8s, border-color 0.2s ease; }
.detail-back:hover { border-color: rgba(242, 244, 247, 0.6); }
.detail-back:focus-visible { outline: 2px solid #6b97ff; outline-offset: 3px; }
.detail-back kbd { margin-left: 6px; font: 400 0.75rem "JetBrains Mono", monospace; color: var(--ink-soft); }
.credit { transition: opacity 0.4s ease; }
body.reading .credit { opacity: 0; pointer-events: none; }
@media (max-width: 899px) { .detail-story { max-width: 620px; } }
@media (prefers-reduced-motion: reduce) { .role, .open .role, .detail-back, .open .detail-back { transition: none; } }

/* ---------- model credit (CC BY 4.0) ---------- */
.credit {
  position: fixed;
  right: 12px;
  bottom: 8px;
  margin: 0;
  max-width: calc(100vw - 24px);
  font-size: 0.68rem;
  color: rgba(242, 244, 247, 0.5);
  text-align: right;
}
.credit a { color: inherit; }
.credit a:hover { color: var(--ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

#detail { scrollbar-width: thin; scrollbar-color: #2b2f37 transparent; }
#detail .detail-back { background: rgba(12, 14, 18, 0.92); }

/* the aircraft: in front of the title, behind the words */
.detail-craft { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.45s ease; }
.detail-story { position: relative; z-index: 2; }
.detail-back { z-index: 3; }
.has-craft .detail-story { text-shadow: 0 0 14px rgba(7, 8, 10, 0.95), 0 1px 3px rgba(7, 8, 10, 0.9); }
@media (max-width: 899px) {
  .detail-craft { position: absolute; height: 100vh; }
  .has-craft .detail-story { margin-top: 94vw; }
}
