/* ATPulse Codes — cinematic night */

/* ---------- Fonts (self-hosted, latin + latin-ext) ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-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: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-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: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-tight-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: "Inter Tight";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-tight-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-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: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0E0D0B;
  --surface: #15130F;
  --surface-2: #1C1A15;
  --text: #EFE9DF;
  --text-dim: #CFC8BC;
  --muted: #A39C90;
  --accent: #E3A447;
  --accent-ink: #1A1206;
  --line: rgba(239, 233, 223, 0.11);
  --line-strong: rgba(239, 233, 223, 0.2);
  --tint: var(--accent);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --fs-display: clamp(3.1rem, 1.7rem + 5.2vw, 7rem);
  --fs-h2: clamp(2.75rem, 1.8rem + 3.8vw, 5.25rem);
  --fs-h3: clamp(2.5rem, 1.5rem + 3.6vw, 4.75rem);
  --fs-lead: clamp(1.125rem, 1.02rem + 0.4vw, 1.3rem);

  --gutter: clamp(16px, 4vw, 48px);
  --wrap: min(1240px, 100% - 2 * var(--gutter));
  --header-h: 68px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-tint="seljuk"] { --tint: #6CC4B6; }
[data-tint="hegemonya"] { --tint: #D2AA62; }
[data-tint="creature-customs"] { --tint: #F2905F; }
[data-tint="neon-survivor"] { --tint: #45E2F2; }
[data-tint="netzero"] { --tint: #3DDBA0; }
[data-tint="bioevren"] { --tint: #8EDB7E; }
[data-tint="kouorman"] { --tint: #D8B77E; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: var(--wrap); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-weight: 550; font-size: 0.975rem; letter-spacing: 0.005em;
  text-decoration: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { border-color: var(--text); background: rgba(239, 233, 223, 0.06); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #EDB663; border-color: #EDB663; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, .site-header.is-open { background: rgba(14, 13, 11, 0.9); border-bottom-color: var(--line); }
@supports (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled { background: rgba(14, 13, 11, 0.78); backdrop-filter: blur(14px) saturate(1.2); }
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 32px; height: 32px; }
.brand__name { font-weight: 650; letter-spacing: 0.01em; font-size: 1.05rem; white-space: nowrap; }
.brand__name span { color: var(--muted); font-weight: 450; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--text-dim); font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover { color: var(--text); background: rgba(239, 233, 223, 0.06); }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; min-width: 40px; height: 32px; border-radius: 999px;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.menu-toggle {
  display: none; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  align-items: center; justify-content: center;
}
.menu-toggle span, .menu-toggle span::before {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.25s;
}
.menu-toggle span::before { content: ""; position: absolute; top: 6px; }
.menu-toggle span { transform: translateY(-3px); }
.is-open .menu-toggle span { transform: translateY(0) rotate(45deg); }
.is-open .menu-toggle span::before { transform: translateY(-6px) rotate(-90deg); }

/* ---------- Hero: the worlds menu ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + clamp(40px, 8vh, 96px)) 0 clamp(40px, 7vh, 72px);
}
.hero-stage { position: absolute; inset: 0; z-index: -1; background: var(--bg); }
.hero-stage::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 13, 11, 0.94) 0%, rgba(14, 13, 11, 0.78) 34%, rgba(14, 13, 11, 0.3) 62%, rgba(14, 13, 11, 0.62) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(14, 13, 11, 0) 38%),
    linear-gradient(180deg, rgba(14, 13, 11, 0.7) 0%, rgba(14, 13, 11, 0) 22%);
}
.hero-art { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero-art.is-active { opacity: 1; }
.hero-art > img {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%;
  transform: scale(1.07); transition: transform 9s ease-out;
}
.hero-art.is-active > img { transform: scale(1); }
.hero-art--neon { background: radial-gradient(55% 70% at 70% 52%, rgba(69, 226, 242, 0.2), rgba(69, 226, 242, 0) 62%), #07111A; }
.hero-art--neon > img { object-fit: contain; object-position: 78% 50%; padding: 12vh 4vw 12vh 34vw; }
.hero-art--site { background: radial-gradient(60% 70% at 78% 55%, color-mix(in srgb, var(--tint) 16%, transparent), transparent 70%), var(--bg); }
.hero-art--site > img {
  position: absolute; top: 14%; right: 0; width: 62%; height: 86%; object-fit: cover; object-position: 0 0; opacity: 0.4; filter: blur(1.5px);
  border-top-left-radius: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(180deg, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(180deg, transparent 0%, #000 22%);
  mask-composite: intersect;
}
.hero-art figcaption {
  position: absolute; left: var(--gutter); bottom: 20px; font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); opacity: 0.8;
}

.hero__inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr); gap: clamp(32px, 5vw, 96px); align-items: end; }
.hero__eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(18px, 3vh, 32px); color: var(--text-dim); }
.hero__eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.hero__title { font-family: var(--serif); font-size: var(--fs-display); line-height: 0.92; letter-spacing: -0.015em; }
.hero__title em { color: var(--accent); }
.hero__lead { margin-top: clamp(20px, 3vh, 32px); max-width: 34rem; font-size: var(--fs-lead); color: var(--text-dim); }
.hero__actions { margin-top: clamp(24px, 4vh, 40px); display: flex; flex-wrap: wrap; gap: 12px; }

.worlds {
  background: rgba(14, 13, 11, 0.64); border: 1px solid var(--line); border-radius: 20px;
  padding: 14px 8px 10px;
}
@supports (backdrop-filter: blur(1px)) { .worlds { background: rgba(14, 13, 11, 0.5); backdrop-filter: blur(16px); } }
.worlds__group + .worlds__group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.worlds__label { padding: 6px 16px 4px; }
.worlds ul { list-style: none; }
.world {
  position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: baseline;
  column-gap: 6px; padding: 8px 14px 8px 10px; border-radius: 12px;
  color: var(--text-dim); text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.world__name { font-family: var(--serif); font-size: clamp(1.3rem, 1.02rem + 0.75vw, 1.75rem); line-height: 1.1; }
.world__meta { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); text-align: right; white-space: nowrap; }
.world__pulse { width: 22px; height: 14px; align-self: center; color: var(--tint); opacity: 0; transition: opacity 0.25s; }
.world__pulse path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.world:hover, .world.is-active { color: var(--text); background: rgba(239, 233, 223, 0.055); }
.world.is-active .world__pulse { opacity: 1; }
.world.is-active .world__pulse path { animation: trace 1.6s var(--ease) forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(96px, 13vw, 176px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 24px 64px; align-items: end; }
.section-head .kicker { grid-column: 1 / -1; color: var(--accent); }
.section-title { font-family: var(--serif); font-size: var(--fs-h2); line-height: 0.98; letter-spacing: -0.01em; }
.section-title em { color: var(--accent); }
.section-lead { color: var(--text-dim); font-size: var(--fs-lead); max-width: 32rem; }
.section-head--wide .section-title { grid-column: 1 / -1; max-width: 20ch; }

/* ---------- Game showcases ---------- */
.project { margin-top: clamp(80px, 11vw, 150px); }
.project-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(460px, 76vh, 780px); display: flex; align-items: flex-end;
  padding-block: clamp(32px, 6vw, 72px);
}
.project-hero > img, .project-hero > picture img {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover;
}
.project-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(0deg, var(--bg) 0%, rgba(14, 13, 11, 0.55) 30%, rgba(14, 13, 11, 0) 62%),
    linear-gradient(90deg, rgba(14, 13, 11, 0.72) 0%, rgba(14, 13, 11, 0) 60%);
}
.project-hero__text { display: grid; gap: 14px; justify-items: start; }
.project-title { font-family: var(--serif); font-size: var(--fs-h3); line-height: 0.95; letter-spacing: -0.01em; max-width: 14ch; }
.project-title em { color: var(--tint); }
.project-logo { width: min(520px, 78vw); height: auto; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }

