:root {
  --chrome-light: #ececec;
  --chrome-mid: #b7b7b7;
  --chrome-dark: #55575b;
  --chrome-shadow: #1f2022;
  --panel: #bdbdbd;
  --ink: #0a0a0a;
  --paper: #f4f4f4;
  --focus: #ffe56e;
  --font-ui: "Courier New", Courier, monospace;
  --reflection-water: url("assets/water.gif");
  --shell-width: 1060px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 700;
  background: #08275a;
  image-rendering: pixelated;
}

.water-reflections {
  position: absolute;
  inset: -4%;
  z-index: 1;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms steps(3, end);
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

.water-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08275a;
}

.water-background picture,
.water-background img {
  display: block;
  width: 100%;
  height: 100%;
}

.water-background img {
  object-fit: cover;
  filter: none;
  opacity: 1;
  image-rendering: pixelated;
  transition:
    filter 180ms steps(3, end),
    opacity 180ms steps(3, end);
}

body[data-background="rainbow4"] .water-background img {
  filter: brightness(0.72) saturate(0.92) contrast(1.04);
  opacity: 0.74;
}

body[data-background="rainbow4"] .water-reflections {
  background-image:
    linear-gradient(
      108deg,
      #ff237c 0%,
      #ff9d2f 17%,
      #ffe83f 31%,
      #24f2ad 48%,
      #2aa8ff 65%,
      #7443ff 82%,
      #ff2bd7 100%
    ),
    var(--reflection-water);
  background-repeat: no-repeat;
  background-position: 0% 50%, center;
  background-size: 160% 100%, cover;
  background-blend-mode: color, normal;
  mix-blend-mode: screen;
  opacity: 0.58;
  animation: rainbow-soft-reflection 6.8s steps(20, end) infinite alternate;
}

body[data-background="rainbow4"] .water-background {
  background: #368fd0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: #000;
  transform: translateY(-150%);
}

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

.site-bar,
.site-footer {
  width: 100%;
  min-height: 64px;
  color: #fff;
  background: linear-gradient(180deg, #616368 0%, #44464a 100%);
  border: 2px solid var(--chrome-light);
  box-shadow:
    inset 2px 2px 0 #9b9da1,
    inset -2px -2px 0 var(--chrome-shadow),
    0 2px 0 #111;
}

.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}


.brand {
  display: inline-flex;
  min-width: 260px;
  align-items: center;
  gap: 14px;
  padding: 6px 22px;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  text-shadow: 2px 2px 0 #111;
}

.brand img {
  width: 32px;
  height: auto;
  filter: invert(1);
  image-rendering: pixelated;
}

.site-nav {
  display: flex;
  align-items: stretch;
}

.site-nav a {
  display: grid;
  min-width: 160px;
  place-items: center;
  padding: 0 24px;
  color: #fff;
  font-size: 1.18rem;
  text-align: center;
  text-decoration: none;
  text-shadow: 2px 2px 0 #111;
  border-left: 2px solid var(--chrome-light);
  box-shadow: inset 2px 0 0 #202124;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="true"] {
  color: #fff;
  background: #303236;
  outline: none;
  box-shadow:
    inset 2px 2px 0 #1b1c1e,
    inset -2px -2px 0 #85878b;
}

.site-nav a:focus-visible,
.bevel-button:focus-visible,
summary:focus-visible,
.game-preview:focus-visible,
.brand:focus-visible,
.site-footer a:focus-visible,
.privacy-content a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -5px;
}

.page-shell {
  width: min(var(--shell-width), calc(100% - 32px));
  min-height: calc(100vh - 148px);
  margin: 0 auto;
  padding: 30px 0 34px;
}

.hero {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  padding: 26px 0 18px;
  color: #fff;
  text-align: center;
}

.pixel-logo {
  image-rendering: pixelated;
}

