/* playeverrest.com: one page, dark dream night, mobile first. */

@font-face {
  font-family: "Everrest Title";
  src: url("/fonts/EverrestTitle-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Everrest Body";
  src: url("/fonts/EverrestBody-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --night: #0a0b16;
  --night-2: #12142a;
  --ink: #f4ecd8;
  --ink-dim: #b8b2c8;
  --gold: #f3c74f;
  --gold-hi: #ffe08a;
  --gold-deep: #9a6a12;
  --sky: #8fc3ff;
  --ember: #c84a5a;
  --gutter: 16px;
  /* Pixel fonts are drawn on a 16-unit grid: 16px and 32px land on whole device pixels. */
  --title: "Everrest Title", ui-monospace, monospace;
  --body: "Everrest Body", ui-sans-serif, system-ui, sans-serif;
  --plain: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html { background: var(--night); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  overflow-x: hidden;
}

a { color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.icon { width: 22px; height: 22px; fill: currentColor; shape-rendering: crispEdges; flex: none; }
.icon-play { width: 10px; height: 10px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) var(--gutter) max(28px, env(safe-area-inset-bottom));
  isolation: isolate;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--night) url("/media/loop/bg-wide.jpg") center / cover no-repeat;
}
@media (orientation: portrait) {
  .hero-bg { background-image: url("/media/loop/bg-tall.jpg"); }
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-video.is-playing { opacity: 1; }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 50% 52%, rgba(10, 11, 22, 0.6), rgba(10, 11, 22, 0) 75%),
    linear-gradient(180deg, rgba(10, 11, 22, 0.55) 0%, rgba(10, 11, 22, 0.15) 30%, rgba(10, 11, 22, 0.35) 62%, var(--night) 100%);
}

.hero-inner {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.logo { margin: 0; width: min(100%, 360px); }
.logo-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.55));
}

.hook {  /* the "X meets Y" line under the tagline (Aaron, Nov 5) */
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: 0.02em;
  opacity: 0.85;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9), 0 0 14px rgba(0, 0, 0, 0.8);
}
.tagline {
  margin: 0 0 6px;
  max-width: 22em;
  text-wrap: balance;
  font-size: 24px;
  line-height: 1.33;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.8);
}

/* Notched pixel corners, 4px steps. */
.btn-steam, .link, .player-badge, .player {
  --n: 4px;
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
}

.btn-steam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 64px;
  padding: 14px 24px 18px;
  font-family: var(--title);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 1px;
  color: #1b1206;
  text-decoration: none;
  background: var(--gold);
  box-shadow: inset 0 -6px 0 var(--gold-deep), inset 0 4px 0 var(--gold-hi);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn-steam:hover { background: var(--gold-hi); transform: translateY(-2px); }