.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(14, 13, 11, 0.55);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tint); box-shadow: 0 0 0 0 var(--tint); }
.status--live::before { animation: beat 2.4s infinite; }
.status--dev::before { background: transparent; border: 1.5px solid var(--tint); }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tint) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--tint) 0%, transparent); }
}

.project-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, 1fr); gap: clamp(40px, 6vw, 96px); margin-top: clamp(28px, 4vw, 48px); }
.project-lead { font-size: var(--fs-lead); color: var(--text); max-width: 40rem; }
.features { list-style: none; margin-top: 32px; border-top: 1px solid var(--line); }
.features li {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px;
  padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--text-dim);
}
.features li::before { content: ""; width: 12px; height: 1.5px; margin-top: 0.8em; background: var(--tint); }
.features strong { color: var(--text); font-weight: 600; }
.project-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.dossier { align-self: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 26px 26px 22px; }
.dossier dl { display: grid; gap: 0; }
.dossier dl > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dossier dl > div:first-child { padding-top: 0; }
.dossier dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 0.25em; }
.dossier dd { margin: 0; font-size: 0.95rem; }
.stats { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; margin-top: 22px; }
.stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 1.8rem + 1vw, 2.75rem); line-height: 1; color: var(--text); }
.stats span { display: block; margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

.gallery { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gallery--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shot {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface); aspect-ratio: 16 / 9; cursor: zoom-in;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), opacity 0.3s; }
.shot:hover img { transform: scale(1.04); }
.shot figcaption, .shot__cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; text-align: left;
  font-size: 0.8rem; color: var(--text); background: linear-gradient(0deg, rgba(14, 13, 11, 0.85), rgba(14, 13, 11, 0));
}

