:root {
  color-scheme: dark;
  --night: #142232;
  --plum: #173a49;
  --violet: #356a79;
  --spell: #58ddd9;
  --ember: #ffcd67;
  --parchment: #f4eedc;
  --body-ink: #f6f0ff;
  --muted-ink: #b5ccd3;
  --display-font: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --body-font: Inter, "Avenir Next", Avenir, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--night);
  color: var(--body-ink);
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--spell);
  outline-offset: 5px;
}

.page-width {
  width: min(100% - 3rem, 76rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 1rem;
  left: 1rem;
  padding: 0.65rem 1rem;
  transform: translateY(-180%);
  background: var(--parchment);
  color: var(--night);
  font-weight: 750;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgb(255 255 255 / 11%);
  background: var(--night);
}

.header-inner,
.footer-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-block: 0.8rem;
  gap: 1rem;
}

.brand {
  color: var(--spell);
  font-family: var(--display-font);
  font-size: 1.4rem;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
}
.hero-link {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.hero-link:hover {
  color: var(--spell);
}

/* The same home control is kept locally so each project remains independent. */
.home-button {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border: 1px solid #cbd3db;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #253244;
  font: 650 0.875rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.home-button span[aria-hidden] {
  font-size: 1.2rem;
  line-height: 1;
}

.home-button:hover {
  background: #e6edf4;
  border-color: #8293a5;
  color: #182638;
}

.home-button:focus-visible {
  outline: 3px solid #547cb4;
  outline-offset: 4px;
}

.image-link {
  display: block;
  border-radius: inherit;
  cursor: zoom-in;
}

.image-link:focus-visible {
  outline: 3px solid #547cb4;
  outline-offset: -4px;
}

.capture-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  font: 650 0.8rem/1.4 system-ui, sans-serif;
  text-underline-offset: 0.25em;
  white-space: nowrap;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 76% 46%, #225c67, transparent 60%),
    var(--night);
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: 9%;
  right: -7rem;
  width: 34rem;
  aspect-ratio: 1;
  border: 1px solid rgb(55 222 212 / 20%);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 2.8rem rgb(55 222 212 / 3%), 0 0 0 5.5rem rgb(255 182 80 / 3%);
}

.hero::after {
  position: absolute;
  z-index: -1;
  right: 7%;
  bottom: 14%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: -24rem -18rem 0 -0.15rem var(--spell), -4rem -24rem 0 -0.15rem var(--parchment);
  content: "";
}

.hero-layout {
  display: grid;
  min-height: 43rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(19rem, 0.95fr);
  align-items: center;
  gap: clamp(2.5rem, 8vw, 8rem);
  padding-block: clamp(4.25rem, 9vw, 8.5rem);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding-block: 1rem;
}

.project-type,
.section-label {
  margin: 0 0 0.8rem;
  color: var(--spell);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--parchment);
  font-family: var(--display-font);
  font-size: clamp(5.7rem, 12vw, 10.6rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.88;
  text-transform: uppercase;
}

.hero h1 span {
  color: inherit;
}

.hero-description {
  max-width: 33rem;
  margin: 1.8rem 0 0.9rem;
  color: var(--body-ink);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.55;
}

.hero-link {
  color: var(--ember);
}

.hero-link span {
  font-size: 1.2rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem clamp(1.8rem, 4vw, 3.4rem);
  margin: 2.4rem 0 0;
  padding-top: 1.3rem;
  border-top: 1px solid rgb(255 255 255 / 18%);
}

.hero-facts div {
  display: grid;
  gap: 0.15rem;
}

.hero-facts dt {
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 0;
  color: var(--parchment);
  font-size: 0.94rem;
  font-weight: 700;
}

.cover-art {
  position: relative;
  width: min(100%, 34rem);
  justify-self: end;
  margin: 0;
  padding: 0.8rem;
  transform: rotate(2deg);
  background: var(--parchment);
  box-shadow: 1rem 1.2rem 0 rgb(9 7 17 / 35%), 0 0 3.5rem rgb(55 222 212 / 15%);
}

.cover-art img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.cover-art figcaption {
  padding: 0.58rem 0.2rem 0.05rem;
  color: var(--night);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.cover-art .capture-link {
  color: var(--night);
  margin-left: 0.8rem;
}

.magic-orbit {
  position: absolute;
  z-index: -1;
  inset: -1.2rem;
  border: 1px solid rgb(55 222 212 / 75%);
  border-radius: 48% 52% 49% 51%;
  transform: rotate(-11deg);
}

.magic-orbit::after {
  position: absolute;
  top: 10%;
  right: 11%;
  width: 0.85rem;
  height: 0.85rem;
  border: 0.16rem solid var(--night);
  border-radius: 50%;
  background: var(--ember);
  content: "";
}

.game-loop {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(3rem, 8vw, 8rem);
  padding: clamp(4rem, 8vw, 7.5rem) max(calc((100vw - 76rem) / 2), 1.5rem);
  background: var(--parchment);
  color: var(--night);
}

.game-loop .section-label {
  color: var(--violet);
}

.timeline .section-label {
  color: var(--spell);
}

.loop-intro h2,
.timeline h2,
.gameplay-heading h2,
.project-end h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.98;
  text-transform: uppercase;
}

.loop-intro > p:last-child {
  max-width: 31rem;
  margin: 1.25rem 0 0;
  color: #51475e;
}

.game-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 0;
}

