/* Shared DNA: fonts, resets, the square, the reality switcher, accessibility helpers.
   Each world owns its own file; nothing here sets a world's colour or type voice. */
@font-face { font-family: 'Archivo'; src: url(/assets/fonts/archivo.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/assets/fonts/geist-mono.woff2) format('woff2'); font-display: swap; }
/* Self-hosted (OFL): Space Grotesk (Neon District), Cormorant Garamond (The Hollow). Geist Mono is the shared UI face. */
@font-face { font-family: 'Space Grotesk'; src: url(/other-side/fonts/space-grotesk.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/other-side/fonts/cormorant-300-normal.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/other-side/fonts/cormorant-300-italic.woff2) format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/other-side/fonts/cormorant-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/other-side/fonts/cormorant-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --pad: clamp(1rem, 3.4vw, 3.25rem);
  --fable: #3B45DE; --neon: #080B12; --hollow: #090A12;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
html { scroll-behavior: auto; }
body { font: 16px/1.5 'Archivo', system-ui, sans-serif; overflow-x: clip; -webkit-font-smoothing: antialiased; }
body[data-view='select'] { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
[tabindex="-1"]:focus { outline: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
/* Type system. One functional layer shared by every world: Geist Mono for navigation, controls and metadata,
   Archivo for reading. Each world then owns a display voice: Fable = Archivo condensed black, Neon = Space Grotesk,
   Hollow = Cormorant Garamond light. Sizes come from the tokens below so metadata reads the same everywhere. */
:root { --f-ui: 'Geist Mono', ui-monospace, monospace; --f-body: 'Archivo', system-ui, sans-serif;
  --t-ui: .8rem; --t-micro: .75rem; --ls-ui: .07em; --t-body: 1rem; --t-lede: clamp(1.05rem, 1.35vw, 1.25rem); }
.mono { font-family: var(--f-ui); font-size: var(--t-ui); letter-spacing: var(--ls-ui); text-transform: uppercase; }
/* every world's section links share one treatment; only colour comes from the world */
.fnav__links a, .nnav__links a, .hnav__links a { font: 500 var(--t-ui)/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; z-index: 200; left: 1rem; top: 1rem; padding: .7rem 1rem; background: #111; color: #fff; translate: 0 -200%; }
.skip:focus { translate: 0 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.world { min-height: 100svh; position: relative; outline: none; }
.world[hidden] { display: none; }

/* The reality switcher: three small squares, the current one filled. Same logic in every world. */
.realm { display: flex; gap: .45rem; align-items: center; }
.realm a { display: grid; place-items: center; width: 44px; height: 44px; text-decoration: none; position: relative; }
.realm a:focus-visible { outline-offset: -4px; }
.realm a::before { content: ''; width: 14px; height: 14px; border: 1.5px solid currentColor; transition: transform .5s var(--ease), background-color .3s; }
.realm a[aria-current='page']::before { background: currentColor; }
.realm a:hover::before, .realm a:focus-visible::before { transform: rotate(45deg) scale(1.15); }
.realm a::after { content: attr(title); position: absolute; top: calc(100% - 4px); right: 0; white-space: nowrap; font: var(--t-micro)/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; opacity: 0; translate: 0 -4px; transition: opacity .3s, translate .4s var(--ease); pointer-events: none; }
.realm a:hover::after, .realm a:focus-visible::after { opacity: 1; translate: 0 0; }

/* Reveal on scroll (each world adds its own flavour) */
[data-reveal] { transition: opacity 1s var(--ease), translate 1.2s var(--ease), filter 1.2s var(--ease), clip-path 1.2s var(--ease); }

/* Transition layer: holds the world-specific pieces while a door opens or closes */
.tx { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.tx > * { position: absolute; }

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

body:not([data-view='select']) .skip { display: none; }

/* The transition signature: whichever way you travel, the destination's name is set in the destination's type,
   and when you come from another world it starts in the type you are leaving. */
.txcap { inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.2rem; text-align: center; z-index: 5; }
.txcap__from { font: var(--t-ui)/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; }
.txcap__word { display: grid; font-size: clamp(3rem, 10vw, 9.5rem); line-height: .9; white-space: nowrap; }
.txcap__word > span { grid-area: 1 / 1; display: block; }
.txcap__word .c { display: inline-block; }
.txcap [data-v='fable'] { font-weight: 900; font-variation-settings: 'wdth' 62, 'wght' 900; text-transform: uppercase; }
.txcap [data-v='neon'] { font-family: 'Space Grotesk', sans-serif; font-weight: 500; letter-spacing: -.04em; }
.txcap [data-v='hollow'] { font-family: 'Cormorant Garamond', serif; font-weight: 300; }
.txcap[data-to='fable'] { color: #F4F0E6; } .txcap[data-to='neon'] { color: #EAF1FF; } .txcap[data-to='hollow'] { color: #D8D2C6; }

/* Discoverability: the world switcher says what it is; covers carry one quiet line about their interaction */
.realm__k { margin-right: .3rem; font-size: var(--t-micro); }
@media (max-width: 700px) { .realm__k { display: none; } }


/* Shared project button: the one control that opens a full homepage, in every world */
.pbtn { display: inline-flex; align-items: center; gap: .8rem; min-height: 48px; padding: 0 1.2rem 0 1rem; border: 1.5px solid currentColor; background: transparent; color: inherit; cursor: pointer;
  font: 500 var(--t-ui)/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; transition: background-color .3s var(--ease), color .3s var(--ease); }
.pbtn i { width: 11px; height: 11px; background: currentColor; transition: transform .5s var(--ease); }
.pbtn:hover i, .pbtn:focus-visible i { transform: rotate(45deg); }

/* The viewer: a full homepage, scrollable, desktop or phone */
.viewer { width: min(72rem, calc(100vw - 2rem)); height: min(100svh - 2rem, 60rem); max-height: none; padding: 0; border: 0; background: #F4F1EA; color: #141634; display: none; grid-template-rows: auto 1fr auto; overflow: hidden; }
.viewer[open] { display: grid; }
.viewer::backdrop { background: rgba(9, 10, 18, .72); }
.viewer__bar { display: flex; align-items: center; gap: 1rem; padding: .7rem .7rem .7rem 1.2rem; border-bottom: 1px solid rgba(20, 22, 52, .15); flex-wrap: wrap; }
.viewer__title { font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.viewer__seg { display: flex; border: 1.5px solid currentColor; }
.viewer__seg button, .viewer__close { min-height: 44px; padding: 0 1rem; border: 0; background: transparent; cursor: pointer; font: 500 var(--t-ui)/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.viewer__seg button[aria-pressed='true'] { background: #141634; color: #F4F1EA; }
.viewer__close { border: 1.5px solid currentColor; }
.viewer__scroll { overflow: auto; overscroll-behavior: contain; background: #DEDAD0; padding: clamp(.6rem, 2vw, 1.4rem); }
.viewer__scroll img { margin: 0 auto; width: 100%; max-width: 960px; height: auto; box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .5); }
.viewer[data-vw='m'] .viewer__scroll img { max-width: 390px; }
.viewer__note { padding: .7rem 1.2rem; border-top: 1px solid rgba(20, 22, 52, .15); color: #4A4C60; }

/* Back to the portfolio, from the selector */
.sel__back { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border: 1.5px solid currentColor; border-radius: 99px; text-decoration: none; font: 500 var(--t-ui)/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; transition: background-color .3s, color .3s; }
.sel__back:hover, .sel__back:focus-visible { background: #121320; color: #EFEBE2; outline: none; }
.sel[data-hover] .sel__back:hover, .sel[data-hover] .sel__back:focus-visible { background: currentColor; }
/* Opening from the homepage's full stop (sessionStorage os-from) */
.enter body { clip-path: inset(var(--at) var(--ar) var(--ab) var(--al)); animation: os-open .7s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes os-open { to { clip-path: inset(0 0 0 0); } }
@view-transition { navigation: auto; }
.plink { display: inline-flex; align-items: center; min-height: 48px; padding: 0 .2rem; font: 500 var(--t-ui)/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; text-underline-offset: .3em; }
.pj__acts { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
