/* Nexora Realm — studio site.
   Ultramarine, ink and white. One heavy display face (Dela Gothic One) for
   names and headings, one quiet text face (Onest) for everything else. The
   backdrop is the particle field drawn by realm.js; the page colour follows
   the section you are reading. */
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/dela-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Dela Gothic One"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(assets/fonts/dela-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ultra: #1a2be0;
  --ultra-deep: #1120b4;
  --ink: #05060d;
  --paper: #f1f2f7;
  --white: #f6f7fc;
  --haze: rgba(246, 247, 252, .72);
  --text-dark: #0b0e22;
  --mute-dark: #4b5170;
  --current: var(--ultra);

  --display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --text: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: .9375rem;
  --step-0: 1.125rem;
  --step-1: clamp(1.25rem, 1.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 2.4vw, 2.125rem);
  --step-3: clamp(2.25rem, 5vw, 4.75rem);
  --gutter: clamp(1rem, 4.5vw, 4rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100%;
  background: var(--current); color: var(--white);
  font: 400 var(--step-0)/1.6 var(--text);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  transition: background-color .9s var(--ease);
  overflow-x: hidden;
}
body[data-bg="ultra"] { --current: var(--ultra); }
body[data-bg="ink"] { --current: var(--ink); }
body[data-bg="paper"] { --current: var(--paper); }
::selection { background: var(--white); color: var(--ultra); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h2, h3 { text-wrap: balance; font-weight: 400; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 3px; }
.skip { position: absolute; left: var(--gutter); top: -5rem; z-index: 30; background: var(--white); color: var(--ultra); padding: .7rem 1rem; font-weight: 600; }
.skip:focus { top: 1rem; }

/* The particle field sits behind everything and never takes the pointer. */
.realm { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; }
main, .footer { position: relative; z-index: 1; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1.1rem) var(--gutter) 1.1rem;
  color: var(--white); transition: color .6s, background-color .6s;
}
body[data-bg="paper"] .nav { color: var(--text-dark); }
.nav.scrolled { background: color-mix(in srgb, var(--current) 78%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }
.mark { width: 1.9rem; height: 1.9rem; fill: currentColor; }
.mark circle:not(.mark-core) { transform-origin: 16px 16px; animation: orbit 24s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.nav nav { display: flex; gap: 2rem; margin-left: auto; }
.nav nav a { position: relative; text-decoration: none; font-size: var(--step--1); font-weight: 500; opacity: .82; transition: opacity .2s; }
.nav nav a:hover { opacity: 1; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.button {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 1.6rem; border-radius: .375rem;
  background: var(--white); color: var(--ultra);
  font: 600 var(--step--1)/1 var(--text); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  transition: color .35s var(--ease), box-shadow .35s var(--ease);
}
/* The fill rises from the bottom edge on hover. */
.button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateY(101%); transition: transform .45s var(--ease); }
.button:hover { color: var(--white); }
.button:hover::before { transform: none; }
.button:active { transform: translateY(1px); }
.button-ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--haze); }
.button-ghost::before { background: var(--white); }
.button-ghost:hover { color: var(--ultra); box-shadow: inset 0 0 0 1.5px var(--white); }
.button-light { color: var(--ink); }
.button-light::before { background: var(--ultra); }
.button-small { min-height: 2.6rem; padding: 0 1.1rem; }
body[data-bg="paper"] .nav .button { background: var(--ultra); color: var(--white); }
body[data-bg="paper"] .nav .button::before { background: var(--ink); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding: 6rem var(--gutter) calc(env(safe-area-inset-bottom, 0px) + clamp(2rem, 6vh, 4rem));
}
.wordmark {
  align-self: center; justify-self: center; text-align: center;
  font: 400 clamp(3.5rem, 12.5vw, 12rem)/.86 var(--display); letter-spacing: .02em; text-transform: uppercase;
}
.wordmark span { display: block; }
.gl .wordmark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-foot { grid-row: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.lede { max-width: 27ch; font-size: var(--step-1); font-weight: 350; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ── Shared section rhythm ──────────────────────────────────────────────── */
.studio, .veil, .facts, .journal { padding: clamp(6rem, 16vh, 11rem) var(--gutter); }
.title { font: 400 var(--step-3)/1.02 var(--display); letter-spacing: -.005em; }
.kicker { font-size: var(--step--1); font-weight: 500; color: var(--haze); }

/* ── Studio: copy on the left, the planet turns on the right ────────────── */
.studio { min-height: 130vh; display: grid; align-content: start; gap: clamp(3rem, 10vh, 6rem); }
.studio-copy, .principles { max-width: min(46rem, 50vw); }
.studio-copy { display: grid; gap: 2rem; }
.statement { font-size: var(--step-2); font-weight: 300; line-height: 1.32; letter-spacing: -.012em; max-width: 30ch; }
.principles { display: grid; gap: 2.5rem; }
.principles h3 { font: 400 var(--step-1)/1.15 var(--display); margin-bottom: .6rem; }
.principles p { color: var(--haze); max-width: 40ch; }

/* ── VEIL ───────────────────────────────────────────────────────────────── */
.veil { display: grid; gap: clamp(3rem, 9vh, 6rem); }
.veil-head { display: grid; gap: 1.25rem; min-height: 62vh; align-content: center; }
.veil-title { font: 400 clamp(5.5rem, 17vw, 17rem)/.82 var(--display); letter-spacing: .02em; margin-left: -.04em; }
.veil-sub { font-size: var(--step-1); font-weight: 350; max-width: 30ch; line-height: 1.45; }
.keyart { margin: 0; aspect-ratio: 21 / 9; overflow: hidden; border-radius: .5rem; }
.keyart img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.veil-body { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 4rem; }
.veil-body p { max-width: 40ch; font-size: var(--step-1); font-weight: 350; line-height: 1.5; color: var(--haze); }

/* ── Facts: the number is drawn by the particles; text stays on the left ── */
.facts { min-height: 120vh; display: grid; align-content: center; }
.facts-copy { max-width: min(40rem, 48vw); display: grid; gap: clamp(2.5rem, 7vh, 4rem); }
.facts-lead { font-size: var(--step-1); font-weight: 350; line-height: 1.5; max-width: 36ch; }
.facts-number { font-weight: 600; }
.facts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.facts-list li { font-size: var(--step-2); font-weight: 300; line-height: 1.3; letter-spacing: -.01em; color: var(--haze); max-width: 28ch; }

/* ── Journal: the page turns white for reading ──────────────────────────── */
.journal { color: var(--text-dark); display: grid; gap: clamp(3rem, 8vh, 5rem); }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(2.5rem, 6vh, 3.5rem); max-width: 54rem; }
.entries li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: .5rem 2.5rem; align-items: baseline; }
.entries time { font: 400 var(--step-1)/1.2 var(--display); color: var(--ultra); }
.entries p { font-size: var(--step-1); font-weight: 350; line-height: 1.5; max-width: 46ch; color: var(--text-dark); }