.hero-logo {
  width: 150px;
  height: auto;
  filter:
    drop-shadow(2px 0 0 #e7e7e7)
    drop-shadow(-2px 0 0 #e7e7e7)
    drop-shadow(0 2px 0 #e7e7e7)
    drop-shadow(0 -2px 0 #e7e7e7)
    drop-shadow(4px 4px 0 #000);
}

.hero h1 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  text-shadow: 3px 3px 0 #111;
}

.accordion-stack {
  display: grid;
  gap: 10px;
}

.panel,
.panel-static {
  border: 2px solid var(--chrome-light);
  background: var(--panel);
  box-shadow:
    inset 2px 2px 0 #f7f7f7,
    inset -2px -2px 0 #3d3d3d,
    4px 4px 0 rgba(0, 0, 0, 0.65);
}

.panel summary,
.panel-title {
  min-height: 46px;
  color: #fff;
  background: linear-gradient(180deg, #66686b 0%, #47494d 100%);
  border-bottom: 2px solid #27282a;
  text-shadow: 2px 2px 0 #111;
}

.panel summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 16px 8px 56px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.panel summary::-webkit-details-marker {
  display: none;
}

.panel summary::before {
  position: absolute;
  width: 34px;
  height: 29px;
  margin-left: -48px;
  content: "";
  background: linear-gradient(180deg, #777 0%, #555 100%);
  border: 1px solid #e8e8e8;
  box-shadow:
    inset 1px 1px 0 #aaa,
    inset -1px -1px 0 #222;
}

.caret {
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-bottom: 9px solid #111;
  border-left: 7px solid transparent;
  filter: drop-shadow(1px 1px 0 #ddd);
  transition: transform 120ms steps(2, end);
}

.panel:not([open]) .caret {
  transform: rotate(180deg);
}

.panel-content {
  animation: panel-in 120ms steps(3, end) both;
}

.game-panel-content {
  display: grid;
  grid-template-columns: 180px minmax(250px, 1fr) 230px;
  gap: 36px;
  align-items: center;
  min-height: 240px;
  padding: 18px 28px;
  background: linear-gradient(90deg, #b8b8b8 0%, #c6c6c6 55%, #a9a9a9 100%);
  box-shadow:
    inset 2px 2px 0 #e8e8e8,
    inset -2px -2px 0 #747474;
}

.game-list {
  background: #b9b9b9;
}

.game-panel-content + .game-panel-content {
  border-top: 2px solid #707070;
  box-shadow: inset 0 2px 0 #e8e8e8;
}

.game-icon {
  display: block;
  width: 100%;
  height: auto;
  border: 10px solid #f5f5f5;
  box-shadow:
    0 0 0 2px #111,
    4px 4px 0 #666;
}

.game-copy h2,
.game-detail h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow:
    2px 0 0 #444,
    -2px 0 0 #444,
    0 2px 0 #444,
    0 -2px 0 #444,
    3px 3px 0 #333;
}

.game-copy p,
.game-detail p {
  margin: 0 0 24px;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.bevel-button {
  display: inline-block;
  min-width: 170px;
  padding: 10px 18px 8px;
  color: #111;
  font: inherit;
  text-align: center;
  text-decoration: none;
  background: #c9c9c9;
  border: 2px solid;
  border-color: #f9f9f9 #353535 #353535 #f9f9f9;
  box-shadow:
    inset 2px 2px 0 #e9e9e9,
    inset -2px -2px 0 #777,
    2px 2px 0 #666;
}

.bevel-button:hover,
.bevel-button:focus-visible {
  background: #dedede;
}

.bevel-button:active {
  padding: 11px 17px 7px 19px;
  border-color: #353535 #f9f9f9 #f9f9f9 #353535;
  box-shadow: inset 2px 2px 0 #777;
}

.game-preview {
  display: block;
  width: 100%;
  height: 178px;
  overflow: hidden;
  background: #000;
  border: 5px solid #e5e5e5;
  box-shadow:
    0 0 0 2px #222,
    inset 0 0 0 1px #fff,
    3px 3px 0 #666;
}

.game-preview img {
  width: 100%;
  height: auto;
  object-position: top center;
}

.game-preview-art img {
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.compact-content {
  padding: 28px 36px;
  text-align: center;
  background: #b9b9b9;
  box-shadow:
    inset 2px 2px 0 #e9e9e9,
    inset -2px -2px 0 #777;
}

.compact-content p {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.editorial-content {
  padding: 30px 36px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  background: #c6c6c6;
  box-shadow:
    inset 2px 2px 0 #e8e8e8,
    inset -2px -2px 0 #747474;
}

.editorial-content h2 {
  margin: 0 0 10px;
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.editorial-content p {
  max-width: 78ch;
  margin: 0;
}

.editorial-content p + p {
  margin-top: 14px;
}

.editorial-content a {
  color: #042d8e;
  font-weight: 700;
}

.about-studio-content {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.about-studio-content .section-logo {
  width: 82px;
}

.section-logo {
  width: 54px;
  height: auto;
}

.site-footer {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #222;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-page {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 124px);
  justify-items: stretch;
  align-content: start;
}

.game-page > .flat-screen-frame {
  width: 100%;
  max-width: 547px;
  justify-self: center;
}

.content-panel,
.game-detail {
  width: 100%;
}

.content-panel-body,
.privacy-content {
  padding: 28px 34px;
  background: #c6c6c6;
  box-shadow:
    inset 2px 2px 0 #e8e8e8,
    inset -2px -2px 0 #747474;
}

.content-panel-body p {
  margin: 0;
  line-height: 1.55;
}

.content-panel-body p + p {
  margin-top: 18px;
}

.content-panel-body h2 {
  margin: 22px 0 18px;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.privacy-page {
  min-height: calc(100vh - 124px);
}

.privacy-content {
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.55;
}

.privacy-content h1,
.privacy-content h2 {
  font-family: var(--font-ui);
}

.privacy-content h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.privacy-content h2 {
  margin: 30px 0 8px;
  font-size: 1.2rem;
}

.privacy-content p,
.privacy-content ul {
  max-width: 76ch;
}

.privacy-content a {
  color: #042d8e;
  font-weight: 700;
}

.panel-title {
  display: flex;
  align-items: center;
  padding: 9px 22px 8px;
}

.game-detail-header {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 40px;
  align-items: center;
  padding: 28px;
}

.flat-screen-frame {
  max-width: 547px;
  max-height: none;
  margin: 0 auto 32px;
  overflow: hidden;
  background: #000;
  border: 8px solid #dedede;
  box-shadow:
    0 0 0 2px #222,
    4px 4px 0 #666;
}

.flat-screen-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.monkeys-screen-frame {
  background: #f4ebd8;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rainbow-soft-reflection {
  from {
    background-position: 0% 50%, center;
    filter: brightness(0.52) contrast(2) saturate(1.65) hue-rotate(-4deg);
    opacity: 0.54;
  }

  to {
    background-position: 100% 50%, center;
    filter: brightness(0.6) contrast(2.1) saturate(1.9) hue-rotate(10deg);
    opacity: 0.62;
  }
}

@media (max-width: 900px) {
  .brand {
    min-width: auto;
  }

  .site-nav a {
    min-width: 118px;
    padding: 0 15px;
  }

  .game-panel-content {
    grid-template-columns: 140px 1fr;
  }

  .game-preview {
    grid-column: 1 / -1;
    width: min(100%, 380px);
    height: 140px;
    justify-self: center;
  }

}

@media (max-width: 640px) {
  .site-bar {
    position: relative;
    flex-direction: column;
  }

  .brand {
    min-height: 54px;
    justify-content: center;
    padding: 6px 14px;
  }

  .site-nav {
    border-top: 2px solid var(--chrome-light);
  }

  .site-nav a {
    min-width: 0;
    min-height: 50px;
    flex: 1;
    padding: 0 8px;
    font-size: 0.95rem;
  }

  .site-nav a:first-child {
    border-left: 0;
  }

  .page-shell {
    width: min(100% - 18px, var(--shell-width));
    padding-top: 12px;
  }

  .hero {
    min-height: 245px;
  }

  .hero-logo {
    width: 120px;
  }

  .hero h1 {
    font-size: 2rem;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
  }

  .panel summary {
    min-height: 48px;
    padding-right: 12px;
    padding-left: 52px;
    font-size: 0.78rem;
  }

  .game-panel-content,
  .game-detail-header {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px;
    text-align: center;
  }

  .game-icon {
    width: 140px;
    margin: 0 auto;
  }

  .game-copy h2,
  .game-detail h1 {
    font-size: 2rem;
  }

  .game-preview {
    height: 128px;
  }

  .about-studio-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .about-studio-content .section-logo {
    margin: 0;
    width: 54px;
  }

  .about-studio-content > div {
    min-width: 0;
  }

  .compact-content {
    padding: 24px 18px;
  }

  .editorial-content {
    padding: 26px 30px;
    font-size: 0.92rem;
    line-height: 1.75;
    letter-spacing: 0;
    overflow-wrap: break-word;
  }

  .editorial-content h2 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
  }

  .editorial-content p {
    max-width: none;
  }

  .editorial-content p + p {
    margin-top: 2.25em;
  }

  .flat-screen-frame {
    margin-right: 20px;
    margin-left: 20px;
  }

  .content-panel-body,
  .privacy-content {
    padding: 22px 20px;
  }

  .site-footer {
    gap: 18px;
    padding: 12px;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --reflection-water: url("assets/water-still.png");
  }

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
