/* Noded Labs — shared studio style (used by all three sites).
   Per-page accent: set --accent (and optionally --accent-ink) on <body>. */

:root {
  --bg: #0e0e10;
  --bg-2: #16161a;
  --bg-3: #1f1f25;
  --line: #2b2b33;
  --text: #ecebe6;
  --muted: #a3a199;
  --accent: #e8e4d8;
  --accent-ink: #0e0e10;
  --radius: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.3rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3, .h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.eyebrow {
  font: 600 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem;
}
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 12px; }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 14, 16, .82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand:hover { color: var(--text); }
.nav { margin-left: auto; display: flex; gap: clamp(.9rem, 2.5vw, 1.8rem); }
.nav a { text-decoration: none; font-size: .95rem; color: var(--muted); padding: .4rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
body[data-site="main"] .nav a[data-nav="main"],
body[data-site="games"] .nav a[data-nav="games"],
body[data-site="tools"] .nav a[data-nav="tools"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 480px) {
  .brand span { display: none; }
  .nav { gap: .9rem; }
  .nav a { font-size: .9rem; }
}

.site-footer { border-top: 1px solid var(--line); margin-top: 6rem; padding: 2.5rem 0 3rem; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: .75rem 1.3rem;
  font: 700 .95rem/1 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); }
.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font: 600 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: .45rem .7rem; border-radius: 999px;
  background: rgba(14, 14, 16, .7); color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 46ch; }

/* ---------- Project cards ---------- */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.card {
  --accent: var(--card-accent, var(--text));
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); color: inherit; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-3); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.25rem; }
.card-body .genre { font: 600 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card-body p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- Typographic title cards (games without screenshots) ---------- */
.titlecard {
  --tc-bg: #111; --tc-fg: #fff; --tc-accent: var(--accent);
  position: relative; display: grid; place-items: center; text-align: center;
  width: 100%; height: 100%; min-height: 100%; padding: 6% 8%;
  background: var(--tc-bg); color: var(--tc-fg); overflow: hidden; isolation: isolate;
  container-type: inline-size;
}
.titlecard .tc-title { font-weight: 900; line-height: .95; letter-spacing: -.03em; font-size: clamp(1.6rem, 11cqi, 7.5rem); margin: 0; }
.titlecard .tc-sub { margin-top: .9em; font: 600 clamp(.6rem, 2.2cqi, 1rem)/1.3 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--tc-accent); }
.titlecard .tc-soon {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); white-space: nowrap;
  font: 600 clamp(.55rem, 1.8cqi, .85rem)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--tc-fg); opacity: .7; padding: .55em .9em; border: 1px solid currentColor; border-radius: 999px;
}
.titlecard > svg.tc-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

