@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Small UI text: drawn on an 8px grid, so keep it at 16px for crisp pixels */
@font-face {
  font-family: "Silkscreen";
  src: url("/fonts/silkscreen-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --night: #0f1310;
  --night-2: #161c17;
  --night-3: #1f2720;
  --line: #2c362d;
  --snow: #eef1ea;
  --fog: #a8b8ab;
  --muted: #7f8f82;
  --grass: #8fd14f;
  --grass-dark: #5ea63a;
  --sky: #4364b8;
  --soil: #4a4037;

  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --pixel-ui: "Silkscreen", ui-monospace, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 60px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--night);
  color: var(--snow);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--grass);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--grass);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--pixel);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
}

p {
  margin: 0 0 1em;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  flex: none;
}

.label {
  font-family: var(--pixel-ui);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grass);
  margin: 0 0 0.75rem;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(15 19 16 / 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--pixel);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--snow);
  text-decoration: none;
}

.wordmark img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.75rem);
}

.site-nav a:not(.btn) {
  position: relative;
  padding: 0.6rem 0;
  font-family: var(--pixel-ui);
  font-size: 16px;
  text-transform: uppercase;
  color: var(--fog);
  text-decoration: none;
  transition: color 0.15s;
}

/* pixel underline that "draws" in steps */
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 3px;
  background: var(--grass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s steps(4);
}

.site-nav a:not(.btn):hover,
.site-nav a:not(.btn)[aria-current="page"] {
  color: var(--snow);
}

.site-nav a:not(.btn):hover::after,
.site-nav a:not(.btn)[aria-current="page"]::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a:not(.btn)::after {
    transition: none;
  }
}

.site-nav a {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .site-nav .hide-sm {
    display: none;
  }
}

/* Phones have dense screens, so off-grid sizes still look sharp there */
@media (max-width: 400px) {
  .site-header .wrap {
    gap: 0.5rem;
  }

  .site-nav {
    gap: 0.9rem;
  }

  .site-nav a:not(.btn) {
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  .site-nav a:not(.btn) {
    font-size: 12px;
  }
}

/* ---------- buttons ---------- */

.btn {
  --notch: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  font-family: var(--pixel);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  /* stepped pixel corners */
  clip-path: polygon(
    0 var(--notch), var(--notch) var(--notch), var(--notch) 0,
    calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%,
    var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch))
  );
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-steam {
  background: var(--grass);
  color: #10200a;
  box-shadow: inset 0 -4px 0 var(--grass-dark);
}

.btn-steam:hover {
  background: #a3e062;
  color: #10200a;
}

.btn-ghost {
  background: var(--night-3);
  color: var(--snow);
  box-shadow: inset 0 -4px 0 #111611;
}

.btn-ghost:hover {
  background: #2a352b;
  color: var(--snow);
}

.btn-sm {
  --notch: 3px;
  min-height: 36px;
  padding: 0.45rem 0.85rem;
  font-size: 0.95rem;
  box-shadow: inset 0 -3px 0 var(--grass-dark);
}

.btn-lg {
  min-height: 58px;
  padding: 0.9rem 1.8rem;
  font-size: 1.3rem;
}

.btn .icon {
  width: 1.3em;
  height: 1.3em;
}

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

/* ---------- home: intro ---------- */

.intro {
  position: relative;
  isolation: isolate;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: flex-end;
  padding: 7rem 0 4rem;
  overflow: hidden;
}

.intro > .wrap {
  width: 100%;
}

.intro-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.intro-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.intro-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(15 19 16 / 0.15) 0%, rgb(15 19 16 / 0.45) 45%, var(--night) 100%);
}

.intro h1 {
  font-size: clamp(3.5rem, 13vw, 7.5rem);
  margin: 0 0 0.15em;
  text-shadow: 0 4px 0 rgb(0 0 0 / 0.35);
}

.intro p {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--snow);
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.6);
}

/* ---------- home: featured game ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.feature-art {
  display: block;
  border: 3px solid var(--night-3);
  outline: 1px solid var(--line);
  transition: border-color 0.15s;
}

.feature-art:hover {
  border-color: var(--grass-dark);
}

.feature-art img {
  width: 100%;
  aspect-ratio: 1232 / 706;
  object-fit: cover;
}

.feature h3 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.meta li {
  font-size: 0.8rem;
  color: var(--fog);
  background: var(--night-2);
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
}

.feature p {
  color: var(--fog);
}

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

/* ---------- about / contact ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}

.split p {
  color: var(--fog);
  max-width: 36rem;
}

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

.email {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--pixel);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--snow);
  text-decoration: none;
  border-bottom: 2px solid var(--grass);
  padding-bottom: 0.15rem;
  margin-bottom: 1.75rem;
  word-break: break-all;
}

.email:hover {
  color: var(--grass);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  color: var(--snow);
  background: var(--night-2);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.95rem;
}

.socials a:hover {
  border-color: var(--grass-dark);
  color: var(--grass);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom));
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

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

.site-footer p {
  margin: 0;
}

/* ---------- carbon rain: hero ---------- */

