/* ExumaLabs — 3D hub prototype. The scene is a fixed canvas; the page only scrolls an empty track. */

@view-transition { navigation: auto; }

:root {
    --bg: #0b0d12;
    --fg: #eef2f7;
    --ac: #e8830a;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0; background: var(--bg); color: var(--fg);
    font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.track { position: relative; pointer-events: none; }
.veil { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; z-index: 5; transition: opacity .5s ease; }
.veil.is-on { opacity: 1; }

.top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 4;
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) 22px;
}
.brand { font-weight: 700; letter-spacing: -.02em; text-decoration: none; font-size: 17px; }
.top__nav { display: flex; gap: 22px; font-size: 13px; }
.top__nav a { opacity: .6; text-decoration: none; transition: opacity .2s; }
.top__nav a:hover { opacity: 1; }
.top__nav { align-items: baseline; }
.sound {
    display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer;
    color: inherit; font: inherit; font-size: 13px; opacity: .6; transition: opacity .2s;
}
.sound:hover, .sound[aria-pressed="true"] { opacity: 1; }
.sound__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sound__bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; transition: height .3s; }
.sound[aria-pressed="true"] .sound__bars i { background: var(--ac); animation: bar 1.1s ease-in-out infinite; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(2) { animation-delay: -.3s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(3) { animation-delay: -.6s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 11px; } }

/* Overlay copy: left column, the scene's subject sits to the right. */
.intro, .story {
    position: fixed; left: var(--gutter); top: 50%; z-index: 3;
    width: min(44vw, 640px);
    transform: translateY(-50%);
    transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1);
}
.intro h1 {
    margin: 0; font-size: clamp(2.4rem, 4.6vw, 4.6rem); line-height: 1.02; font-weight: 700; letter-spacing: -.035em;
}
.intro p { margin: 18px 0 0; font-size: clamp(1.2rem, 2vw, 1.7rem); opacity: .55; letter-spacing: -.01em; }
.hint {
    display: inline-flex; align-items: center; gap: 10px; margin-top: 44px;
    font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .55;
}
.hint::before { content: ""; width: 1px; height: 34px; background: currentColor; animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.story { opacity: 0; pointer-events: none; }
.story.is-on { opacity: 1; pointer-events: auto; }
.intro.is-off { opacity: 0; transform: translateY(-58%); pointer-events: none; }
.story__n { margin: 0 0 18px; font: 500 12px/1 var(--mono); letter-spacing: .1em; opacity: .7; }
.story__n #s-n { color: var(--ac); }
.story__name {
    margin: 0; font-size: clamp(3rem, 7.4vw, 7.6rem); line-height: .92; font-weight: 750; letter-spacing: -.05em;
    white-space: nowrap;
}
.story__kind { margin: 18px 0 0; font-size: clamp(1rem, 1.5vw, 1.25rem); opacity: .7; }
.story__open {
    display: inline-flex; gap: 8px; align-items: center; margin-top: 34px; padding: 13px 20px;
    border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600;
    background: color-mix(in srgb, var(--fg) 8%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 16%, transparent);
    transition: background .25s, box-shadow .25s;
}
.story__open #s-state { color: var(--ac); }
.story__open i { font-style: normal; transition: transform .25s; }
.story__open:hover { background: color-mix(in srgb, var(--ac) 22%, transparent); box-shadow: inset 0 0 0 1px var(--ac); }
.story__open:hover i { transform: translateX(4px); }

/* Progress rail on the right edge: numbered, the current one in the accent color with a lead line. */
.rail {
    position: fixed; right: calc(var(--gutter) * .6); top: 50%; transform: translateY(-50%); z-index: 3;
    list-style: none; margin: 0; padding: 0; display: grid; gap: 4px;
}
.rail button {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 5px 0 5px 10px; border: 0; background: none; cursor: pointer; position: relative;
    color: var(--fg); font: 500 13px/1 var(--mono); letter-spacing: .04em;
}
.rail button b { font-weight: 500; opacity: .5; transition: opacity .25s, color .35s; }
.rail button::before {
    content: ""; height: 2px; width: 0; border-radius: 2px; background: var(--ac);
    transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.rail button.is-on b { opacity: 1; color: var(--ac); }
.rail button.is-on::before { width: 18px; }
.rail button:hover b { opacity: .95; }
/* Name on hover, on a chip so it reads over the scene. */
.rail button span {
    position: absolute; right: calc(100% + 6px); top: 50%; transform: translate(6px, -50%);
    white-space: nowrap; padding: 6px 10px; border-radius: 8px;
    font: 500 12px/1 var(--font); letter-spacing: 0;
    background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 14%, transparent);
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s;
}
.rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: translate(0, -50%); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ---------- Portrait windows: symbol on top, copy below, the rail runs along the bottom ---------- */
@media (orientation: portrait) {
    .top__nav { gap: 16px; }
    .top__nav a[href^="mailto"] { display: none; }
    .intro, .story {
        top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: var(--gutter);
        width: auto; transform: none;
    }
    .intro.is-off { transform: translateY(-12px); }
    .intro h1 { font-size: clamp(2rem, 8vw, 3.4rem); }
    .story__n { margin-bottom: 12px; }
    .story__name { font-size: clamp(2.6rem, 11vw, 4.8rem); white-space: normal; }
    .story__kind { margin-top: 12px; }
    .story__open { margin-top: 22px; }
    .hint { margin-top: 28px; }
    .rail {
        top: auto; right: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
        transform: translateX(50%); grid-auto-flow: column; gap: 2px;
    }
    .rail button { flex-direction: column-reverse; gap: 6px; padding: 6px 6px 4px; }
    .rail button::before { height: 2px; }
    .rail button span { right: 50%; top: auto; bottom: calc(100% + 4px); transform: translate(50%, 6px); }
    .rail button:hover span, .rail button:focus-visible span { transform: translate(50%, 0); }
}

.nojs { position: fixed; inset: auto var(--gutter) 40px; z-index: 6; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 4px; }
body.is-hovering-plate { cursor: pointer; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }
