@font-face {
    font-family: "Manrope";
    src: url("Manrope/Manrope-VariableFont_wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #080808;
    --paper: rgba(250, 250, 247, 0.78);
    --line: rgba(8, 8, 8, 0.2);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
html { background: #000; }

body {
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    background: #000;
    font-family: "Manrope", sans-serif;
    font-weight: 420;
    transition: filter .35s var(--ease);
}

/* The artwork and interface share one monochrome system, so dark mode is a
   literal inversion of the complete rendered page. */
:root[data-theme="dark"] body { filter: invert(1); }

button, a { font: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

#fractalCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    cursor: grab;
    image-rendering: auto;
}

#fractalCanvas:active { cursor: grabbing; }

.texture {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10000;
    padding: .65rem .9rem;
    color: #fff;
    background: #000;
    transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

#blackOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    color: #fff;
    background: #000;
    cursor: pointer;
    transition: opacity .8s var(--ease), visibility .8s;
}

#blackOverlay.is-dismissed { opacity: 0; visibility: hidden; pointer-events: none; }
#blackOverlay .enter-mark { font-size: 2rem; animation: float 1.8s ease-in-out infinite; }
#blackOverlay > span:not(.enter-mark) { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }

.site-header, .site-footer, .scene-content { position: fixed; z-index: 5; }

.site-header {
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.6rem clamp(1.25rem, 3vw, 3.5rem);
}

.wordmark {
    width: min-content;
    padding: .35rem .52rem;
    border-radius: .5rem;
    color: inherit;
    background: var(--paper);
    backdrop-filter: blur(12px);
    font-size: 1.12rem;
    font-weight: 760;
    letter-spacing: -.04em;
    text-decoration: none;
}

.wordmark span { opacity: .45; }

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.theme-toggle {
    display: grid;
    width: 2rem;
    height: 2rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: inherit;
    background: var(--paper);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.theme-toggle:hover { background: rgba(255,255,255,.92); transform: rotate(12deg); }

.theme-toggle-icon {
    width: .82rem;
    height: .82rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

#navBar {
    display: flex;
    gap: .25rem;
    padding: .28rem;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 .75rem 2.5rem rgba(0,0,0,.08);
    backdrop-filter: blur(16px);
}

.nav-button {
    padding: .55rem .9rem;
    border: 0;
    border-radius: 999px;
    color: inherit;
    background: transparent;
    font-size: .72rem;
    cursor: pointer;
    transition: color .25s, background .25s;
}

.nav-button:hover { background: rgba(0,0,0,.08); }
.nav-button[aria-current="page"] { color: #fff; background: var(--ink); }

.scene-count {
    justify-self: end;
    margin: 0;
    padding: .35rem .5rem;
    border-radius: .4rem;
    background: var(--paper);
    backdrop-filter: blur(12px);
    font-size: .69rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
}

.scene-content {
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

.scene-anchor {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.scene-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(39rem, calc(100vw - 2.5rem));
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity .5s var(--ease);
}

.scene-panel.is-visible { opacity: 1; }
.scene-panel[data-align="center"] { text-align: center; }

.scene-panel[data-surface="true"] {
    width: min(43rem, calc(100vw - 2.5rem));
    padding: clamp(1.5rem, 3vw, 3rem);
    border: 1px solid rgba(255,255,255,.45);
    border-radius: clamp(1.4rem, 3vw, 2.5rem);
    background: rgba(250,250,247,.84);
    box-shadow: 0 1.5rem 5rem rgba(0,0,0,.12);
    backdrop-filter: blur(18px);
}

.scene-eyebrow {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0 0 1.25rem;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.scene-eyebrow::before { content: ""; width: 1.8rem; height: 1px; background: currentColor; }
[data-align="center"] .scene-eyebrow { justify-content: center; }

.scene-title {
    max-width: 13ch;
    margin: 0;
    font-size: clamp(3.2rem, 8vw, 8.6rem);
    font-weight: 260;
    line-height: .89;
    letter-spacing: -.075em;
    text-wrap: balance;
}

[data-align="center"] .scene-title { margin-inline: auto; }

.scene-copy {
    max-width: 35rem;
    margin: 1.8rem 0 0;
    font-size: clamp(.94rem, 1.3vw, 1.12rem);
    line-height: 1.65;
    text-wrap: pretty;
}

[data-align="center"] .scene-copy { margin-inline: auto; }

.scene-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
[data-align="center"] .scene-links { justify-content: center; }

.scene-link {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .72rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: inherit;
    background: rgba(255,255,255,.36);
    font-size: .75rem;
    text-decoration: none;
    pointer-events: auto;
    backdrop-filter: blur(9px);
    transition: background .2s, transform .2s;
}

.scene-link:hover { background: rgba(255,255,255,.78); transform: translateY(-2px); }
.scene-link::after { content: "\2197"; }
.scene-link[data-scene-link]::after { content: "\2192"; }

.scene-socials {
    display: flex;
    gap: .75rem;
    margin-top: .85rem;
}

[data-align="center"] .scene-socials { justify-content: center; }

.social-link {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: rgba(24,23,21,.78);
    pointer-events: auto;
    transition: color .2s, opacity .2s, transform .2s;
}

.social-link:hover {
    color: var(--ink);
    transform: translateY(-1px);
}

.social-link svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-link .social-icon-dot,
.social-link .social-icon-fill {
    fill: currentColor;
    stroke: none;
}

.site-footer {
    bottom: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(5rem, 12rem) 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem clamp(1.25rem, 3vw, 3.5rem);
    font-size: .62rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.site-footer p { margin: 0; padding: .3rem .45rem; border-radius: .35rem; background: var(--paper); backdrop-filter: blur(10px); }
.progress-track { height: 1px; background: rgba(0,0,0,.2); }
.progress-track span { display: block; width: 33.333%; height: 100%; background: #000; transition: width .7s var(--ease); }
.camera-readout { justify-self: end; font-variant-numeric: tabular-nums; opacity: .55; }

.author-panel {
    position: fixed;
    z-index: 1000;
    top: 5.5rem;
    left: 1.25rem;
    width: min(22rem, calc(100% - 2.5rem));
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 1rem;
    background: rgba(248,248,245,.9);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.15);
    backdrop-filter: blur(18px);
    font-size: .72rem;
}

.author-panel > div { display: flex; justify-content: space-between; align-items: center; }
.author-panel pre { overflow-x: auto; margin: .8rem 0; font: .69rem/1.5 monospace; }
.author-panel button { width: 100%; padding: .65rem; border: 0; border-radius: .5rem; color: white; background: #090909; cursor: pointer; }
kbd { padding: .18rem .38rem; border: 1px solid #aaa; border-radius: .25rem; background: #fff; }

.author-crosshair {
    position: fixed;
    z-index: 999;
    top: 50%;
    left: 50%;
    width: 1.4rem;
    height: 1.4rem;
    border: 1px solid red;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.author-crosshair::before, .author-crosshair::after { content: ""; position: absolute; background: red; }
.author-crosshair::before { top: 50%; left: -50%; width: 200%; height: 1px; }
.author-crosshair::after { top: -50%; left: 50%; width: 1px; height: 200%; }

@keyframes float { 50% { transform: translateY(-.45rem); } }

@media (max-width: 620px) {
    .site-header { grid-template-columns: 1fr auto; padding-top: 1.2rem; }
    #navBar { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin-top: 1rem; }
    .header-actions { grid-column: 2; grid-row: 1; }
    .scene-panel, .scene-panel[data-align] { text-align: left; }
    [data-align="center"] .scene-eyebrow, [data-align="center"] .scene-links, [data-align="center"] .scene-socials { justify-content: flex-start; }
    [data-align="center"] .scene-title, [data-align="center"] .scene-copy { margin-left: 0; }
    .scene-title { font-size: clamp(3.35rem, 18vw, 5.4rem); }
    .scene-panel[data-surface="true"] { padding: 1.35rem; border-radius: 1.5rem; }
    .site-footer { grid-template-columns: auto 1fr; }
    .camera-readout { display: none; }
}

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

.is-motionless *, .is-motionless *::before, .is-motionless *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
}