.cr-hero {
  position: relative;
  background: var(--night);
}

.cr-hero picture img {
  width: 100%;
  max-height: calc(100vh - var(--header-h) - 150px);
  min-height: 300px;
  object-fit: cover;
  object-position: 50% 40%;
}

.cr-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--night));
  pointer-events: none;
}

.cr-cta {
  position: relative;
  z-index: 2;
  margin-top: -3.5rem;
  padding-bottom: 1rem;
  text-align: center;
}

.cr-cta .tagline {
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  color: var(--snow);
  margin: 0 auto 1.25rem;
  max-width: 34rem;
}

.cr-cta .btn-lg {
  width: min(100%, 420px);
}

.cta-note {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--fog);
}

.client-link {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

@media (hover: hover) and (pointer: fine) {
  .client-link {
    display: block;
  }
}

/* In-app browser hint (filled in by site.js) */
.iab-hint {
  max-width: 30rem;
  margin: 1.25rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--grass-dark);
  background: var(--night-2);
  font-size: 0.9rem;
  color: var(--fog);
  text-align: left;
}

.iab-hint[hidden] {
  display: none;
}

.iab-hint p {
  margin: 0 0 0.5rem;
}

.iab-hint p:last-child {
  margin: 0;
}

/* ---------- carbon rain: content ---------- */

.pitch > * {
  max-width: 44rem;
}

.pitch p {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--fog);
}

.pitch p:first-of-type {
  color: var(--snow);
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shots a {
  display: block;
  border: 2px solid var(--night-3);
  transition: border-color 0.15s;
}

.shots a:hover {
  border-color: var(--grass-dark);
}

.shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media (max-width: 640px) {
  /* swipeable row on phones */
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.6rem;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 0.5rem;
    scrollbar-width: none;
  }

  .shots::-webkit-scrollbar {
    display: none;
  }

  .shots li {
    flex: 0 0 86%;
    scroll-snap-align: center;
  }
}

.swipe-hint {
  display: none;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .swipe-hint {
    display: block;
  }
}

.loop {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.loop li {
  counter-increment: step;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
}

.loop li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--pixel-ui);
  font-size: 16px;
  color: var(--grass);
  margin-bottom: 0.35rem;
}

.loop h3 {
  font-size: 1.35rem;
  margin-bottom: 0.35em;
}

.loop p {
  color: var(--fog);
  margin: 0;
}

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

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
  margin: 0;
  border-top: 1px solid var(--line);
}

.facts div {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-family: var(--pixel-ui);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 640px) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.facts dd {
  margin: 0.2rem 1rem 0 0;
}

.cr-outro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(5rem, 14vw, 9rem) 0;
  text-align: center;
  border-top: 1px solid var(--line);
}

.cr-outro .intro-bg::after {
  background: linear-gradient(to bottom, var(--night) 0%, rgb(15 19 16 / 0.55) 40%, rgb(15 19 16 / 0.7) 100%);
}

.cr-outro h2 {
  text-shadow: 0 3px 0 rgb(0 0 0 / 0.35);
}

.cr-outro p {
  max-width: 30rem;
  margin: 0 auto 1.5rem;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.7);
}

.cr-outro .socials {
  justify-content: center;
  margin-top: 2rem;
}

.cr-outro .socials a {
  background: rgb(15 19 16 / 0.75);
}

/* ---------- sticky wishlist bar (phones) ---------- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
  background: rgb(15 19 16 / 0.96);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.2s ease-out;
}

.sticky-cta.is-visible {
  transform: none;
}

.sticky-cta span {
  font-family: var(--pixel);
  font-size: 1.05rem;
}

.sticky-cta small {
  display: block;
  font-family: var(--body);
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 800px) {
  .sticky-cta {
    display: flex;
  }

  body.has-sticky {
    padding-bottom: 76px;
  }
}

/* ---------- lightbox ---------- */

.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(5 7 5 / 0.94);
  color: var(--snow);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox img {
  max-width: min(96vw, 1600px);
  max-height: 86vh;
  width: auto;
}

.lightbox button {
  position: absolute;
  min-width: 48px;
  min-height: 48px;
  border: 0;
  background: var(--night-3);
  color: var(--snow);
  font: 600 1.25rem var(--pixel);
  cursor: pointer;
}

.lightbox button:hover {
  background: var(--grass);
  color: #10200a;
}

.lightbox .lb-close {
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
}

.lightbox .lb-prev,
.lightbox .lb-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .lb-prev {
  left: 12px;
}

.lightbox .lb-next {
  right: 12px;
}

@media (max-width: 640px) {
  .lightbox .lb-prev,
  .lightbox .lb-next {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: none;
  }
}

/* ---------- 404 ---------- */

.not-found {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.not-found h1 {
  font-size: clamp(4rem, 18vw, 9rem);
  color: var(--grass);
}

.not-found p {
  color: var(--fog);
}
