/* ---- Tokens ---- */
:root {
  /* Cool gray–green base */
  --bg-deep: #0b0f0d;
  --bg-raised: #121814;
  --bg-card: #18201c;
  --text: #dfe8e0;
  --text-muted: #8e9a92;
  /* Bright orange — links, primary CTAs, one-off highlights (use sparingly) */
  --accent: #ff7a33;
  --accent-hover: #ff9a5c;
  --accent-soft: rgba(255, 122, 51, 0.14);
  --accent-glow: rgba(255, 122, 51, 0.28);
  --accent-on: #141210;
  /* Greens — UI chrome, hints, success */
  --green-bright: #8fd4a8;
  --green-muted: #5d8f72;
  --green-deep: #2f4d3c;
  --green-glow: rgba(100, 170, 130, 0.16);
  --border: rgba(215, 225, 218, 0.09);
  --font-sans: "Chakra Petch", system-ui, sans-serif;
  /* Titles / logo — sci-fi menu vibe */
  --font-display: "Orbitron", "Chakra Petch", sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 50% at 50% -22%, var(--green-glow), transparent),
    radial-gradient(ellipse 55% 42% at 100% 38%, rgba(45, 75, 58, 0.22), transparent),
    radial-gradient(ellipse 48% 48% at 0% 88%, rgba(22, 32, 28, 0.55), transparent);
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-hover);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  border-radius: 6px;
  z-index: 1000;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--bg-card);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 14, 12, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bar::before {
  top: -6px;
}

.nav-toggle__bar::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.35s var(--ease),
      opacity 0.25s,
      visibility 0.25s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0;
  }
}

/* ---- Sections ---- */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 1.25rem;
}

.section__inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section__heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  margin: 0 0 1.5rem;
  letter-spacing: 0.04em;
}

.section__sub {
  color: var(--text-muted);
  max-width: 42rem;
  margin: -0.5rem 0 2rem;
}

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 5.5rem) 1.25rem clamp(3rem, 8vw, 5rem);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  position: relative;
}

.hero__glow {
  position: absolute;
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  right: 5%;
  top: 15%;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  filter: blur(40px);
  opacity: 0.75;
  pointer-events: none;
}

.hero__tag {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--green-muted);
  margin: 0 0 1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  line-height: 1.08;
  margin: 0 0 1.25rem;
}

.hero__title-line {
  display: block;
}

.hero__title-line--accent {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.hero__lede {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 0 2rem;
  font-weight: 300;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-on);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: rgba(140, 175, 155, 0.35);
  background: rgba(30, 42, 36, 0.65);
  color: var(--text);
  transform: translateY(-1px);
}

.hero__frame {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mock-screen {
  width: min(100%, 380px);
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--accent-soft) inset;
  position: relative;
  overflow: hidden;
}

