/* ============================================================
   NEW NEST — studio site
   Palette drawn from the games: warm near-black, cream ink,
   jackpot gold, logo blue, enemy purple.
   ============================================================ */

/* Self-hosted fonts (OFL). VT323 is the game's own UI font. */
@font-face {
  font-family: "VT323";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/vt323.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/archivo.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/bricolage.woff2") format("woff2");
}

:root {
  --bg:        #0f0e0c;
  --bg-2:      #17140f;
  --bg-3:      #1e1a14;
  --line:      #2c2720;
  --cream:     #f2ecdc;
  --muted:     #a79d88;
  --faint:     #978d78;
  --gold:      #f5c965;
  --gold-dim:  #b99544;
  --blue:      #8a9df0;
  --purple:    #c95ad8;
  --red:       #e06a5a;

  --font-display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --font-body:    "Archivo", system-ui, -apple-system, sans-serif;
  --font-pixel:   "VT323", "Courier New", monospace;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --header-h: 72px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { padding: 0; list-style: none; }
::selection { background: var(--gold); color: #17140f; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  padding: 10px 18px;
  background: var(--gold); color: #17140f;
  font-family: var(--font-pixel); font-size: 18px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: rgba(15, 14, 12, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 40px; height: 40px;
  image-rendering: pixelated;
}
.brand-word {
  font-family: var(--font-pixel);
  font-size: 26px;
  letter-spacing: .06em;
  color: var(--cream);
  padding-top: 3px;
}
.site-nav {
  display: flex; gap: 26px;
  margin-left: auto;
}
.nav-link {
  font-family: var(--font-pixel);
  font-size: 21px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 2px;
  position: relative;
  transition: color .2s;
}
.nav-link::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--gold);
  transition: right .25s var(--ease-out);
}
.nav-link:hover { color: var(--cream); }
.nav-link:hover::after,
.nav-link.is-active::after { right: 0; }
.nav-link.is-active { color: var(--gold); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  flex-direction: column; justify-content: center; gap: 6px;
}
.menu-bar {
  display: block; height: 2px; width: 100%;
  background: var(--cream);
  transition: transform .25s var(--ease-out), opacity .2s;
}
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 14, 12, .97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
}
/* the class display:flex above would otherwise override the hidden attribute,
   leaving an invisible full-screen layer that swallows clicks */
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.mobile-link {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 9vw, 52px);
  text-decoration: none;
  color: var(--cream);
  padding: 8px 20px;
}
.mobile-link:hover { color: var(--gold); }
.mobile-cta {
  font-family: var(--font-pixel); font-weight: 400;
  font-size: 24px; color: var(--gold);
  margin-top: 18px;
}

/* ============================================================
   BUTTONS / LINKS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-pixel);
  font-size: 22px; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none;
  padding: 12px 26px;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .2s, color .2s;
}
.btn-primary {
  background: var(--gold); color: #17140f;
  box-shadow: 5px 5px 0 rgba(245, 201, 101, .22);
  clip-path: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, 100% 0,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px),
    calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px),
    calc(100% - 6px) 100%, 0 100%);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(245, 201, 101, .28); }
.btn-primary:active { transform: translate(0, 0); box-shadow: 3px 3px 0 rgba(245, 201, 101, .3); }
.btn-ghost {
  color: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.btn-nav {
  padding: 8px 18px; font-size: 19px;
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
  white-space: nowrap;
}
.btn-nav:hover { background: var(--gold); color: #17140f; box-shadow: inset 0 0 0 1px var(--gold); }

.text-link {
  font-family: var(--font-pixel);
  font-size: 22px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.link-tag {
  font-size: 15px; color: var(--faint);
  border: 1px dashed var(--faint);
  padding: 2px 8px;
}
.is-placeholder { cursor: default; }
.is-placeholder:hover { text-decoration: none; }

/* ============================================================
   SHARED SECTION CHROME
   ============================================================ */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(84px, 12vh, 140px) var(--gutter);
}
.section-head { margin-bottom: clamp(40px, 6vh, 72px); }
.eyebrow {
  font-family: var(--font-pixel);
  font-size: 20px; letter-spacing: .14em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: .95;
  letter-spacing: -.01em;
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}

/* ============================================================
   HERO
   ============================================================ */
