@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo.woff2") format("woff2-variations"), url("fonts/archivo.woff2") format("woff2");
}

:root {
  --ink: #0e1020;
  --surface: #161a32;
  --surface-2: #1d2240;
  --line: #2b3157;
  --text: #eceefb;
  --muted: #a3a9cc;
  --sky: #7fd4ff;
  --pink: #ff8fc7;
  --lavender: #b9a6ff;
  --radius: 18px;
  --wrap: 1180px;
  --gutter: max(20px, calc((100vw - var(--wrap)) / 2));
  --font: "Archivo", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: #b6e8ff; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

/* Wide, heavy cut of Archivo for display type */
h1, h2, h3, h4, .brand, .lead, .mail, .tab-title, .next-title, .feature-title {
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--text); color: var(--ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(14,16,32,.85), rgba(14,16,32,0));
}
.brand { font-size: 1.05rem; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; gap: 26px; }
.site-header nav a { color: var(--text); opacity: .8; text-decoration: none; font-weight: 500; }
.site-header nav a:hover { opacity: 1; color: var(--text); }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sky); color: #08142a; }
.btn-primary:hover { background: #a9e3ff; color: #08142a; }
.btn-ghost { border: 1.5px solid rgba(236,238,251,.35); color: var(--text); background: rgba(14,16,32,.45); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* ---------- Home hero: level select ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--ink);
}
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1s ease, transform 8s ease-out;
}
.slide.is-active { opacity: 1; transform: scale(1); }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,16,32,.94) 0%, rgba(14,16,32,.72) 38%, rgba(14,16,32,.12) 72%),
    linear-gradient(0deg, rgba(14,16,32,1) 0%, rgba(14,16,32,.6) 22%, rgba(14,16,32,0) 45%);
}
.hero-inner { position: relative; padding: 120px var(--gutter) 40px; }
.hero-copy { max-width: 620px; margin-bottom: 56px; }
h1 { font-size: clamp(2.6rem, 7.4vw, 5.8rem); line-height: .95; margin: 0 0 20px; letter-spacing: -0.03em; }
.hero-role { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 600; color: var(--sky); margin: 0 0 12px; }
.hero-pitch { color: #cfd3ec; max-width: 48ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.level-select ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
  border-top: 1px solid rgba(236,238,251,.18);
}
.tab {
  position: relative; display: block; height: 100%;
  padding: 18px 18px 20px 0; text-decoration: none; color: var(--muted);
  transition: color .2s ease;
}
.tab-title { display: block; font-size: 1.05rem; line-height: 1.2; color: inherit; }
.tab-tag { display: block; font-size: .9rem; margin-top: 4px; opacity: .8; }
.tab-bar {
  position: absolute; top: -1px; left: 0; height: 3px; width: 0;
  background: var(--sky);
}
.tab:hover, .tab:focus-visible, .tab.is-active { color: var(--text); }
.tab.is-active .tab-bar { width: 100%; transition: width var(--dwell, 6s) linear; }
.hero.is-paused .tab.is-active .tab-bar,
.hero.no-auto .tab.is-active .tab-bar { transition: none; width: 100%; }

/* Small source images: soften so upscaling reads as a backdrop, not blur */
.project-hero-art.is-lowres { filter: blur(5px) saturate(1.15); transform: scale(1.06); }
.slide.is-lowres { filter: blur(5px) saturate(1.15); }
.slide.is-lowres.is-active { transform: scale(1.06); }

/* Pixel art stays crisp when scaled */
.is-pixel, .is-pixel img, .lightbox.is-pixel img { image-rendering: pixelated; }

/* Bubble art placeholder for Battle Bubbles! */
.b {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.85) 0 8%, rgba(255,255,255,.18) 30%, rgba(255,255,255,.08) 70%);
  border: 1.5px solid rgba(255,255,255,.55);
}
.b1 { width: 22%; aspect-ratio: 1; top: 14%; left: 48%; }
.b2 { width: 11%; aspect-ratio: 1; top: 18%; right: 10%; }
.b3 { width: 30%; aspect-ratio: 1; bottom: 8%; right: 6%; }
.b4 { width: 8%; aspect-ratio: 1; bottom: 32%; left: 62%; }

/* ---------- Sections ---------- */
.section { max-width: calc(var(--wrap) + 40px); margin: 0 auto; padding: 96px 20px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.05; margin: 0 0 40px; }
h3 { margin: 0; }
.subhead { font-size: 1.4rem; margin: 72px 0 24px; }
.subhead.small { font-size: 1rem; font-stretch: 100%; font-weight: 600; margin: 0 0 12px; color: var(--muted); letter-spacing: 0; }
.subhead.small:not(:first-child) { margin-top: 32px; }
.meta { color: var(--muted); font-size: .95rem; margin: 6px 0 14px; }