.mock-screen__scene {
  position: absolute;
  inset: 12px;
  border-radius: calc(var(--radius-lg) - 8px);
  background:
    linear-gradient(165deg, #243028 0%, #151c18 48%, #0a0f0c 100%),
    radial-gradient(ellipse 70% 50% at 70% 80%, rgba(100, 160, 120, 0.14), transparent);
}

.mock-screen__scene::after {
  content: "";
  position: absolute;
  bottom: 18%;
  left: 15%;
  width: 28%;
  height: 35%;
  background: linear-gradient(180deg, rgba(55, 85, 68, 0.55), rgba(28, 42, 34, 0.88));
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.mock-screen__cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 2px;
  top: 52%;
  left: 58%;
  transform: rotate(-12deg);
  box-shadow: 0 0 0 2px rgba(8, 12, 10, 0.75);
  animation: cursor-nudge 4s var(--ease) infinite;
}

@keyframes cursor-nudge {
  0%,
  100% {
    transform: rotate(-12deg) translate(0, 0);
  }
  50% {
    transform: rotate(-12deg) translate(6px, -4px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
  }

  .hero__lede {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__frame {
    order: -1;
  }

  .mock-screen {
    width: min(100%, 320px);
  }
}

/* ---- About ---- */
.section--about {
  background: rgba(16, 22, 19, 0.55);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 2.5rem;
  align-items: start;
}

.about__text p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.about__text p:last-child {
  margin-bottom: 0;
}

.about__pull {
  margin: 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--green-muted);
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text);
}

.about__pull p {
  margin: 0;
}

@media (max-width: 720px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Features (angular panels — no pill boxes) ---- */
.section--features {
  --feature-accent: var(--accent);
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  --feature-accent: var(--accent);
  position: relative;
  margin: 0;
  padding: 1.5rem 1.5rem 1.65rem;
  border: 1px solid rgba(235, 230, 223, 0.1);
  border-radius: 0;
  border-left: 3px solid var(--feature-accent);
  background: linear-gradient(
    165deg,
    rgba(32, 26, 42, 0.95) 0%,
    rgba(14, 11, 20, 0.98) 55%,
    rgba(10, 8, 14, 1) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 36px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s,
    box-shadow 0.25s;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--feature-accent),
    transparent 65%
  );
  opacity: 0.45;
  pointer-events: none;
}

.feature-card:nth-child(1) {
  --feature-accent: var(--accent);
}

.feature-card:nth-child(2) {
  --feature-accent: #6b9a8a;
}

.feature-card:nth-child(3) {
  --feature-accent: #5d8a72;
}

.feature-card:nth-child(4) {
  --feature-accent: #8ab89a;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(220, 230, 222, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 20px 44px rgba(0, 0, 0, 0.55);
}

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 0 1rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--feature-accent);
  background: color-mix(in srgb, var(--feature-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--feature-accent) 35%, transparent);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .feature-list {
    grid-template-columns: 1fr;
  }
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .feature-card__icon {
    background: rgba(255, 122, 51, 0.12);
    border-color: rgba(255, 122, 51, 0.38);
  }

  .feature-card:nth-child(2) .feature-card__icon {
    background: rgba(107, 154, 138, 0.14);
    border-color: rgba(107, 154, 138, 0.4);
  }

  .feature-card:nth-child(3) .feature-card__icon {
    background: rgba(93, 138, 114, 0.14);
    border-color: rgba(93, 138, 114, 0.4);
  }

  .feature-card:nth-child(4) .feature-card__icon {
    background: rgba(138, 184, 154, 0.14);
    border-color: rgba(138, 184, 154, 0.4);
  }
}

/* ---- Minigame ---- */
.section--minigame {
  background: rgba(14, 20, 17, 0.42);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.minigame__layout {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 1.4fr);
  gap: 2.5rem;
  align-items: center;
}

.minigame__copy p {
  margin: 0;
  color: var(--text-muted);
  max-width: 38rem;
}

.minigame__stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 80px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.minigame-game-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.minigame__copy p + p {
  margin-top: 0.75rem;
}

/* ---- Slide puzzle ---- */
.slide-game {
  width: 100%;
  max-width: min(560px, 100%);
  margin: 0 auto;
}