section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-noise {
  position: absolute; inset: 0; pointer-events: none;
  /* 2px checker dither, very faint */
  background:
    repeating-conic-gradient(rgba(242,236,220,.028) 0% 25%, transparent 0% 50%);
  background-size: 4px 4px;
  mask-image: radial-gradient(120% 90% at 70% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 40%, black 30%, transparent 75%);
}
.hero::after {
  /* faint pixel-art band along the bottom edge */
  content: "";
  position: absolute; inset: auto 0 0 0; height: 220px;
  background: url("../assets/esd-band.webp") center 30% / cover no-repeat;
  opacity: .10;
  filter: saturate(.7) brightness(.75);
  mask-image: linear-gradient(to top, black, transparent);
  -webkit-mask-image: linear-gradient(to top, black, transparent);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--wrap);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--header-h) + 40px) var(--gutter) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(52px, 7.6vw, 108px);
  line-height: .92;
  letter-spacing: -.02em;
  margin: 18px 0 26px;
}
.hero-title em {
  font-style: normal;
  color: var(--gold);
}
.hero-sub {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 44ch;
  margin-bottom: 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-meta {
  font-family: var(--font-pixel);
  font-size: 19px; letter-spacing: .1em;
  color: var(--faint);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.hero-meta i { font-style: normal; color: var(--line); }
.hero-meta-sep { color: var(--line); }

/* dealt-cards composition */
.hero-visual {
  position: relative;
  height: clamp(400px, 58vh, 560px);
}
.deal-card {
  position: absolute;
  width: min(46%, 240px);
  aspect-ratio: 642 / 1389;
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: 12px 14px 0 rgba(0, 0, 0, .45);
  overflow: hidden;
  transition: transform .5s var(--ease-out);
}
.deal-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.deal-a { left: 0;   top: 10%; transform: rotate(-8deg);  z-index: 1; }
.deal-b { left: 31%; top: 0;   transform: rotate(2.5deg); z-index: 3; width: min(50%, 264px); }
.deal-c { right: 0;  top: 16%; transform: rotate(8deg);   z-index: 2; }
.hero-visual:hover .deal-a { transform: rotate(-9deg) translateY(-6px); }
.hero-visual:hover .deal-b { transform: rotate(1deg) translateY(-10px); }
.hero-visual:hover .deal-c { transform: rotate(10deg) translateY(-4px); }
.hero-nest {
  position: absolute;
  left: 50%; bottom: -4%;
  transform: translateX(-50%);
  width: 180px;
  image-rendering: pixelated;
  z-index: 4;
  filter: drop-shadow(6px 8px 0 rgba(0,0,0,.4));
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; z-index: 2;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-pixel); font-size: 16px; letter-spacing: .3em;
  color: var(--faint); text-decoration: none;
  transition: color .2s;
}
.scroll-cue:hover { color: var(--gold); }
.scroll-cue svg { animation: cue-bob 1.8s ease-in-out infinite; }
@keyframes cue-bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(5px);} }

/* ============================================================
   PROJECTS
   ============================================================ */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
  padding: clamp(48px, 7vh, 88px) 0;
  border-top: 1px solid var(--line);
}
.project-index {
  font-family: var(--font-pixel);
  font-size: 18px; letter-spacing: .2em;
  color: var(--faint);
  margin-bottom: 8px;
}
.project-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: -.01em;
  margin-bottom: 20px;
}
.tag-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 26px;
}
.tag-list li {
  font-family: var(--font-pixel);
  font-size: 17px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 12px 2px;
}
.project-copy p { color: var(--muted); margin-bottom: 16px; max-width: 52ch; }
.project-copy p em { color: var(--cream); font-style: normal; }
.fact-list {
  margin: 26px 0 8px;
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px 24px;
}
.fact-list dt {
  font-family: var(--font-pixel); font-size: 15px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
}
.fact-list dd {
  font-size: 15.5px; color: var(--cream);
}
.project-links { margin-top: 18px; }

/* store buttons */
.store-row {
  margin-top: 26px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.store-label {
  font-family: var(--font-pixel); font-size: 17px;
  letter-spacing: .18em; color: var(--faint);
}
.store-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--cream);
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), border-color .2s, color .2s;
}
.store-btn:hover {
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 rgba(0,0,0,.5);
  border-color: var(--gold-dim);
  color: var(--gold);
}
.store-btn:active { transform: translate(0,0); box-shadow: 2px 2px 0 rgba(0,0,0,.5); }
.store-btn svg { flex: none; }
.store-text {
  display: flex; flex-direction: column; line-height: 1;
  font-family: var(--font-pixel);
  font-size: 21px; letter-spacing: .04em;
}
.store-text small {
  font-size: 12px; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  margin-bottom: 3px;
}
.store-btn:hover .store-text small { color: var(--gold-dim); }