/* ── Footer: the wordmark gathers again above the contacts ──────────────── */
.footer {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto auto; gap: clamp(2.5rem, 6vh, 4rem);
  padding: 6rem var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 1.75rem);
}
.footer-copy { grid-row: 2; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 4rem; }
.footer-copy .title { max-width: 12ch; }
.contacts { display: grid; gap: 1.25rem; justify-items: start; max-width: 30rem; }
.contacts p { color: var(--haze); }
.code { font-weight: 600; color: var(--white); }
.footer-base { grid-row: 3; display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); color: var(--haze); }
.footer-base a { text-decoration: none; }
.footer-base a:hover { color: var(--white); }

/* ── Motion: words rise out of their line, blocks fade up once ──────────── */
.js .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.js .split .w > span { display: inline-block; transform: translateY(105%); }
.js .split.in .w > span { transform: none; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }
.js .rise { opacity: 0; transform: translateY(1.5rem); }
.js .rise.in { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--delay, 0s); }
.js .keyart img { clip-path: inset(18% 0 18% 0); transform: scale(1.18); }
.js .keyart.in img { clip-path: inset(0); transform: none; transition: clip-path 1.6s var(--ease), transform 2s var(--ease); }
.js .hero .rise { --delay: 1.8s; }
.js .hero .actions.rise { --delay: 2s; }
.gl-pending .wordmark { opacity: 0; }
.js:not(.gl) .wordmark { opacity: 0; transform: translateY(2rem); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.js:not(.gl):not(.gl-pending) .loaded .wordmark { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .split .w > span, .js .rise, .js .keyart img, .js:not(.gl) .wordmark { transform: none !important; opacity: 1 !important; clip-path: none !important; transition: none !important; }
  .mark circle:not(.mark-core) { animation: none; }
  .button::before { transition: none; }
}

/* ── Narrow screens: forms float in the top half, text scrolls under them ─ */
@media (max-width: 900px) {
  .nav { gap: 1rem; }
  .nav nav { display: none; }
  .nav .button-small { margin-left: auto; }
  .hero { padding-top: 5rem; }
  .gl .hero { grid-template-rows: 1fr auto; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 1.5rem; }
  .actions .button { flex: 1 1 auto; }
  .studio, .veil, .facts { padding-top: 52vh; }
  .journal { padding-top: 46vh; }
  .studio { min-height: 0; }
  .studio-copy, .principles, .facts-copy { max-width: none; }
  .veil-head { min-height: 0; }
  .keyart { aspect-ratio: 4 / 3; }
  .facts { min-height: 0; }
  .entries li { grid-template-columns: 1fr; gap: .4rem; }
  .footer { padding-top: 60vh; grid-template-rows: auto auto; }
  .footer-copy { grid-row: 1; }
  .footer-base { grid-row: 2; }
}
@media (max-width: 480px) {
  .brand span { font-size: 1rem; }
  .button-small { padding: 0 .9rem; }
}