.detail {
  min-height: 11.5rem;
  padding: 1.05rem 0.75rem 0 0;
  border-top: 2px solid var(--violet);
}

.detail dt {
  color: var(--violet);
  font-family: var(--display-font);
  font-size: 1.5rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.detail dd {
  margin: 0.55rem 0 0;
  color: #51475e;
  font-size: 0.9rem;
  line-height: 1.55;
}

.timeline {
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  column-gap: clamp(3rem, 8vw, 8rem);
  row-gap: 1rem;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.timeline-heading > p:last-child {
  max-width: 24rem;
  margin: 1.1rem 0 0;
  color: var(--muted-ink);
}

.timeline-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  position: relative;
  padding: 0 0 1.65rem 1.8rem;
  border-left: 1px solid rgb(255 255 255 / 27%);
}

.timeline-list li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline-list li::before {
  position: absolute;
  top: 0.24rem;
  left: -0.42rem;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--night);
  border-radius: 50%;
  background: var(--spell);
  box-shadow: 0 0 0 2px var(--spell);
  content: "";
}

.timeline-list li:last-child::before {
  background: var(--ember);
  box-shadow: 0 0 0 2px var(--ember);
}

.timeline-list time {
  color: var(--ember);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.timeline-range > span {
  color: var(--spell);
  font-size: 1.15rem;
}

.timeline-list p {
  margin: 0.35rem 0 0;
  color: var(--body-ink);
}

.timeline-source {
  grid-column: 2;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.78rem;
}

.timeline-source a {
  color: var(--spell);
  text-underline-offset: 0.2em;
}

.gameplay-section {
  padding-block: clamp(4rem, 8vw, 7rem);
  background:
    linear-gradient(135deg, rgb(53 106 121 / 25%), transparent 60%),
    #182f3c;
}

.gameplay-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.6rem;
}

.gameplay-heading h2 {
  max-width: 13ch;
  color: var(--parchment);
}

.gameplay-heading > p {
  max-width: 24rem;
  margin: 0 0 0.25rem;
  color: var(--muted-ink);
}

.game-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 2rem 1.5rem;
}

.game-shot {
  min-width: 0;
  margin: 0;
}

.game-shot--wide {
  grid-column: span 6;
}

.game-shot--score {
  grid-column: span 6;
  margin-top: 0;
}

.game-shot--words {
  grid-column: span 6;
}

.game-shot--title {
  grid-column: span 6;
  margin-top: 0;
}

.shot-window {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 16%);
  background: #100e18;
  box-shadow: 0.65rem 0.7rem 0 rgb(10 8 18 / 35%);
}

.shot-window img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.game-shot a {
  color: var(--spell);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.game-shot a:hover {
  color: var(--ember);
}

.game-shot figcaption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.8rem;
}

.game-shot figcaption span {
  color: var(--parchment);
  font-family: var(--display-font);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-end {
  background: var(--violet);
}

.project-end-inner {
  display: flex;
  min-height: 17rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 3.5rem;
}

.project-end .section-label {
  color: var(--spell);
}

.project-end h2 {
  color: var(--parchment);
}

.site-footer {
  background: var(--night);
}

.footer-inner {
  min-height: 5rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .hero-layout {
    min-height: unset;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.75fr);
    gap: 3rem;
  }

  .hero h1 {
    font-size: clamp(5.2rem, 11vw, 8rem);
  }

  .game-loop {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .game-details {
    max-width: 52rem;
  }

  .timeline {
    grid-template-columns: minmax(12rem, 0.75fr) minmax(0, 1.25fr);
    column-gap: 3rem;
  }

  .game-shot--wide,
  .game-shot--words {
    grid-column: span 6;
  }

  .game-shot--score,
  .game-shot--title {
    grid-column: span 6;
  }
}

@media (max-width: 650px) {
  .page-width {
    width: min(100% - 2rem, 76rem);
  }

  .header-inner,
  .footer-inner {
    min-height: 4rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-block: 4.2rem 4.5rem;
  }

  .hero h1 {
    font-size: clamp(5.5rem, 20vw, 8.5rem);
  }

  .hero-description {
    max-width: 31rem;
  }

  .hero-facts {
    margin-top: 1.8rem;
  }

  .cover-art {
    width: min(82%, 27rem);
    justify-self: center;
    margin-inline: 0.7rem;
  }

  .game-loop {
    padding: 4rem 1rem;
  }

  .game-details {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .detail {
    min-height: 0;
    padding: 0.9rem 0 0.2rem;
  }

  .timeline {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 4rem;
  }

  .timeline-source {
    grid-column: 1;
  }

  .gameplay-heading {
    align-items: start;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .game-gallery {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .game-shot--wide,
  .game-shot--score,
  .game-shot--words,
  .game-shot--title {
    grid-column: 1;
    margin-top: 0;
  }

  .project-end-inner {
    min-height: 0;
    align-items: start;
    flex-direction: column;
    padding-block: 3.5rem;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 5rem;
  }

  .hero-facts {
    gap: 1rem;
  }

  .game-shot figcaption {
    align-items: start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .footer-inner {
    align-items: start;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    padding-block: 0.8rem;
  }
}

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

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