/* HEGEMONYA world band */
.world-band { position: relative; margin-top: clamp(36px, 5vw, 56px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0B1620; }
.world-band img { width: 100%; height: clamp(160px, 22vw, 300px); object-fit: cover; object-position: 50% 42%; opacity: 0.9; }
.world-band p {
  position: absolute; left: 16px; bottom: 14px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; background: rgba(14, 13, 11, 0.78); padding: 7px 12px; border-radius: 999px;
}

/* Creature Customs specimens + visitors */
.specimens { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.specimen {
  position: relative; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: radial-gradient(80% 70% at 50% 40%, rgba(242, 144, 95, 0.1), rgba(242, 144, 95, 0) 70%), var(--surface);
}
.specimen img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45)); }
.visitors { margin-top: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.visitors img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 0; border-radius: 12px; border: 1px solid var(--line); background: #211C16; }
.caption-row { margin-top: 12px; color: var(--muted); font-size: 0.85rem; }

/* Neon Survivor header + download */
.project-hero--neon {
  background: radial-gradient(50% 70% at 74% 55%, rgba(69, 226, 242, 0.16), rgba(69, 226, 242, 0) 65%), #07111A;
}
.project-hero--neon > img.titan {
  inset: 8% 2% 10% auto; width: min(64%, 900px); height: auto; max-height: 84%; object-fit: contain; left: auto;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6));
}
.project-hero--neon::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(14, 13, 11, 0) 40%), linear-gradient(90deg, rgba(7, 17, 26, 0.9) 0%, rgba(7, 17, 26, 0) 55%); }

.phone-landscape {
  margin-top: clamp(36px, 5vw, 56px); border-radius: 30px; border: 1px solid var(--line-strong); padding: 10px;
  background: #050608; box-shadow: 0 40px 90px -40px rgba(69, 226, 242, 0.35);
}
.phone-landscape img { width: 100%; border-radius: 22px; aspect-ratio: 844 / 390; object-fit: cover; }