/* --- ESD collage --- */
.esd-collage {
  position: relative;
  min-height: 540px;
}
.esd-shot {
  position: absolute;
  aspect-ratio: 642 / 1389;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 12px 14px 0 rgba(0,0,0,.45);
  transition: transform .5s var(--ease-out);
}
.esd-shot img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.esd-shot-main { width: 56%; left: 0; top: 0; z-index: 2; }
.esd-shot-b    { width: 38%; right: 6%; top: 10%; z-index: 3; transform: rotate(4deg); }
.esd-shot-c    { width: 30%; right: 0; bottom: 0; z-index: 1; transform: rotate(-5deg); }
.esd-collage:hover .esd-shot-main { transform: translateY(-6px); }
.esd-collage:hover .esd-shot-b { transform: rotate(6deg) translateY(-8px); }
.esd-collage:hover .esd-shot-c { transform: rotate(-3deg) translateY(4px); }

/* --- experiments row --- */
.experiments {
  margin-top: clamp(40px, 6vh, 64px);
  padding: 26px 0 0;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: baseline;
}
.experiments-label {
  font-family: var(--font-pixel); font-size: 17px;
  letter-spacing: .2em; color: var(--faint);
}
.experiments-text { color: var(--muted); max-width: 60ch; }

/* ============================================================
   ABOUT
   ============================================================ */
.about { border-top: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 80px);
}
.about .section-head { margin-bottom: 0; }
.about-copy .lede {
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.55;
  color: var(--cream);
  margin-bottom: 20px;
}
.about-copy p:not(.lede) { color: var(--muted); margin-bottom: 16px; }
.principles {
  margin-top: 34px;
  display: flex; flex-wrap: wrap; gap: 14px 40px;
}
.principles li {
  font-family: var(--font-pixel); font-size: 21px;
  letter-spacing: .06em; color: var(--cream);
}
.principle-num { color: var(--gold); margin-right: 6px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { border-top: 1px solid var(--line); }
.contact-lede { color: var(--muted); max-width: 52ch; margin-bottom: 34px; }
.contact-box {
  display: inline-flex; flex-direction: column; gap: 10px;
  padding: 26px 30px;
  border: 1px dashed var(--faint);
  position: relative;
}
.contact-label {
  font-family: var(--font-pixel); font-size: 16px;
  letter-spacing: .22em; color: var(--faint);
}
.contact-mail {
  font-family: var(--font-pixel);
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: .04em;
  color: var(--cream); text-decoration: none;
}
.contact-mail:hover { color: var(--gold); }
.contact-alt {
  margin-top: 26px;
  font-size: 15px; color: var(--faint);
}
.contact-alt + .contact-alt { margin-top: 8px; }
.inline-link {
  color: var(--muted);
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--gold); }

/* ============================================================
   SUPPORT PAGE
   ============================================================ */
.support { padding-top: calc(var(--header-h) + clamp(64px, 9vh, 110px)); }
.support-lede {
  font-size: clamp(19px, 1.9vw, 23px);
  color: var(--cream);
  max-width: 56ch;
  margin-bottom: 34px;
}
.support-tips { margin-top: 46px; max-width: 60ch; }
.support-h2 {
  font-family: var(--font-pixel); font-weight: 400;
  font-size: 26px; letter-spacing: .1em;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: 12px;
}
.support-tips > p { color: var(--muted); margin-bottom: 14px; }
.tip-list li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--cream); font-size: 16px;
}
.tip-num {
  font-family: var(--font-pixel); font-size: 18px;
  color: var(--gold); flex: none;
}
.support-meta { margin-top: 40px; color: var(--muted); max-width: 60ch; }
.support-back { margin-top: 20px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-pixel); font-size: 24px;
  letter-spacing: .08em; color: var(--cream);
}
.footer-brand img { image-rendering: pixelated; }
.footer-nav { display: flex; gap: 22px; margin-left: auto; }
.footer-nav a {
  font-family: var(--font-pixel); font-size: 18px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.footer-nav a:hover { color: var(--gold); }
.footer-note {
  width: 100%;
  font-size: 14px; color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* damage-number easter egg */
.dmg-float {
  position: fixed; z-index: 300;
  font-family: var(--font-pixel); font-size: 30px;
  color: var(--gold); pointer-events: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
  animation: dmg-rise .9s var(--ease-out) forwards;
}
@keyframes dmg-rise {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-56px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { height: clamp(340px, 52vw, 460px); max-width: 560px; }
  .project { grid-template-columns: 1fr; }
  .esd-collage { min-height: min(74vw, 560px); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-nav, .btn-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-inner { gap: 16px; }

  .hero { min-height: auto; }
  .hero-inner { padding-top: calc(var(--header-h) + 32px); }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  .esd-collage { min-height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .esd-shot { position: static; transform: none; width: 100%; }
  .esd-shot-main { grid-column: 1 / -1; }
  .esd-collage:hover .esd-shot { transform: none; }

  .experiments { grid-template-columns: 1fr; gap: 8px; }
  .fact-list { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { margin-left: 0; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-cue svg { animation: none; }
}