/* GainStage: stage magenta, speaker rings + beams */
.tc-gainstage { --tc-bg: radial-gradient(120% 90% at 50% 110%, #5a0d3f 0%, #1a0716 55%, #0b050a 100%); --tc-fg: #fff2fa; --tc-accent: #ff4fb3; }
.tc-gainstage .tc-title { text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 0 .35em rgba(255, 60, 170, .55); }
/* Humanity's Last Stand: deep space navy, flak cyan, wide spaced */
.tc-hls { --tc-bg: radial-gradient(90% 80% at 70% 20%, #13243d 0%, #070b14 60%, #030509 100%); --tc-fg: #e6f1ff; --tc-accent: #6fd3ff; }
.tc-hls .tc-title { text-transform: uppercase; font-weight: 300; letter-spacing: .14em; font-size: clamp(1.2rem, 7.2cqi, 5rem); line-height: 1.15; }
.tc-hls .tc-title b { font-weight: 900; display: block; letter-spacing: .08em; }
/* Knights: heraldic red & gold, serif */
.tc-knights { --tc-bg: linear-gradient(135deg, #7d1a1d 0 50%, #1c2d6b 50% 100%); --tc-fg: #fff6df; --tc-accent: #ffd36b; }
.tc-knights .tc-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: 0; font-size: clamp(1.4rem, 8.4cqi, 6rem); text-shadow: 0 .06em 0 rgba(0, 0, 0, .35); }
.tc-knights .tc-title i { display: block; font-size: .42em; font-style: italic; font-weight: 400; letter-spacing: .02em; margin: .25em 0; color: var(--tc-accent); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form .row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form label { display: grid; gap: .4rem; font-size: .9rem; color: var(--muted); }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form textarea { min-height: 150px; resize: vertical; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; margin: 0; font-size: .95rem; }
.form-status[data-state="ok"] { color: #8fe3a5; }
.form-status[data-state="error"] { color: #ff9b8f; }

/* ---------- Home hero (slow crossfade) ---------- */
.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-slides { position: absolute; inset: 0; z-index: -2; background: #000; }
.hero-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: heroFade 27s infinite; }
/* first slide starts already faded in (negative delay), so the hero is never black on load */
.hero-slides img:nth-child(1) { animation-delay: -2.2s; }
.hero-slides img:nth-child(2) { animation-delay: 6.8s; }
.hero-slides img:nth-child(3) { animation-delay: 15.8s; }
@keyframes heroFade {
  0% { opacity: 0; transform: scale(1.04); }
  8% { opacity: 1; }
  33% { opacity: 1; }
  41% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slides img { animation: none; }
  .hero-slides img:first-child { opacity: 1; }
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14,14,16,.15) 0%, rgba(14,14,16,.35) 45%, rgba(14,14,16,.96) 100%),
              linear-gradient(90deg, rgba(14,14,16,.6) 0%, rgba(14,14,16,0) 60%);
}
.hero-copy { padding: 8rem 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero-copy h1 { max-width: 14ch; text-shadow: 0 2px 30px rgba(0,0,0,.4); }
.hero-copy .lede { color: #d9d7cf; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

.tools-band {
  margin-top: 1.25rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem 1.5rem;
  padding: 1.3rem 1.5rem; border-radius: var(--radius); text-decoration: none;
  background: linear-gradient(90deg, #13201d, var(--bg-2)); border: 1px solid var(--line);
  --accent: #5fe0b8;
}
.tools-band:hover { border-color: var(--accent); color: inherit; }
.tools-band .eyebrow { margin: 0; }
.tools-band-title { font-weight: 800; font-size: 1.3rem; }
.tools-band .muted { grid-column: 2; font-size: .97rem; }
.tools-band-go { grid-row: 1 / span 2; grid-column: 3; font-size: 1.6rem; color: var(--accent); }
@media (max-width: 640px) {
  .tools-band { grid-template-columns: 1fr auto; }
  .tools-band .muted { grid-column: 1; }
  .tools-band-go { grid-row: 1 / span 3; grid-column: 2; }
}

.split { display: grid; gap: 1.5rem 4rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Game pages ---------- */
.game-hero { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: #000; }
.game-hero > img, .game-hero > .titlecard { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.game-hero > .titlecard { padding-bottom: clamp(9rem, 22vh, 13rem); align-content: center; }
.game-hero > .titlecard .tc-title { font-size: clamp(2.6rem, 9cqi, 8rem); }
.game-hero > .titlecard .tc-soon { position: static; transform: none; margin-top: 1.6rem; }
/* When the title card is the key art, it carries the visible title */
.game-hero.has-card h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.game-hero.has-card .tagline { margin-top: .9rem; }
.game-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14,14,16,0) 35%, rgba(14,14,16,.75) 75%, var(--bg) 100%); }
.game-hero .wrap { padding: 7rem 0 clamp(2rem, 5vw, 3.5rem); }
.game-hero h1 { margin: .9rem 0 .4rem; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.game-hero .tagline { font-size: clamp(1.15rem, 2.4vw, 1.55rem); max-width: 34ch; margin: 0; color: #e6e3da; text-shadow: 0 1px 16px rgba(0,0,0,.6); }
.game-hero .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.game-hero .genre { font: 600 .78rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); text-shadow: 0 1px 10px rgba(0,0,0,.8); }
/* Contained hero, for smaller/darker source captures */
.game-hero.contained { min-height: 0; display: block; background: transparent; padding-top: clamp(1.5rem, 4vw, 3rem); }
.game-hero.contained::after { display: none; }
.game-hero.contained .frame { width: min(100% - 2 * var(--gutter), 1280px); margin-inline: auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.game-hero.contained .frame img { width: 100%; }
.game-hero.contained .wrap { padding: 2rem 0 0; }
.game-hero.contained h1, .game-hero.contained .tagline, .game-hero.contained .genre { text-shadow: none; }

.game-body { display: grid; gap: 2rem 4rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 860px) { .game-body { grid-template-columns: minmax(0, 1fr); } }
.pitch p { font-size: 1.08rem; }
.pitch p:first-child { font-size: 1.22rem; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.features li { position: relative; padding: .85rem 0 .85rem 1.6rem; border-bottom: 1px solid var(--line); }
.features li::before { content: ""; position: absolute; left: 0; top: 1.35rem; width: .6rem; height: 2px; background: var(--accent); }
.features li:last-child { border-bottom: 0; }
.features b { color: var(--text); }
.features .planned { font: 600 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: .25em .5em; border-radius: 4px; margin-left: .35rem; white-space: nowrap; }
.feature-tile { margin-top: 2rem; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-tile img { width: 100%; height: 100%; object-fit: cover; }
.feature-tile div { padding: 1.5rem 1.5rem 1.5rem 0; }
@media (max-width: 720px) { .feature-tile { grid-template-columns: 1fr; } .feature-tile div { padding: 0 1.3rem 1.4rem; } }
.game-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.game-nav a { text-decoration: none; color: var(--muted); }
.game-nav a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gallery button {
  padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: zoom-in;
  background: var(--bg-3); aspect-ratio: 16 / 9;
}
.gallery button:hover { border-color: var(--accent); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } .gallery button:hover img { transform: none; } }
dialog.lightbox {
  padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0; color: var(--text);
}
dialog.lightbox::backdrop { background: rgba(5, 5, 7, .92); }
dialog.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 16px; }
dialog.lightbox img { max-width: min(100%, 1920px); max-height: calc(100vh - 120px); width: auto; height: auto; border-radius: 6px; }
dialog.lightbox figcaption { margin-top: .75rem; color: var(--muted); font-size: .95rem; text-align: center; }
.lb-btn {
  position: fixed; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(20, 20, 24, .85); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover { border-color: var(--accent); }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