.download {
  margin-top: 32px; border: 1px solid color-mix(in srgb, var(--tint) 45%, transparent); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(69, 226, 242, 0.08), rgba(69, 226, 242, 0) 60%), var(--surface);
  padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 18px; align-items: center;
}
.download__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: rgba(69, 226, 242, 0.12); color: var(--tint); }
.download__icon svg { width: 26px; height: 26px; }
.download__title { font-weight: 600; }
.download__meta { font-size: 0.875rem; color: var(--muted); }
.download .btn--primary { background: var(--tint); border-color: var(--tint); color: #03161A; }
.download .btn--primary:hover { background: #7BEBF6; border-color: #7BEBF6; }
.download__note { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }

/* ---------- Web projects ---------- */
.site-card { margin-top: clamp(80px, 11vw, 140px); display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.site-card--flip .site-media { order: 2; }
.site-media { position: relative; padding: 0 9% 48px 0; }
.site-card--flip .site-media { padding: 0 0 48px 9%; }
.browser { border-radius: 14px; border: 1px solid var(--line-strong); background: #1A1813; overflow: hidden; box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.85); }
.browser__bar { height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(239, 233, 223, 0.16); }
.browser__url {
  margin-left: 10px; flex: 1; max-width: 300px; height: 22px; border-radius: 999px; background: rgba(239, 233, 223, 0.07);
  font-family: var(--mono); font-size: 0.68rem; color: var(--muted); display: flex; align-items: center; padding: 0 12px; overflow: hidden; white-space: nowrap;
}
.browser__viewport { position: relative; aspect-ratio: 16 / 10; overflow: hidden; container-type: size; background: #fff; }
.browser__viewport img { width: 100%; height: auto; transition: transform 7s cubic-bezier(0.45, 0, 0.55, 1); }
.site-media:hover .browser__viewport img, .site-media:focus-within .browser__viewport img { transform: translateY(calc(-100% + 100cqh)); }
.phone {
  position: absolute; right: 0; bottom: 0; width: 25%; border-radius: 26px; padding: 6px; background: #050505;
  border: 1px solid var(--line-strong); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.site-card--flip .phone { right: auto; left: 0; }
.phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: 50% 0; border-radius: 20px; }
.site-copy .kicker { color: var(--tint); display: flex; align-items: center; gap: 10px; }
.site-title { margin-top: 14px; font-family: var(--serif); font-size: clamp(2.4rem, 1.7rem + 2.6vw, 3.9rem); line-height: 0.98; }
.site-copy .project-lead { margin-top: 18px; color: var(--text-dim); }
.site-copy .features { margin-top: 24px; }
.site-copy .features li { padding: 11px 0; font-size: 0.975rem; }
.hint { margin-top: 12px; font-size: 0.78rem; color: var(--muted); font-family: var(--mono); letter-spacing: 0.04em; }
@media (hover: none) { .hint { display: none; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(110px, 14vw, 180px); border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 0.85rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
.site-footer img { width: 24px; height: 24px; }
.site-footer .brand { margin: 0; gap: 10px; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 7, 6, 0.94); color: var(--text);
}
.lightbox::backdrop { background: rgba(8, 7, 6, 0.9); }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox figure { margin: 0; display: grid; place-items: center; padding: 64px 72px 12px; min-height: 0; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox figcaption { text-align: center; padding: 8px 16px 24px; color: var(--text-dim); font-size: 0.9rem; }
.lightbox__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(14, 13, 11, 0.7); display: grid; place-items: center;
}
.lightbox__btn:hover { background: rgba(239, 233, 223, 0.1); }
.lightbox__btn svg { width: 20px; height: 20px; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .worlds { max-width: 640px; }
  .project-body { grid-template-columns: minmax(0, 1fr); }
  .site-card { grid-template-columns: minmax(0, 1fr); }
  .site-card--flip .site-media { order: 0; }
  .specimens { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header__inner { gap: 10px; }
  .lang button { min-width: 36px; height: 30px; }
  .menu-toggle { display: inline-flex; }
  .site-header.is-open .site-nav {
    display: flex; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .site-nav a { padding: 14px 4px; font-size: 1.1rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .site-header.is-open .site-nav a:last-child { border-bottom: 0; }
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .visitors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .download { grid-template-columns: auto minmax(0, 1fr); }
  .download .btn { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 560px) {
  :root { --header-h: 60px; }
  .hero { align-items: flex-end; }
  .hero-stage::after {
    background: linear-gradient(0deg, var(--bg) 0%, rgba(14, 13, 11, 0.86) 42%, rgba(14, 13, 11, 0.45) 75%, rgba(14, 13, 11, 0.7) 100%);
  }
  .hero-art figcaption { display: none; }
  .hero-art--site > img { inset: 0; width: 100%; height: 100%; opacity: 0.55; filter: blur(12px) saturate(1.3); -webkit-mask-image: none; mask-image: none; border-radius: 0; }
  .hero-art--neon > img { padding: 10vh 0 50vh 10vw; object-position: 50% 0; }
  .world { grid-template-columns: 22px minmax(0, 1fr); }
  .world__meta { grid-column: 2; text-align: left; }
  .project-hero { min-height: 72svh; }
  .project-hero--neon > img.titan { width: 96%; top: 6%; right: 2%; }
  .dossier dl > div { grid-template-columns: 6.25rem minmax(0, 1fr); }
  .specimens { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .gallery, .gallery--4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .gallery > :last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
  .shot figcaption { display: none; }
  .world-band p { font-size: 0.62rem; right: 16px; border-radius: 10px; }
  .site-media, .site-card--flip .site-media { padding: 0 12% 40px 0; }
  .site-card--flip .phone { left: auto; right: 0; }
  .phone { width: 30%; border-radius: 18px; padding: 4px; }
  .phone img { border-radius: 14px; }
  .lightbox figure { padding: 64px 8px 8px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 12px; transform: none; }
}

@media (max-width: 380px) {
  .site-header .brand__name span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-art > img { transform: none; }
  .world__pulse path { stroke-dashoffset: 0; }
}
