/* Onest, self-hosted (variable font, 400–900) — no requests to Google */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../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: 400 900; font-display: swap; src: url(../fonts/onest-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../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 {
  --bg: #140b22;
  --bg-2: #1c1030;
  --ink: #f4effc;
  --muted: #b8acd0;
  --lilac: #e0cffb;
  --lilac-2: #b693f5;
  --violet: #5b2ca8;
  --amber: #ffb84d;
  --amber-2: #ff9a2e;
  --line: rgba(224, 207, 251, .12);
  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mx: 50vw;
  --my: 50vh;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--amber); color: var(--bg); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 6px; }

.wrap { width: min(1440px, 100% - 32px); margin-inline: auto; }
@media (min-width: 700px) { .wrap { width: min(1440px, 100% - 80px); } }

.dot { font-style: normal; color: var(--amber); display: inline-block; }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); } 80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: #0d0717;
  display: grid; place-items: center; align-content: center; gap: 28px;
}
.loader__mark { width: min(46vw, 260px); overflow: visible; }
.loader__stroke { fill: none; stroke: var(--lilac); stroke-width: 6; stroke-dasharray: 4200; stroke-dashoffset: 4200; }
.loader__fill { fill: var(--lilac); opacity: 0; }
.loader__orb { opacity: 0; filter: drop-shadow(0 0 30px rgba(255, 184, 77, .9)); transform-origin: 702px 388px; }
.loader__count { font-weight: 700; letter-spacing: .2em; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.no-js .loader, .reduced .loader { display: none; }

/* ---------- Cursor (the light) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; opacity: 0; }
.has-cursor .cursor { opacity: 1; }
.cursor__dot, .cursor__glow { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor__dot {
  width: 12px; height: 12px;
  background: radial-gradient(circle at 35% 35%, #fff3d4, var(--amber) 55%, var(--amber-2));
  box-shadow: 0 0 12px 3px rgba(255, 184, 77, .75), 0 0 40px 10px rgba(255, 154, 46, .25);
  transition: width .35s var(--ease), height .35s var(--ease), background .3s;
}
.cursor__glow {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(255, 184, 77, .10), rgba(182, 147, 245, .05) 40%, transparent 70%);
}
.cursor.is-hover .cursor__dot { width: 54px; height: 54px; background: radial-gradient(circle, rgba(255, 220, 160, .35), rgba(255, 184, 77, .15) 60%, transparent 72%); }
@media (pointer: fine) { .has-cursor, .has-cursor a, .has-cursor button { cursor: none; } }

/* ---------- Lights off ---------- */
.darkness {
  position: fixed; inset: 0; z-index: 120; pointer-events: none; opacity: 0;
  background: radial-gradient(circle 230px at var(--mx) var(--my), transparent 0, rgba(5, 2, 10, .55) 45%, rgba(4, 2, 8, .97) 100%);
  transition: opacity .9s var(--ease);
}
.lights-off .darkness { opacity: 1; }
.swarm { position: fixed; inset: 0; z-index: 121; pointer-events: none; }
.moth {
  position: absolute; left: 0; top: 0; width: 34px; height: 28px; opacity: 0;
  color: var(--lilac); will-change: transform;
  filter: drop-shadow(0 0 6px rgba(224, 207, 251, .55));
}
.moth svg { width: 100%; height: 100%; fill: currentColor; animation: flap .16s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes flap { from { transform: scaleX(1); } to { transform: scaleX(.3); } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px max(16px, calc((100% - 1440px) / 2));
  transition: background .4s, backdrop-filter .4s, transform .5s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
@media (min-width: 700px) { .nav { padding-inline: max(40px, calc((100% - 1440px) / 2)); } }
.nav.is-scrolled { background: rgba(20, 11, 34, .72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); padding-block: 12px; }
.nav.is-hidden { transform: translateY(-110%); }
.nav__brand { display: flex; align-items: center; gap: 12px; font-size: 19px; letter-spacing: -.01em; }
.nav__brand img { width: 40px; height: 40px; border-radius: 50%; transition: transform .8s var(--ease); }
.nav__brand:hover img { transform: rotate(-14deg) scale(1.08); }
.nav__brand span { color: var(--muted); }
.nav__brand b { color: var(--ink); font-weight: 800; }
.nav__links { display: flex; gap: 6px; }
.nav__links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color .3s, background .3s; }
.nav__links a:hover { color: var(--ink); background: rgba(224, 207, 251, .08); }
@media (max-width: 760px) {
  .nav__links a:nth-child(2), .nav__links a:nth-child(4) { display: none; }
  .nav__brand { font-size: 17px; }
  .nav__brand img { width: 34px; height: 34px; }
  .nav__links a { padding: 8px 10px; font-size: 15px; }
}

/* ---------- Eyebrow / headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--lilac);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: pulse 2.4s ease-in-out infinite; }
.eyebrow--center { display: flex; justify-content: center; }
@keyframes pulse { 50% { box-shadow: 0 0 2px var(--amber); opacity: .6; } }

.h2 { font-size: clamp(54px, 9vw, 132px); line-height: .9; letter-spacing: -.055em; font-weight: 900; margin: 0; }
.h2--sm { font-size: clamp(40px, 5vw, 64px); letter-spacing: -.045em; }

[data-split] .char { display: inline-block; will-change: transform; }
[data-split] .word { display: inline-block; white-space: nowrap; }
.split-mask { display: inline-block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; vertical-align: top; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 90px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 72% 45%, rgba(91, 44, 168, .38), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(255, 154, 46, .08), transparent 70%);
}
.hero__fireflies { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; }
.hero__title { margin: 0; font-weight: 900; font-size: clamp(76px, 12.4vw, 190px); line-height: .84; letter-spacing: -.065em; }
.hero__title .line { display: block; }
.hero__title .line--accent { color: var(--lilac); }
.hero__lead { margin: 34px 0 0; max-width: 30ch; font-size: clamp(19px, 1.7vw, 25px); color: #d4c9e6; line-height: 1.45; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 38px; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 58px; padding: 0 26px; border-radius: 14px; font-weight: 700; font-size: 17px; overflow: hidden; isolation: isolate;
  transition: box-shadow .4s var(--ease);
}
.btn span { position: relative; z-index: 1; }
.btn--amber { background: var(--amber); color: #23123a; box-shadow: 0 10px 40px -10px rgba(255, 184, 77, .6); }
.btn--amber::before {
  content: ""; position: absolute; inset: 0; z-index: 0; background: #ffd690;
  transform: translateY(101%); border-radius: 50% 50% 0 0; transition: transform .55s var(--ease), border-radius .55s var(--ease);
}
.btn--amber:hover::before { transform: translateY(0); border-radius: 0; }
.btn--amber:hover { box-shadow: 0 14px 60px -8px rgba(255, 184, 77, .85); }
.btn--ghost { border: 1px solid rgba(224, 207, 251, .28); color: var(--ink); }
.btn--ghost:hover { background: rgba(224, 207, 251, .08); }

.hero__stage { display: grid; justify-items: center; gap: 30px; }
.stage { position: relative; width: min(42vw, 560px); aspect-ratio: 1; transform-style: preserve-3d; will-change: transform; }
.stage__halo { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, rgba(140, 70, 230, .45), rgba(91, 44, 168, .12) 45%, transparent 68%); filter: blur(10px); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.07); opacity: .8; } }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(224, 207, 251, .12); }
.ring--1 { inset: -3%; border-color: rgba(255, 184, 77, .22); }
.ring--2 { inset: -12%; animation: spin 26s linear infinite; }
.ring--3 { inset: -21%; border-color: rgba(224, 207, 251, .07); animation: spin 40s linear infinite reverse; }
.ring__spark { position: absolute; top: 50%; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 14px 3px rgba(255, 184, 77, .8); }
.ring__spark--lilac { right: auto; left: 14%; top: 14%; width: 6px; height: 6px; background: var(--lilac); box-shadow: 0 0 12px 2px rgba(224, 207, 251, .8); }
@keyframes spin { to { transform: rotate(360deg); } }
.stage__disc { position: absolute; inset: 7%; border-radius: 50%; overflow: hidden; box-shadow: 0 40px 120px -20px rgba(91, 44, 168, .8), inset 0 0 0 1px rgba(224, 207, 251, .1); transform: translateZ(40px); }
.stage__logo { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.stage__shine { position: absolute; inset: 0; background: radial-gradient(circle at var(--sx, 30%) var(--sy, 25%), rgba(255, 255, 255, .18), transparent 40%); mix-blend-mode: screen; pointer-events: none; }

.lights {
  position: relative; z-index: 130; display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(224, 207, 251, .3);
  background: rgba(20, 11, 34, .5); backdrop-filter: blur(8px); font-size: 16px; font-weight: 500;
  transition: border-color .3s, background .3s;
}
.lights:hover { border-color: var(--amber); }
.lights__bulb { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 14px var(--amber); transition: background .4s, box-shadow .4s; }
.lights-off .lights__bulb { background: #3d2c55; box-shadow: none; }

.scroll-hint { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid rgba(224, 207, 251, .35); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--amber); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 900px) {
  .hero { padding-top: 110px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__stage { order: -1; gap: 22px; }
  .stage { width: min(60vw, 340px); }
  .scroll-hint { display: none; }
}

/* ---------- Marquee ---------- */
.marquee { position: relative; overflow: hidden; border-block: 1px solid var(--line); padding: 26px 0; transform: rotate(-1.6deg) scale(1.03); background: rgba(28, 16, 48, .6); }
.marquee__track { display: flex; width: max-content; align-items: center; gap: 36px; animation: marquee 34s linear infinite; }
.marquee span { font-size: clamp(30px, 4.4vw, 62px); font-weight: 900; letter-spacing: -.04em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.2px rgba(224, 207, 251, .55); transition: color .4s; }
.marquee span:nth-child(4n+1) { color: var(--lilac); -webkit-text-stroke: 0; }
.marquee b { color: var(--amber); font-size: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Projects ---------- */
.projects { padding: clamp(110px, 14vw, 190px) 0 80px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 48px; }
.section-head__note { max-width: 30ch; margin: 0 0 12px; color: var(--muted); font-size: 18px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden; isolation: isolate;
  border: 1px solid rgba(224, 207, 251, .12); transform-style: preserve-3d; will-change: transform;
  transition: box-shadow .6s var(--ease), border-color .5s;
}
.card:hover { box-shadow: 0 40px 100px -40px rgba(255, 184, 77, .35); border-color: rgba(255, 184, 77, .35); }
.card__link { position: absolute; inset: 0; z-index: 5; border-radius: inherit; }
.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; clip-path: inset(0 0 0 0); }
.card__img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .6s; opacity: 0; }
.card__img.is-loaded { opacity: 1; }
.card:hover .card__img { transform: scale(1.06); }
.card__body { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px 24px; }
.card__body > div { flex: 1; }
.card__num { align-self: start; font-size: 13px; font-weight: 700; opacity: .55; letter-spacing: .1em; padding-top: 8px; }
.card__title { margin: 0; font-size: clamp(30px, 3vw, 42px); line-height: 1; letter-spacing: -.045em; font-weight: 900; }
.card__sub { margin: 8px 0 0; font-size: 16px; opacity: .78; }
.pill { position: relative; z-index: 6; pointer-events: none; display: inline-flex; gap: 8px; align-items: center; padding: 10px 18px; border-radius: 999px; border: 1.5px solid currentColor; font-weight: 700; font-size: 15px; transition: background .4s, color .4s; }
.pill i { font-style: normal; display: inline-block; transition: transform .5s var(--ease); }
.card:hover .pill i { transform: translate(3px, -3px) rotate(0deg); }

.card--woertzel { background: #2b1a14; color: #fbe7d4; }
.card--woertzel .card__sub { color: #f0b27a; opacity: 1; }
.card--woertzel:hover .pill { background: #fbe7d4; color: #2b1a14; }
.card--reys { background: #ebe3d3; color: #1d1a17; }
.card--reys:hover .pill { background: #1d1a17; color: #ebe3d3; }

.card__fallback { position: absolute; inset: 0; transition: opacity .6s; }
.card__img.is-loaded + .card__fallback { opacity: 0; }
.card__fallback--woertzel {
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(70% 80% at 50% 110%, #f39a3d 0%, #b9581c 35%, transparent 70%), linear-gradient(180deg, #3a2219, #2b1a14);
}
.wz-word { font-size: clamp(56px, 9vw, 130px); font-weight: 900; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px #f6c58e; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.wz-snow {
  position: absolute; inset: -100% 0 0 0; opacity: .7;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 90px 70px, #fff, transparent), radial-gradient(2px 2px at 150px 20px, #ffe9d2, transparent), radial-gradient(1px 1px at 60px 110px, #fff, transparent);
  background-size: 180px 130px; animation: snow 9s linear infinite;
}
@keyframes snow { to { transform: translateY(50%); } }
.card__fallback--reys { background: #f6f1e6; color: #1d1a17; padding: 4% 8%; }
.paper-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; border-bottom: 1.5px solid #1d1a17; padding-bottom: 10px; }
.paper-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(44px, 6vw, 96px); line-height: .9; letter-spacing: -.04em; text-align: center; margin-top: 6%; }

/* ---------- Sign story ---------- */
.sign { position: relative; }
.sign__pin { min-height: 100svh; display: flex; align-items: center; padding: 100px 0 60px; }
.sign__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.sign__visual { position: relative; aspect-ratio: 1; width: min(100%, 74svh); justify-self: center; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #2a1247, #1a0c2e 70%); box-shadow: inset 0 0 0 1px var(--line), 0 60px 140px -60px rgba(91, 44, 168, .9); display: grid; place-items: center; }
.sign__svg { width: 78%; overflow: visible; }
.sign__m { fill: var(--lilac); }
.wing { transform-box: view-box; }
.wing--l { transform-origin: 605px 640px; }
.wing--r { transform-origin: 605px 640px; }
.sign__orb { transform-origin: 702px 388px; filter: drop-shadow(0 0 24px rgba(255, 184, 77, .85)); }
.sign__glow { transform-origin: 702px 388px; }
.sign__steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { position: relative; padding: 18px 20px 18px 64px; border-radius: 16px; opacity: .32; transition: opacity .5s var(--ease), background .5s; }
.step.is-active { opacity: 1; background: rgba(224, 207, 251, .06); }
.step__n { position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; border: 1.5px solid rgba(224, 207, 251, .35); transition: background .5s, color .5s, border-color .5s; }
.step.is-active .step__n { background: var(--amber); border-color: var(--amber); color: var(--bg); box-shadow: 0 0 18px rgba(255, 184, 77, .6); }
.step h3 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.03em; font-weight: 800; }
.step p { margin: 0; color: var(--muted); }
.sign__progress { margin-top: 22px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.sign__progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--lilac-2), var(--amber)); transform-origin: left; transform: scaleX(0); }
@media (max-width: 900px) {
  .sign__grid { grid-template-columns: 1fr; gap: 28px; }
  .sign__visual { width: min(62vw, 340px); margin-inline: auto; }
  .sign__pin { padding-top: 80px; }
  .step { padding: 12px 14px 12px 54px; }
  .step__n { left: 12px; top: 12px; }
  .step h3 { font-size: 20px; }
  .step p { font-size: 15px; }
}

/* ---------- About ---------- */
.about { padding: clamp(90px, 12vw, 170px) 0 40px; }
.about__card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(26px, 4vw, 60px); align-items: center;
  padding: clamp(28px, 5vw, 64px); border-radius: 28px; overflow: hidden;
  background: linear-gradient(120deg, #2c1550 0%, #1d0f33 60%, #1a0d2c 100%); border: 1px solid var(--line);
}
.about__card::after { content: ""; position: absolute; right: -10%; top: -40%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 184, 77, .12), transparent 65%); pointer-events: none; }
.about__mark img { width: clamp(96px, 12vw, 160px); height: auto; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(0, 0, 0, .6); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-4deg); } }
.about__words { margin: 20px 0 0; max-width: 38ch; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.4; letter-spacing: -.015em; font-weight: 500; }
.about__words .w { opacity: .18; transition: none; }
@media (max-width: 640px) { .about__card { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { padding: clamp(110px, 14vw, 200px) 0 clamp(90px, 10vw, 150px); text-align: center; }
.contact__title { margin: 0; font-size: clamp(52px, 10vw, 150px); line-height: .9; letter-spacing: -.06em; font-weight: 900; }
.contact__mail {
  display: inline-block; margin-top: 44px; font-size: clamp(20px, 3.4vw, 44px); font-weight: 700; letter-spacing: -.02em;
  padding: 10px 6px; background: linear-gradient(90deg, var(--lilac), var(--amber)) left bottom / 0 2px no-repeat;
  transition: background-size .6s var(--ease); word-break: break-all;
}
.contact__mail:hover { background-size: 100% 2px; }
.copy { display: block; margin: 18px auto 0; color: var(--muted); font-size: 15px; padding: 8px 14px; border-radius: 999px; transition: color .3s, background .3s; }
.copy:hover { color: var(--ink); background: rgba(224, 207, 251, .07); }
.copy.is-done { color: var(--amber); }

/* ---------- Footer ---------- */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 30px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.footer__brand img { width: 30px; height: 30px; border-radius: 50%; }
.footer__link:hover { color: var(--amber); }
.footer__legal { display: flex; gap: 20px; }

/* ---------- Legal pages ---------- */
.legal-page .nav { position: sticky; background: rgba(20, 11, 34, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color .3s, background .3s; }
.back:hover { color: var(--ink); background: rgba(224, 207, 251, .08); }
.back i { font-style: normal; transition: transform .4s var(--ease); }
.back:hover i { transform: translateX(-4px); }
.legal { position: relative; padding: clamp(48px, 8vw, 110px) 0 clamp(60px, 8vw, 110px); }
.legal::before { content: ""; position: absolute; right: 0; top: 0; width: 46vw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(91, 44, 168, .35), transparent 65%); pointer-events: none; z-index: -1; }
.legal__head { max-width: 860px; margin-bottom: 40px; }
.legal__title { margin: 0; font-size: clamp(52px, 9vw, 120px); line-height: .9; letter-spacing: -.06em; font-weight: 900; }
.legal__meta { margin: 18px 0 0; color: var(--muted); }
.legal__body {
  max-width: 860px; padding: clamp(24px, 4vw, 52px); border-radius: 28px;
  background: linear-gradient(160deg, rgba(44, 21, 80, .7), rgba(26, 13, 44, .7)); border: 1px solid var(--line);
  font-size: 17px; line-height: 1.7; color: #ddd3ee;
}
.legal__body h2 { margin: 40px 0 10px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.03em; font-weight: 800; color: var(--ink); }
.legal__body h2:first-child { margin-top: 0; }
.legal__body h2 .n { color: var(--amber); margin-right: 10px; font-variant-numeric: tabular-nums; }
.legal__body h3 { margin: 22px 0 6px; font-size: 18px; color: var(--lilac); font-weight: 700; }
.legal__body p, .legal__body ul { margin: 0 0 12px; }
.legal__body ul { padding-left: 20px; }
.legal__body li { margin-bottom: 4px; }
.legal__body li::marker { color: var(--amber); }
.legal__body a { color: var(--lilac); text-decoration: underline; text-decoration-color: rgba(224, 207, 251, .35); text-underline-offset: 3px; transition: color .3s, text-decoration-color .3s; }
.legal__body a:hover { color: var(--amber); text-decoration-color: var(--amber); }
.legal__body address { font-style: normal; padding: 18px 20px; margin: 6px 0 16px; border-radius: 16px; background: rgba(224, 207, 251, .05); border-left: 3px solid var(--amber); }
.legal__body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.ph { background: rgba(255, 184, 77, .18); color: var(--amber); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.legal__note { font-size: 14px; color: var(--muted); }

/* ---------- 404 ---------- */
.nf__main { min-height: 100svh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 6px; padding: 40px 0; }
.nf__scene { position: relative; width: 260px; height: 200px; margin-bottom: 20px; }
.nf__light { position: absolute; left: 50%; top: 30%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3d4, var(--amber) 55%, var(--amber-2)); box-shadow: 0 0 40px 14px rgba(255, 184, 77, .45); animation: pulse 2.4s ease-in-out infinite; }
.nf__moth { position: absolute; left: 50%; top: 30%; width: 46px; fill: var(--lilac); filter: drop-shadow(0 0 8px rgba(224, 207, 251, .6)); offset-path: path("M 0 0 C 70 -40, 110 30, 40 60 C -30 90, -110 20, -60 -30 C -20 -70, 40 -50, 0 0"); offset-rotate: 0deg; animation: orbit 6s linear infinite, flap .15s ease-in-out infinite alternate; }
@keyframes orbit { to { offset-distance: 100%; } }
.nf__title { margin: 0; font-size: clamp(48px, 8vw, 110px); line-height: .9; letter-spacing: -.06em; font-weight: 900; }
.nf__text { color: var(--muted); max-width: 36ch; margin: 18px 0 30px; font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .nf__moth, .nf__light { animation: none; } }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
button.card__link { cursor: pointer; background: none; border: 0; padding: 0; }

/* ---------- Project detail panel ---------- */
.pm { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; color: var(--ink); overflow: hidden; }
.pm::backdrop { background: rgba(8, 4, 16, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pm[open] { display: grid; place-items: center; }
.pm__panel {
  --p-bg: #2b1a14; --p-ink: #fbe7d4; --p-muted: #e9c3a0; --p-accent: #f0b27a; --p-line: rgba(251, 231, 212, .16);
  position: relative; width: min(1180px, 100% - 32px); max-height: calc(100svh - 32px);
  display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; border-radius: 28px;
  background: var(--p-bg); color: var(--p-ink); box-shadow: 0 60px 160px -40px rgba(0, 0, 0, .8), 0 0 0 1px var(--p-line);
}
.pm__panel[data-theme="reys"] { --p-bg: #efe7d8; --p-ink: #1d1a17; --p-muted: #5d554c; --p-accent: #3b5b8c; --p-line: rgba(29, 26, 23, .14); }
.pm__media { position: relative; min-height: 0; overflow: hidden; background: rgba(0, 0, 0, .15); }
.pm__media-inner { height: 100%; display: grid; grid-template-rows: 1fr auto; }
.pm__cover { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.pm__thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--p-bg); }
.pm__thumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; transition: transform .6s var(--ease); }
.pm__thumbs img:hover { transform: scale(1.03); }
.pm__paper { height: 100%; min-height: 360px; background: #f6f1e6; color: #1d1a17; padding: 7% 9%; display: flex; flex-direction: column; }
.pm__paper .paper-title { margin-top: 8%; font-size: clamp(54px, 6.4vw, 104px); }
.paper-cols { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8%; border-top: 1.5px solid #1d1a17; padding-top: 16px; }
.paper-cols i { background: repeating-linear-gradient(180deg, rgba(29, 26, 23, .22) 0 3px, transparent 3px 12px); border-radius: 2px; }
.pm__content { overflow-y: auto; overscroll-behavior: contain; padding: clamp(28px, 4vw, 56px); }
.pm__eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--p-accent); }
.pm__eyebrow span { padding: 4px 10px; border-radius: 999px; border: 1.5px solid currentColor; letter-spacing: .1em; }
.pm__title { margin: 0; font-size: clamp(48px, 6vw, 86px); line-height: .9; letter-spacing: -.055em; font-weight: 900; }
.pm__lead { margin: 18px 0 20px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.4; font-weight: 600; }
.pm__text > p { color: var(--p-muted); }
.pm__text > p.pm__lead { color: var(--p-ink); }
.pm__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 26px 0 30px; border-radius: 16px; overflow: hidden; background: var(--p-line); border: 1px solid var(--p-line); }
.pm__facts div { padding: 14px 16px; background: var(--p-bg); }
.pm__facts dt { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p-accent); }
.pm__facts dd { margin: 4px 0 0; font-weight: 600; }
.pm__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pm__panel[data-theme="reys"] .btn--amber { background: #1d1a17; color: #f6f1e6; box-shadow: none; }
.pm__panel[data-theme="reys"] .btn--amber::before { background: var(--p-accent); }
.pm__close {
  position: absolute; z-index: 3; right: 16px; top: 16px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(20, 11, 34, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .2);
  transition: transform .5s var(--ease), background .3s;
}
.pm__close:hover { transform: rotate(90deg); background: rgba(20, 11, 34, .85); }
.pm__close span { position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px; background: #fff; border-radius: 2px; transform: rotate(45deg); }
.pm__close span + span { transform: rotate(-45deg); }
.pm-open { overflow: hidden; }
@media (max-width: 860px) {
  .pm__panel { grid-template-columns: 1fr; grid-template-rows: auto 1fr; width: 100%; max-height: 100svh; height: 100svh; border-radius: 0; }
  .pm__media { max-height: 38svh; }
  .pm__cover { min-height: 0; max-height: 38svh; }
  .pm__thumbs { display: none; }
  .pm__paper { min-height: 0; max-height: 38svh; }
  .pm__paper .paper-cols { display: none; }
  .pm__paper .paper-top { padding-right: 58px; }
  .pm__facts { grid-template-columns: 1fr; }
}

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

/* If scripts never arrive, don't trap the visitor behind the loader */
.loader { animation: loader-failsafe .6s 7s forwards; }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
body.is-loading { animation: unlock 0s 7.2s forwards; }
@keyframes unlock { to { overflow: visible; } }

@media (max-width: 900px) {
  .js:not(.reduced) .step:not(.is-active) p { display: none; }
}

/* ---------- Initial states for JS-driven reveals ---------- */
.js .reveal-up { opacity: 0; transform: translateY(30px); }
.reduced .reveal-up { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  .grain, .marquee__track, .ring--2, .ring--3, .stage__halo, .wz-word, .wz-snow, .about__mark img, .moth svg { animation: none !important; }
}
