/* The published site's one stylesheet.
 *
 * Two palettes, chosen per page by data-theme on <html>. "studio" is the
 * Feldsparc identity from games/crushdepth/game/art/feldsparc_brand.gd: warm
 * stone ground, feldspar cream, one vermilion accent. "abyss" is the game's
 * Abyssal Glow from games/crushdepth/game/art/crush_palette.gd. Keeping the
 * studio deliberately off the game's palette is the same rule the boot splash
 * and the Play developer plates follow, so the studio never reads as one more
 * Fathom Reach screen.
 *
 * Nothing here loads from a third party. The privacy policy says the game sends
 * us nothing you did not choose to send, and a site that phones a font CDN on
 * every visit would undercut that.
 */

@font-face {
  font-family: 'Exo 2';
  src: url('/assets/fonts/exo2.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Plex Sans';
  src: url('/assets/fonts/plex-sans.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  font-style: normal;
}

:root {
  --display: 'Exo 2', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --body: 'Plex Sans', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --band: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 3px;
}

[data-theme='studio'] {
  --ground: #1e1b1b;
  --raised: #262222;
  --sunk: #171414;
  --line: #3a3230;
  --ink: #e7ddc8;
  --ink-quiet: #a9a094;
  --accent: #f04a2f;
  --accent-ink: #1e1b1b;
  --warm: #d7aa9b;
  --halo: rgba(240, 74, 47, 0.18);
}

[data-theme='abyss'] {
  --ground: #06121a;
  --raised: #0e2630;
  --sunk: #040d13;
  --line: #23515c;
  --ink: #dffafe;
  --ink-quiet: #7fa6ad;
  --accent: #5fd6e0;
  --accent-ink: #04161c;
  --warm: #ffb347;
  --halo: rgba(95, 214, 224, 0.16);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* The studio ground carries the same fine diagonal striation as the developer
 * plates, at an opacity that reads as material rather than pattern. */
[data-theme='studio'] body {
  background-image: repeating-linear-gradient(
    118deg,
    rgba(231, 221, 200, 0.028) 0 1px,
    transparent 1px 46px
  );
}

/* The game ground keeps one upper key light, the way every screen in the game
 * is lit from above. */
[data-theme='abyss'] body {
  background-image: radial-gradient(
    120% 62% at 50% -14%,
    rgba(95, 214, 224, 0.11),
    transparent 62%
  );
  background-repeat: no-repeat;
}

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

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.005em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
}

h3 {
  font-size: 1.16rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

p {
  margin: 0 0 1.1em;
  /* Keeps a last line from falling to a single orphaned word. Ignored by
     browsers that do not have it, which costs nothing. */
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 20;
}

.skip:focus {
  left: 0;
}

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

.wrap.narrow {
  max-width: 48rem;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 88%, black);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.9rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand img {
  width: 1.55rem;
  height: 1.55rem;
}

.masthead nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--ink-quiet);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.masthead nav a:hover {
  color: var(--ink);
}

.masthead nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.8rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--halo);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
      to bottom,
      rgba(6, 18, 26, 0.42) 0%,
      rgba(6, 18, 26, 0.24) 42%,
      rgba(6, 18, 26, 0.9) 88%,
      var(--ground) 100%
    ),
    linear-gradient(to right, rgba(4, 13, 19, 0.8) 0%, rgba(4, 13, 19, 0.45) 34%, rgba(4, 13, 19, 0) 72%);
}

.hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(82vh, 46rem);
  /* Only the block edges: the shorthand would reset the .wrap gutter this
     element also carries, and put the headline against the screen edge. */
  padding-top: clamp(4rem, 12vw, 9rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.hero-logo {
  width: min(30rem, 78%);
  margin-bottom: 1.6rem;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
}

.hero-lede {
  font-size: clamp(1.12rem, 2.3vw, 1.4rem);
  max-width: 33rem;
  color: var(--ink);
  margin-bottom: 0;
}

.tagline {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--warm);
  margin: 0 0 1rem;
}

.hero-note {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-quiet);
}

/* ------------------------------------------------------------- studio hero */

.studio-hero {
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5.5rem);
  border-bottom: 1px solid var(--line);
}

.studio-lockup {
  width: min(24rem, 72%);
  margin-bottom: clamp(2.2rem, 6vw, 3.6rem);
}

.studio-hero h1 {
  max-width: 16ch;
  margin-bottom: 0.7em;
}