.slide-game__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.slide-game__howto {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.slide-game__reset {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.slide-game__board {
  display: grid;
  gap: 3px;
  padding: 6px;
  background: #080c0a;
  border-radius: 10px;
  border: 1px solid var(--border);
  user-select: none;
  touch-action: manipulation;
}

.slide-game__board--won {
  box-shadow:
    0 0 0 1px rgba(120, 200, 150, 0.4),
    0 0 24px rgba(100, 170, 130, 0.18);
}

.slide-game__cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s;
  font: inherit;
}

.slide-game__cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slide-game__cell--wall {
  cursor: default;
  background: #060a08;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.slide-game__cell--floor {
  background: #1a2320;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.slide-game__cell--floor:hover {
  background: #232e2a;
}

.slide-game__cell--box {
  --box-r: 6px;
  border-radius: var(--box-r);
  background: linear-gradient(145deg, #5c4033 0%, #3d2a22 45%, #2a1e18 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 0 #1a1410,
    0 4px 8px rgba(0, 0, 0, 0.4);
}

.slide-game__cell--box:hover {
  filter: brightness(1.06);
}

.slide-game__cell--box.slide-game__cell--selected {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 2px var(--accent),
    0 3px 0 #1a1410;
}

/* Visually merge adjacent cells of the same multi-tile crate */
.slide-game__cell--box.slide-game__box-join-n {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -3px;
  padding-top: 3px;
}

.slide-game__cell--box.slide-game__box-join-s {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: -3px;
  padding-bottom: 3px;
}

.slide-game__cell--box.slide-game__box-join-w {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -3px;
  padding-left: 3px;
}

.slide-game__cell--box.slide-game__box-join-e {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -3px;
  padding-right: 3px;
}

.slide-game__cell--ball {
  cursor: default;
  background: radial-gradient(
    circle at 35% 35%,
    #ffcf8a 0%,
    #ff8a3c 42%,
    #c45a1a 100%
  );
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

.slide-game__cell--exit {
  background: #142218;
  box-shadow:
    inset 0 0 12px rgba(74, 222, 128, 0.25),
    inset 0 0 0 2px rgba(74, 222, 128, 0.45);
}

.slide-game__cell--exit::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 2px dashed rgba(74, 222, 128, 0.5);
  pointer-events: none;
}

.slide-game__status {
  margin: 0.85rem 0 0;
  min-height: 1.35em;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--green-bright);
}

/* ---- Pipeline puzzle ---- */
.pipe-game {
  width: 100%;
  min-width: 0;
  max-width: min(960px, 100%);
  margin: 0 auto;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.pipe-game__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pipe-game__howto {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.pipe-game__hint-in {
  color: var(--green-muted);
}

.pipe-game__hint-out {
  color: var(--green-bright);
}

.pipe-game__reset {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* Crate slide: hidden. Delete this rule to show the slide game again. */
#slide-game {
  display: none !important;
}

/* Level editor: hidden. Delete this rule to show the editor again. */
#pipe-editor-toggle,
#pipe-editor-root,
#pipe-editor-feedback {
  display: none !important;
}

.pipe-game__editor {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pipe-game__editor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.pipe-game__editor-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pipe-game__editor-select {
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.pipe-game__editor-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pipe-game__editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pipe-game__editor-actions .btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}

.pipe-game__editor-feedback {
  margin: 0 0 0.75rem;
  min-height: 1.25em;
  font-size: 0.8125rem;
  color: var(--accent);
}

.pipe-game--editing .pipe-game__cell {
  cursor: cell;
}

.pipe-game--editing .pipe-game__cell:hover {
  box-shadow:
    inset 0 0 0 1px rgba(120, 200, 150, 0.45),
    0 0 10px rgba(100, 170, 130, 0.15);
}

.pipe-game__board {
  padding: 10px;
  background: #0a100d;
  border-radius: 12px;
  border: 1px solid var(--border);
  user-select: none;
  touch-action: manipulation;
}

.pipe-game__board--won {
  box-shadow:
    0 0 0 1px rgba(120, 200, 150, 0.45),
    0 0 28px rgba(90, 160, 120, 0.2);
}

/* Terminal + N×N play: start top-left, end bottom-left (even N); square cells */
.pipe-game__board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 7 / 6;
  min-height: 220px;
  min-width: 0;
  align-self: stretch;
}

.pipe-game__play-grid {
  grid-column: 2 / span 6;
  grid-row: 1 / span 6;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  min-height: 0;
}

.pipe-game__terminal {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #161f1c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.pipe-game__terminal--start {
  grid-column: 1;
  grid-row: 1;
}

.pipe-game__terminal--end {
  grid-column: 1;
  grid-row: 6;
}

/* Shared art sizing for terminals and rotatable tiles */
.pipe-game__cell-inner,
.pipe-game__terminal-inner {
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: 50%;
  box-sizing: border-box;
}

.pipe-game__cell-inner {
  transition: transform 0.2s var(--ease);
}

/* Asset has pipe on the left; mirror so the stub faces the play grid (east). */
.pipe-game__terminal--start .pipe-game__terminal-inner,
.pipe-game__terminal--end .pipe-game__terminal-inner {
  transform: scaleX(-1);
}

.pipe-game__cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 4px;
  box-sizing: border-box;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #161f1c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.2s var(--ease);
  font: inherit;
}

.pipe-game__cell:hover {
  box-shadow:
    inset 0 0 0 1px rgba(120, 190, 145, 0.28),
    0 0 12px rgba(90, 150, 115, 0.12);
}

.pipe-game__cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pipe-game__cell-inner {
    transition: none;
  }
}

.pipe-game__status {
  margin: 0.85rem 0 0;
  min-height: 1.35em;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--green-bright);
}

@media (max-width: 900px) {
  .minigame__layout {
    grid-template-columns: 1fr;
  }

}

/* ---- Gallery ---- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.gallery__item {
  margin: 0;
}

.gallery__shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.65rem;
  background: var(--bg-card);
}

.gallery__item figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .gallery__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- CTA ---- */
.section--cta {
  text-align: center;
}

.section--cta .section__inner {
  max-width: 640px;
}

.section--cta p {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ---- Footer ---- */
.site-footer {
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-footer__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-footer__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---- Reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