.btn-steam:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 var(--gold-deep), inset 0 4px 0 var(--gold-hi); }
.btn-steam:focus-visible { outline: none; box-shadow: inset 0 0 0 4px #fff, inset 0 -8px 0 var(--gold-deep); }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.link {
  --n: 2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(10, 11, 22, 0.62);
  box-shadow: inset 0 0 0 2px rgba(244, 236, 216, 0.38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.link:hover { background: rgba(18, 20, 42, 0.9); box-shadow: inset 0 0 0 2px var(--sky); color: #fff; }
.link:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #fff; }
.link[data-link="discord"]:hover .icon { color: #a8b4ff; }
.link[data-link="youtube"]:hover .icon { color: #ff6b6b; }
.link[data-link="instagram"]:hover .icon { color: #ff9ad0; }

.watch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 8px;
  font-size: 16px;
  color: var(--ink-dim);
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9);
}
.watch:hover, .watch:focus-visible { color: var(--gold-hi); }
.watch .icon { width: 10px; height: 10px; }

/* ---------- Trailer ---------- */

main { position: relative; }

.trailer { padding: 8px var(--gutter) 40px; }

.player {
  --n: 6px;
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 0 2px rgba(243, 199, 79, 0.45);
}
.player video { width: 100%; height: 100%; background: #000; }

.player-start {
  all: unset;
  position: absolute;
  inset: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.player-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}
.player-start:hover .player-poster { filter: brightness(1.12); }
.player-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 16px;
  font-family: var(--title);
  font-size: 16px;
  color: #1b1206;
  background: var(--gold);
  box-shadow: inset 0 -4px 0 var(--gold-deep);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.player-start:hover .player-badge { background: var(--gold-hi); transform: scale(1.05); }
.player-start:focus-visible .player-badge { box-shadow: inset 0 0 0 3px #fff; }
.player-noscript { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---------- About ---------- */

.about {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.about p {
  margin: 0;
  max-width: 34em;
  text-wrap: pretty;
  text-align: center;
  color: var(--ink);
}

.stills {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.stills img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(143, 195, 255, 0.18);
}

.btn-steam-sm { max-width: 320px; }

/* ---------- Footer ---------- */

.footer {
  padding: 28px var(--gutter) max(32px, env(safe-area-inset-bottom));
  border-top: 2px solid rgba(244, 236, 216, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  font-family: var(--plain);
  font-size: 14px;
  color: var(--ink-dim);
  -webkit-font-smoothing: auto;
}
.footer p { margin: 0; }
.footer a { color: var(--ink-dim); text-decoration-color: rgba(184, 178, 200, 0.4); text-underline-offset: 3px; }
.footer a:hover { color: var(--ink); }

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .hero-inner { gap: 22px; }
  .logo { width: min(100%, 560px); }
  .tagline { font-size: 32px; line-height: 1.25; }
  .hook { font-size: 24px; }
  .btn-steam { width: auto; min-width: 380px; min-height: 76px; font-size: 32px; padding: 16px 40px 22px; }
  .btn-steam-sm { min-width: 320px; min-height: 64px; font-size: 24px; }
  .link { padding: 10px 18px; }
  .trailer { padding-bottom: 56px; }
  .player-badge { font-size: 24px; padding: 16px 28px 20px; }
  .about { gap: 40px; padding-bottom: 72px; }
  .about p { font-size: 24px; line-height: 1.5; }
  .stills { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 720px) and (max-height: 760px) {
  .logo { width: min(100%, 440px); }
  .hero-inner { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Press kit (/press/) ---------- */

.press-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: max(28px, env(safe-area-inset-top)) var(--gutter) 24px; }
.press-logo { width: min(100%, 300px); }
.press-logo img { width: 100%; height: auto; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.55)); }
.press-title { margin: 0; font-family: var(--title); font-weight: normal; font-size: 32px; line-height: 1.1; color: var(--gold); }
.press-line { margin: 0; max-width: 22em; text-wrap: balance; font-size: 24px; line-height: 1.33; }
.btn-zip {
  --n: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 360px; min-height: 52px; padding: 10px 16px;
  font-size: 16px; text-decoration: none; color: var(--ink);
  background: rgba(10, 11, 22, 0.62);
  box-shadow: inset 0 0 0 2px rgba(244, 236, 216, 0.38);
  clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
}
.btn-zip:hover { background: rgba(18, 20, 42, 0.9); box-shadow: inset 0 0 0 2px var(--sky); color: #fff; }
.btn-zip:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #fff; }

.press-main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.press-sec { padding: 24px 0; border-top: 2px solid rgba(244, 236, 216, 0.08); }
.press-sec h2 { margin: 0 0 16px; font-family: var(--title); font-weight: normal; font-size: 24px; line-height: 1.1; color: var(--gold); }
.press-about { margin: 0; max-width: 34em; text-wrap: pretty; }

.facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; max-width: 720px; }
.facts > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 8px 0; border-bottom: 2px solid rgba(244, 236, 216, 0.06); }
.facts dt { color: var(--ink-dim); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { text-underline-offset: 3px; }
.facts a:hover { color: var(--gold-hi); }

.press-video { max-width: 1120px; aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 2px rgba(243, 199, 79, 0.45); }
.press-video video { width: 100%; height: 100%; }
.press-cap { margin: 12px 0 0; color: var(--ink-dim); }
.press-links { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.press-links .link { text-align: left; }

.press-shots a { display: block; }
.press-shots a:hover img, .press-shots a:focus-visible img { box-shadow: 0 0 0 2px var(--sky); }

.press-art { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.press-art a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.press-art a:hover { color: var(--gold-hi); }
.art-tile { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 12px; background: var(--night-2); box-shadow: 0 0 0 2px rgba(143, 195, 255, 0.18); }
.art-tile img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.press-end { display: flex; justify-content: center; }

@media (min-width: 720px) {
  .press-logo { width: 360px; }
  .press-title { font-size: 48px; }
  .press-line { font-size: 32px; }
  .press-sec { padding: 32px 0; }
  .press-sec h2 { font-size: 32px; }
  .press-shots { grid-template-columns: repeat(2, 1fr); }
  .press-art { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 1000px) { .press-shots { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Email sign-up ---------- */
.optin { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.optin-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; margin: 0; }
.optin-row { display: flex; width: 100%; gap: 8px; }
.optin-email {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px;
  font-family: var(--body); font-size: 16px; color: var(--ink);
  background: rgba(18, 20, 42, 0.85); border: 0; border-radius: 0;
  box-shadow: inset 0 0 0 2px rgba(184, 178, 200, 0.35);
}
.optin-email::placeholder { color: var(--ink-dim); }
.optin-email:focus { outline: none; box-shadow: inset 0 0 0 2px var(--sky); }
.optin-btn {
  flex: 0 0 auto; height: 44px; padding: 0 16px 4px; cursor: pointer;
  font-family: var(--title); font-size: 16px; letter-spacing: 1px; color: var(--ink);
  background: rgba(18, 20, 42, 0.9); border: 0; border-radius: 0;
  box-shadow: inset 0 0 0 2px var(--sky);
}
.optin-btn:hover { background: var(--night-2); color: #fff; }
.optin-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #fff; }
.optin-btn[disabled] { opacity: 0.6; cursor: default; }
.optin-note { margin: 0; font-size: 16px; line-height: 1.3; color: var(--ink-dim); text-align: center; }
.optin.done .optin-row { display: none; }
.optin.done .optin-note { color: var(--gold-hi); font-size: 24px; }
.optin.fail .optin-note { color: var(--ember); }
@media (min-width: 720px) { .optin { max-width: 420px; } }

/* ---------- Thank-you pop-up (after a sign-up) ---------- */
/* Two Tabibis on a canvas (thanks/tabibi-stage.js), drawn 1:1 and scaled by whole numbers. */
.thanks {
  width: min(448px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  max-height: calc(100svh - 16px);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: transparent;
  color: var(--ink);
}
.thanks::backdrop { background: rgba(5, 6, 14, 0.8); }
.thanks-card {
  --n: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 20px;
  text-align: center;
  background: var(--night-2);
  box-shadow: inset 0 0 0 2px var(--sky), inset 0 0 0 4px var(--night-2), inset 0 0 0 6px rgba(143, 195, 255, 0.25);
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
}
.thanks-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink-dim);
  background: transparent;
  cursor: pointer;
}
.thanks-close .icon { width: 14px; height: 14px; }
.thanks-close:hover { color: #fff; }
.thanks-close:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #fff; }
.thanks-stage-box { width: 100%; display: flex; justify-content: center; padding-top: 4px; }
.thanks-stage {
  display: block;
  width: 300px;
  height: 228px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #232a58;
}
.thanks-title {
  margin: 4px 0 0;
  font-family: var(--title);
  font-weight: normal;
  font-size: 24px;
  line-height: 1.33;
  letter-spacing: 1px;
  color: var(--gold-hi);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9);
}
.thanks-title:focus { outline: none; }
.thanks-body, .thanks-more { margin: 0; max-width: 34ch; font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.thanks-more { color: var(--ink-dim); }
.thanks-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
.thanks-links .link { min-height: 44px; padding: 8px 14px; }
@media (min-width: 480px) {
  .thanks-card { padding: 20px 24px 24px; }
  .thanks-title { font-size: 32px; line-height: 1.25; }
}

.about .madeby { margin-top: 18px; font-size: 15px; line-height: 1.5; opacity: .75; }
.about .madeby a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.footer-follow { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.press-about + .press-about { margin-top: 14px; }