.lede {
  font-size: clamp(1.08rem, 2.1vw, 1.3rem);
  color: var(--ink-quiet);
  max-width: 30rem;
  margin-bottom: 0;
}

/* ------------------------------------------------------------------- bands */

.band {
  padding: var(--band) 0;
}

.band + .band {
  padding-top: 0;
}

/* A sunk band opens a new region behind its own border, so it keeps the top
   padding a plain band gives up when it follows another band. */
.band.sunk {
  padding-top: var(--band);
  background: var(--sunk);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band.sunk + .band {
  padding-top: var(--band);
}

.band-head {
  max-width: var(--measure);
  margin-bottom: 2.6rem;
}

.column {
  max-width: 44rem;
}

.column p,
.column li {
  max-width: var(--measure);
}

.band-head p {
  color: var(--ink-quiet);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- features */

.feature {
  display: grid;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.feature:last-child {
  margin-bottom: 0;
}

@media (min-width: 56rem) {
  .feature {
    grid-template-columns: 1fr 1.3fr;
  }

  .feature .feature-text {
    grid-area: 1 / 1;
  }

  .feature figure {
    grid-area: 1 / 2;
  }

  /* Flipping swaps the sides without swapping the track widths, so the
   * screenshot stays the same size down the whole page. */
  .feature.flip {
    grid-template-columns: 1.3fr 1fr;
  }

  .feature.flip .feature-text {
    grid-area: 1 / 2;
  }

  .feature.flip figure {
    grid-area: 1 / 1;
  }
}

.feature-text h2 {
  margin-bottom: 0.5rem;
}

.feature-text ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-text li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.55rem;
  color: var(--ink-quiet);
}

.feature-text li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  transform: rotate(45deg);
}

.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sunk);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

figure {
  margin: 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--ink-quiet);
  margin-top: 0.7rem;
}

/* ------------------------------------------------------------------ trailer */

.trailer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: black;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.trailer video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

/* -------------------------------------------------------------- shots grid */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
}

.shots a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sunk);
  transition: border-color 120ms ease, transform 120ms ease;
}

.shots a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ------------------------------------------------------------------- facts */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.facts div {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
}

.facts dt {
  font-family: var(--display);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-bottom: 0.3rem;
}

.facts dd {
  margin: 0;
  font-size: 0.99rem;
}

/* ---------------------------------------------------------------- game card */

.game-card {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  overflow: hidden;
}

@media (min-width: 52rem) {
  .game-card {
    grid-template-columns: 1.15fr 1fr;
  }
}

.game-card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 15rem;
}

.game-card-body {
  padding: clamp(1.5rem, 4vw, 2.6rem);
  padding-left: 0;
}

@media (max-width: 51.99rem) {
  .game-card-body {
    padding-left: clamp(1.5rem, 4vw, 2.6rem);
  }
}

/* --------------------------------------------------------------- downloads */

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

.downloads li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: var(--raised);
}

.downloads a {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.downloads p {
  margin: 0.3rem 0 0;
  font-size: 0.87rem;
  color: var(--ink-quiet);
}

/* ------------------------------------------------------------------- prose */

.prose {
  padding: clamp(3rem, 7vw, 5rem) 0 var(--band);
}

.prose h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  margin-bottom: 1.2rem;
}

.prose h2 {
  font-size: 1.42rem;
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.prose h3 {
  font-size: 1.03rem;
  margin-top: 1.9rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0.01em;
}

.prose p,
.prose li {
  max-width: var(--measure);
}

.prose ul {
  padding-left: 1.15rem;
  margin: 0 0 1.2em;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li::marker {
  color: var(--accent);
}

.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.08em 0.32em;
}

/* --------------------------------------------------------------- colophon */

.colophon {
  border-top: 1px solid var(--line);
  background: var(--sunk);
  padding: clamp(2.5rem, 6vw, 4rem) 0 2.5rem;
  margin-top: auto;
}

.colophon-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.colophon-brand p {
  margin: 0;
  font-family: var(--display);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--ink-quiet);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: 0.9rem;
  margin-bottom: 1.6rem;
}

.colophon-links a {
  color: var(--ink-quiet);
  text-decoration: none;
}

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

.colophon-fine {
  margin: 0;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--ink-quiet) 72%, transparent);
}

.contact address {
  font-style: normal;
  color: var(--ink-quiet);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