/* Whole-card links */
.stretch { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.stretch:focus-visible { outline: none; }
.feature:has(.stretch:focus-visible), .card:has(.stretch:focus-visible) { outline: 3px solid var(--pink); outline-offset: 4px; }

/* Featured project */
.feature {
  position: relative;
  display: grid; grid-template-columns: 1fr 1.05fr;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 26px; overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.feature:hover { border-color: var(--lavender); transform: translateY(-3px); }
.feature-art { position: relative; min-height: 380px; overflow: hidden; }
.feature-body { padding: 40px; }
.feature-body h3 { font-size: 1.9rem; }
.feature-points { color: var(--muted); font-size: 1rem; border-left: 3px solid var(--lavender); padding-left: 14px; margin: 18px 0 26px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid:has(> .card:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--lavender); transform: translateY(-3px); }
.card-art { aspect-ratio: 16 / 10; }
.card-body { padding: 20px 22px 24px; }
.card h4 { font-size: 1.2rem; margin: 0; }
.card-body p:last-child { margin: 0; color: var(--muted); font-size: 1rem; }
.more { margin-top: 28px; color: var(--muted); }

/* About */
.about, .contact { border-top: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 56px; align-items: start; }
.portrait { margin: 0; }
.portrait img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 22px; border: 1px solid var(--line);
}
.about-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 36px; }
.about-lists .subhead.small { margin-top: 0; }
.lead { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; line-height: 1.3; margin: 0 0 20px; }
.about p { max-width: 62ch; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .95rem; }

/* Contact */
.contact .lead { max-width: 30ch; }
.mail { display: inline-block; font-size: clamp(1.2rem, 3.6vw, 2.2rem); color: var(--sky); margin: 6px 0 28px; overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.links a { color: var(--text); font-weight: 500; }
.links a:hover { color: var(--sky); }

.site-footer {
  max-width: var(--wrap); margin: 0 auto; padding: 32px 0 48px;
  width: calc(100% - 40px);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }

/* ---------- Project pages ---------- */
.project-hero { position: relative; min-height: min(78svh, 720px); display: flex; align-items: flex-end; overflow: hidden; }
.project-hero-art { position: absolute; inset: 0; }
.project-hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(14,16,32,1) 0%, rgba(14,16,32,.7) 30%, rgba(14,16,32,.05) 70%);
}
.project-hero-copy { position: relative; width: 100%; padding: 120px var(--gutter) 36px; }
.back { display: inline-block; color: var(--text); opacity: .85; font-weight: 500; margin-bottom: 14px; }
.back:hover { opacity: 1; color: var(--text); }
.project-hero h1 { font-size: clamp(2.4rem, 7vw, 5rem); margin-bottom: 10px; }
.project-kind { margin: 0; color: #cfd3ec; font-size: 1.1rem; }

.project-body { padding-top: 40px; display: grid; grid-template-columns: 280px 1fr; gap: 24px 64px; }
.facts { margin: 0; display: grid; gap: 18px; align-content: start; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.project-text { max-width: 66ch; }
.h-sm { font-size: 1.35rem; margin: 0 0 14px; }
.project-text .h-sm:not(:first-child) { margin-top: 44px; }
.notes { margin: 0; display: grid; gap: 20px; }
.notes > div { border-left: 3px solid var(--lavender); padding-left: 16px; }
.notes dt { font-weight: 700; margin-bottom: 4px; }
.notes dd { margin: 0; color: #c4c8e4; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.gallery-wrap { grid-column: 1 / -1; margin-top: 40px; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.gallery:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .gallery:has(> li:nth-child(4):last-child) { grid-template-columns: 1fr; } }
.shot {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: var(--surface); cursor: zoom-in;
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s ease; }
.shot:hover img { transform: scale(1.03); }

.lightbox {
  width: fit-content; max-width: 94vw; max-height: 92vh; padding: 0; border: 0; border-radius: 14px;
  background: transparent; overflow: visible;
}
.lightbox::backdrop { background: rgba(8,9,20,.88); }
.lightbox img { width: auto; max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 14px; }
.lightbox-close {
  position: absolute; top: -46px; right: 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; font: inherit; font-weight: 600; cursor: pointer;
}

.next { padding-top: 0; }
.next-card {
  display: block; padding: 32px 36px; border-radius: 22px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: border-color .2s ease;
}
.next-card:hover { border-color: var(--lavender); color: var(--text); }
.next-label { display: block; color: var(--muted); font-size: .95rem; }
.next-title { display: block; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; margin: 4px 0; }
.next-tag { color: var(--sky); font-weight: 600; }

/* ---------- Page not found ---------- */
.notfound { padding-top: 160px; min-height: 80svh; }
.notfound h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); }
.notfound .lead { max-width: 34ch; color: #cfd3ec; }
.notfound .h-sm { margin-top: 64px; }
.nf-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 760px; }
.nf-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.nf-list a:hover { color: var(--sky); }
.nf-title { font-stretch: 125%; font-weight: 800; font-size: 1.1rem; }
.nf-tag { color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature-art { min-height: 240px; }
  .feature-body { padding: 28px 22px; }
  .grid, .grid:has(> .card:nth-child(4):last-child) { grid-template-columns: 1fr; }
  .about-lists { grid-template-columns: 1fr; gap: 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .portrait { max-width: 320px; }
  .section { padding: 72px 20px; }
  .level-select ul { grid-template-columns: 1fr 1fr; }
  .project-body { grid-template-columns: 1fr; padding-top: 24px; }
  .facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 520px) {
  .site-header nav { gap: 16px; }
  .brand { font-size: .95rem; }
  .hero-copy { margin-bottom: 36px; }
  .hero-shade {
    background: linear-gradient(0deg, rgba(14,16,32,1) 0%, rgba(14,16,32,.82) 45%, rgba(14,16,32,.35) 100%);
  }
  .tab { padding-right: 10px; }
  .tab-title { font-size: .95rem; }
  .tab-tag { display: none; }
  .tab { padding-top: 14px; padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide { transition: opacity .2s linear; transform: none; }
  .slide.is-active { transform: none; }
  .btn, .card, .feature, .shot img { transition: none; }
  .tab.is-active .tab-bar { transition: none; }
}
