:root {
  color-scheme: dark;
  --void: #0a0c0f;
  --panel: #11151a;
  --panel-high: #161b22;
  --ink: #e9eef4;
  --muted: #8c99a8;
  --dim: #b6c1cd;
  --line: rgba(233, 238, 244, 0.13);
  --line-strong: rgba(233, 238, 244, 0.3);
  --accent: #4ff0c4;
  --ember: #ff6b4a;
  --radius: 4px;
  --mono:
    ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(79, 240, 196, 0.05), transparent 460px),
    radial-gradient(circle at 84% -4%, rgba(255, 107, 74, 0.08), transparent 44%),
    var(--void);
  background-attachment: fixed;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page-scanlines {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(233, 238, 244, 0.028) 0 1px,
    transparent 1px 4px
  );
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
}

.site-header,
.site-footer {
  flex: 0 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  background: rgba(79, 240, 196, 0.09);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-mark i {
  color: var(--ink);
  font-style: normal;
  opacity: 0.55;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.collection-count {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dim);
  background: rgba(17, 21, 26, 0.6);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.collection-count span {
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(79, 240, 196, 0.9);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
  padding: 48px 0 44px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero .eyebrow {
  margin-bottom: 14px;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(44px, 5.1vw, 70px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.94;
  text-transform: uppercase;
}

.hero h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 2px var(--accent);
}

.hero-intro {
  max-width: 620px;
  margin: 20px 0 19px;
  color: var(--dim);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.55;
}

.browse-link {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.browse-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 240, 196, 0.07);
}

.browse-link span {
  transition: transform 180ms ease;
}

.browse-link:hover span {
  transform: translateY(3px);
}

.hero-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.hero-note div {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(233, 238, 244, 0.022) 0 1px,
      transparent 1px 7px
    ),
    var(--panel);
}

.hero-note strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero-note span {
  min-width: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.games-section {
  padding: 58px 0 110px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-heading .eyebrow {
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.section-tools {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.section-tools > p {
  max-width: 250px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.author-filter {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  position: absolute;
  top: 50%;
  right: 14px;
  border-top: 5px solid var(--accent);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  pointer-events: none;
  transform: translateY(-35%);
}

.author-filter select {
  min-width: 160px;
  padding: 11px 38px 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: none;
  appearance: none;
  cursor: pointer;
}

.author-filter select:hover {
  border-color: var(--accent);
}

.author-filter select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.game-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.game-card[hidden] {
  display: none;
}

.game-card:hover {
  border-color: rgba(79, 240, 196, 0.55);
  box-shadow: 0 0 0 1px rgba(79, 240, 196, 0.16);
  transform: translateY(-5px);
}

.game-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.game-art {
  position: relative;
  display: grid;
  min-height: 285px;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.game-art::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(4, 6, 8, 0.34) 0 1px,
    transparent 1px 3px
  );
  content: "";
  pointer-events: none;
}

/* Four corner brackets drawn as eight 1px bars. */
.game-art::after {
  --bracket: linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42));
  position: absolute;
  z-index: 2;
  inset: 14px;
  background:
    var(--bracket) 0 0 / 24px 1px,
    var(--bracket) 0 0 / 1px 24px,
    var(--bracket) 100% 0 / 24px 1px,
    var(--bracket) 100% 0 / 1px 24px,
    var(--bracket) 0 100% / 24px 1px,
    var(--bracket) 0 100% / 1px 24px,
    var(--bracket) 100% 100% / 24px 1px,
    var(--bracket) 100% 100% / 1px 24px;
  background-repeat: no-repeat;
  content: "";
  pointer-events: none;
}

.card-number {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 26px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.game-sigil {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 70px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 0 34px rgba(0, 0, 0, 0.55);
  transition: transform 260ms ease;
}

.game-card:hover .game-sigil {
  transform: scale(1.05);
}

.play-pill {
  position: absolute;
  z-index: 3;
  right: 26px;
  bottom: 24px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(8, 11, 14, 0.55);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.play-pill b {
  font-size: 12px;
  transition: transform 180ms ease;
}

.game-card:hover .play-pill b {
  transform: translateX(3px);
}

/* --- Cursed Factory --------------------------------------------------- */

.cursed-factory .game-art {
  background: linear-gradient(160deg, #140b08 0 38%, #35180f 38% 70%, #7d3a19 70%);
}

.factory-hazard {
  position: absolute;
  right: 0;
  bottom: 62px;
  left: 0;
  height: 22px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 168, 74, 0.62) 0 12px,
    rgba(20, 11, 8, 0.72) 12px 24px
  );
  opacity: 0.6;
}

.factory-gear {
  position: absolute;
  width: 132px;
  height: 132px;
  border: 2px solid rgba(255, 186, 122, 0.6);
  background: repeating-conic-gradient(
    rgba(255, 186, 122, 0.4) 0deg 9deg,
    transparent 9deg 30deg
  );
  transform: rotate(15deg);
}

.factory-gear::before {
  position: absolute;
  inset: 30px;
  border: 2px solid rgba(255, 186, 122, 0.5);
  background: rgba(18, 10, 7, 0.8);
  content: "";
}

.factory-gear::after {
  position: absolute;
  inset: 56px;
  background: rgba(255, 107, 74, 0.55);
  content: "";
}

/* --- Deep Echos ------------------------------------------------------- */

.deep-echos .game-art {
  background: linear-gradient(160deg, #04141a 0 40%, #0a2c33 40% 72%, #1a6f6c 72%);
}

.echo-sonar {
  position: absolute;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(126, 240, 224, 0.55);
  box-shadow:
    0 0 0 22px rgba(126, 240, 224, 0.07),
    0 0 0 23px rgba(126, 240, 224, 0.34),
    0 0 0 48px rgba(126, 240, 224, 0.05),
    0 0 0 49px rgba(126, 240, 224, 0.2),
    0 0 0 76px rgba(126, 240, 224, 0.03),
    0 0 0 77px rgba(126, 240, 224, 0.11);
  transform: rotate(45deg);
}

.echo-shard {
  position: absolute;
  right: 46px;
  bottom: 52px;
  width: 40px;
  height: 78px;
  background: linear-gradient(150deg, #eafffb 0 34%, #4fe6d2 34% 66%, #10635f 66%);
  clip-path: polygon(50% 0, 100% 34%, 74% 100%, 22% 92%, 0 33%);
  opacity: 0.9;
  transform: rotate(9deg);
}

/* --- Haze Maze -------------------------------------------------------- */

.haze-maze .game-art {
  background: linear-gradient(160deg, #09051b 0 40%, #241246 40% 72%, #6b3aa8 72%);
}

.maze-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(203, 168, 255, 0.34) 0 2px, transparent 2px 32px),
    repeating-linear-gradient(0deg, rgba(203, 168, 255, 0.22) 0 2px, transparent 2px 32px);
  mask-image: radial-gradient(circle at 50% 44%, #000 6%, rgba(0, 0, 0, 0.35) 52%, transparent 78%);
}

/* Mist settling over the lower corridors. */
.maze-grid::after {
  position: absolute;
  inset: auto 0 0;
  height: 128px;
  background: linear-gradient(180deg, transparent, rgba(151, 112, 219, 0.5));
  content: "";
}

.haze-gate {
  position: absolute;
  bottom: 46px;
  left: 38px;
  width: 66px;
  height: 88px;
  border: 2px solid rgba(255, 214, 132, 0.72);
  border-radius: 33px 33px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 214, 132, 0.3), rgba(107, 58, 168, 0.12));
  box-shadow: 0 0 34px rgba(255, 205, 120, 0.32);
}

/* --- Last Light ------------------------------------------------------- */

.lastlight .game-art {
  background: linear-gradient(160deg, #080d17 0 42%, #16223a 42% 72%, #8a5a1c 72%);
}

.signal-bars {
  position: absolute;
  width: 224px;
  height: 118px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 214, 150, 0.5) 0 5px,
    transparent 5px 16px
  );
  clip-path: polygon(
    0 50%,
    9% 50%,
    13% 8%,
    18% 92%,
    24% 30%,
    30% 70%,
    38% 0,
    45% 100%,
    54% 22%,
    62% 78%,
    70% 40%,
    78% 60%,
    86% 14%,
    93% 86%,
    100% 50%,
    100% 100%,
    0 100%
  );
}

.lastlight-beacon {
  position: absolute;
  top: 54px;
  width: 44px;
  height: 44px;
  background: linear-gradient(140deg, #fff2d4 0 40%, #ffb547 40% 74%, #a05f16 74%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 42px rgba(255, 181, 71, 0.45);
}

/* --- Card copy -------------------------------------------------------- */

.game-copy {
  min-width: 0;
  padding: 27px 27px 25px;
}

.game-type {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-copy h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.game-title {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.game-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.game-copy > p:not(.game-type) {
  min-height: 74px;
  margin: 14px 0 21px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.62;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tag-row span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  background: var(--panel-high);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--ink);
  font-weight: 600;
}

.site-footer a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--dim);
  text-decoration: none;
}

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

@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 32px;
    padding: 40px 0 36px;
  }

  .hero-note {
    gap: 10px;
  }

  .hero-note div {
    padding: 15px 12px;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 10px);
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(1180px, calc(100% - 28px));
  }

  .site-header {
    min-height: 70px;
  }

  .brand-copy small,
  .collection-count {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
    padding: 30px 0 27px;
  }

  .hero h1 {
    font-size: clamp(38px, 10.5vw, 50px);
    letter-spacing: -0.055em;
  }

  .hero h1 em {
    -webkit-text-stroke-width: 1.5px;
  }

  .hero-intro {
    max-width: 470px;
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
  }

  .browse-link,
  .hero-note {
    display: none;
  }

  .games-section {
    padding: 36px 0 78px;
  }

  .section-heading {
    display: block;
    margin-bottom: 30px;
  }

  .section-tools {
    gap: 16px;
    justify-items: stretch;
    margin-top: 14px;
  }

  .section-tools > p {
    margin: 0;
    text-align: left;
  }

  .author-filter {
    display: grid;
    gap: 7px;
  }

  .author-filter select,
  .select-shell {
    width: 100%;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: auto;
  }

  .game-art {
    min-height: 260px;
  }

  .game-copy > p:not(.game-type) {
    min-height: auto;
  }

  .site-footer {
    display: grid;
    gap: 16px;
    align-content: center;
    padding: 28px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
