/* SIDHE Games Studio — site styles */

@font-face {
  font-family: "Marcellus";
  src: url("../fonts/marcellus-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  /* Everything except the digits 0-9, which fall through to Spectral. */
  unicode-range: U+0000-002F, U+003A-10FFFF;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #050d1f;        /* page ground: the sky at the top of the key art */
  --deep: #0a1a38;         /* raised ground */
  --lake: #10294f;         /* lines and quiet fills */
  --moon: #e6eef8;         /* main text */
  --mist: #a9bcd6;         /* secondary text */
  --frost: #9fdcff;        /* the wordmark's glow, used sparingly */
  --firefly: #f4c95d;      /* the one warm accent */
  --firefly-deep: #c99a2e;

  --display: "Marcellus", "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --text: "Spectral", "Iowan Old Style", Georgia, serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --wide: 78rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--firefly); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: #ffe3a0; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(2rem, 1.3rem + 3.2vw, 4rem); letter-spacing: 0.005em; }
h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--firefly); color: var(--night); padding: 0.6rem 1rem;
  text-decoration: none; border-radius: 4px;
}
.skip:focus { top: 1rem; color: var(--night); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem var(--gutter);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.nav.is-solid {
  background: rgba(5, 13, 31, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(159, 220, 255, 0.12);
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--moon); text-decoration: none;
  font-family: var(--display); font-size: 1.125rem; letter-spacing: 0.04em;
}
.brand:hover { color: #fff; }
.brand img { width: 44px; height: 44px; }

.nav-links {
  display: flex; gap: clamp(1rem, 2.2vw, 2.25rem);
  list-style: none; margin: 0; padding: 0;
  font-size: 1.0625rem;
}
.nav-links a {
  color: var(--moon); text-decoration: none; padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  text-shadow: 0 1px 12px rgba(5, 13, 31, 0.9);
}
.nav-links a:hover { color: #fff; border-bottom-color: var(--firefly); }

.nav-toggle {
  display: none;
  background: rgba(5, 13, 31, 0.6); color: var(--moon);
  border: 1px solid rgba(159, 220, 255, 0.35); border-radius: 4px;
  font: inherit; font-size: 1rem; padding: 0.45rem 0.9rem; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; right: var(--gutter); left: var(--gutter);
    flex-direction: column; gap: 0;
    background: rgba(5, 13, 31, 0.97);
    border: 1px solid rgba(159, 220, 255, 0.2); border-radius: 6px;
    padding: 0.5rem 1.25rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 0.8rem 0; font-size: 1.125rem; }
  .nav-links li + li { border-top: 1px solid rgba(159, 220, 255, 0.1); }
}

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

.hero {
  position: relative;
  min-height: max(100svh, 38rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--night);
  isolation: isolate;
}
.hero-art {
  position: absolute; inset: -12px; z-index: -3;
  width: calc(100% + 24px); height: calc(100% + 24px); max-width: none;
  object-fit: cover; object-position: 50% 28%;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  will-change: transform;
}
.hero-flies { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 13, 31, 0.55) 0%, rgba(5, 13, 31, 0) 16%),
    linear-gradient(to top, var(--night) 0%, rgba(5, 13, 31, 0.86) 16%, rgba(5, 13, 31, 0.35) 36%, rgba(5, 13, 31, 0) 54%);
}
.hero-copy {
  width: min(100% - 2 * var(--gutter), 52rem);
  margin-inline: auto;
  padding-bottom: clamp(2.5rem, 7vh, 5rem);
  text-align: center;
}
.hero-line {
  font-family: var(--display);
  font-size: clamp(1.375rem, 1rem + 1.6vw, 2.125rem);
  line-height: 1.3;
  max-width: none;
  margin: 0 0 1.75rem;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(5, 13, 31, 0.95);
}
.actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--display); font-size: 1.125rem; letter-spacing: 0.03em;
  padding: 0.85rem 1.75rem; border-radius: 3px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-gold { background: var(--firefly); color: #1a1403; }
.btn-gold:hover { background: #ffe08a; color: #1a1403; }
.btn-line { color: var(--moon); border-color: rgba(230, 238, 248, 0.55); background: rgba(5, 13, 31, 0.35); }
.btn-line:hover { color: #fff; border-color: #fff; }

/* The one orchestrated moment: the world settles in, then the words arrive. */
@media (prefers-reduced-motion: no-preference) {
  .hero-art { animation: settle 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy { animation: arrive 1.1s ease 0.9s both; }
  @keyframes settle {
    from { opacity: 0; scale: 1.07; }
    to { opacity: 1; scale: 1; }
  }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

/* Tall, narrow screens: show the art as a banner so the wordmark stays whole. */
@media (max-aspect-ratio: 1/1) {
  .hero { min-height: 0; display: block; padding-top: 4.25rem; }
  .hero-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
  .hero-art { inset: 0; width: 100%; height: 100%; max-width: 100%; object-position: 50% 40%; transform: none; }
  .hero::after { display: none; }
  .hero-frame::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, var(--night) 0%, rgba(5, 13, 31, 0) 30%);
  }
  .hero-copy { padding: 1.5rem 0 3rem; }
}
@media (min-aspect-ratio: 1/1) {
  .hero-frame { display: contents; }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-head { margin-bottom: clamp(2rem, 5vw, 4rem); }
.section-head p { color: var(--mist); margin-top: 1.1rem; }

.lede {
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.5;
}

/* The game */
.game-grid {
  display: grid; gap: clamp(2.5rem, 6vw, 6rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}
.game-grid h2 { margin-bottom: 1.75rem; }
.facts { margin: 0; border-top: 1px solid var(--lake); }
.facts > div {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--lake);
}
.facts dt { color: var(--mist); }
.facts dd { margin: 0; font-family: var(--display); font-size: 1.25rem; line-height: 1.3; }
@media (max-width: 820px) {
  .game-grid { grid-template-columns: 1fr; }
}

/* What players do: wide image bands, alternating sides */
.band {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-bottom: clamp(3rem, 8vw, 7rem);
}
.band:last-child { margin-bottom: 0; }
.band figure { margin: 0; }
.band img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(159, 220, 255, 0.12);
}
.band-left { margin-left: calc(-1 * var(--gutter)); }
.band-right { margin-right: calc(-1 * var(--gutter)); }
.band-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.band-right figure { order: 2; }
.band h3 { margin-bottom: 1rem; }
.band p { color: var(--mist); }
@media (min-width: 1400px) {
  .band-left { margin-left: -6rem; }
  .band-right { margin-right: -6rem; }
}
@media (max-width: 820px) {
  .band { grid-template-columns: 1fr; gap: 1.5rem; }
  .band-left, .band-right { margin-inline: 0; }
  .band-right figure { order: 0; }
}

figcaption, .note { color: var(--mist); font-size: 0.9375rem; font-style: italic; }
figcaption { margin-top: 0.6rem; }
.band-left figcaption { padding-left: var(--gutter); }
.band-right figcaption { text-align: right; padding-right: var(--gutter); }
@media (max-width: 820px) {
  .band-left figcaption, .band-right figcaption { padding: 0; text-align: left; }
}

/* The look of the world */
.look { background: linear-gradient(to bottom, var(--night), var(--deep) 30%, var(--deep) 70%, var(--night)); }
.mosaic {
  display: grid; gap: clamp(0.5rem, 1vw, 0.9rem);
  grid-template-columns: repeat(4, 1fr);
}
.mosaic button {
  all: unset; cursor: zoom-in; display: block; position: relative; overflow: hidden; border-radius: 2px;
}
.mosaic button:focus-visible { outline: 2px solid var(--firefly); outline-offset: 3px; }
.mosaic img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: scale 0.6s ease; }
.mosaic button:hover img { scale: 1.03; }
.mosaic .big { grid-column: span 2; grid-row: span 2; }
.mosaic .big img { aspect-ratio: auto; }
@media (max-width: 700px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .mosaic .big { grid-column: span 2; grid-row: auto; }
  .mosaic .big img { aspect-ratio: 16 / 9; }
}
.look .note { margin-top: 1.25rem; max-width: none; }

/* Trailer */
.trailer { text-align: center; }
.trailer .section-head p { margin-inline: auto; }
.player {
  position: relative; aspect-ratio: 16 / 9; width: min(100%, 68rem); margin-inline: auto;
  background: #000; border-radius: 2px; overflow: hidden;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(159, 220, 255, 0.16);
}
.player iframe, .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.player-start {
  all: unset; position: absolute; inset: 0; cursor: pointer;
  display: grid; place-items: center;
  background: radial-gradient(circle at center, rgba(5, 13, 31, 0.15), rgba(5, 13, 31, 0.55));
}
.player-start:focus-visible { outline: 3px solid var(--firefly); outline-offset: -6px; }
.player-start span {
  display: grid; place-items: center;
  width: clamp(4.5rem, 9vw, 6.5rem); aspect-ratio: 1; border-radius: 50%;
  background: var(--firefly); color: #1a1403;
  box-shadow: 0 0 0 10px rgba(244, 201, 93, 0.18), 0 0 60px rgba(244, 201, 93, 0.5);
  transition: scale 0.25s ease;
}
.player-start:hover span { scale: 1.08; }
.player-start svg { width: 38%; margin-left: 8%; }
.trailer .note { margin: 1.25rem auto 0; }

/* The world behind the name */
.world { position: relative; isolation: isolate; overflow: hidden; }
.world::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("../img/willow.webp") center / cover no-repeat;
  opacity: 0.34;
}
.world::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, var(--night) 0%, rgba(5, 13, 31, 0.8) 42%, rgba(5, 13, 31, 0.15) 100%),
    linear-gradient(to bottom, var(--night) 0%, rgba(5, 13, 31, 0) 22%, rgba(5, 13, 31, 0) 78%, var(--night) 100%);
}
.world h2 { margin-bottom: 1.75rem; max-width: 16ch; }
.world p { max-width: 56ch; }
.world .say { font-style: italic; color: var(--frost); }

/* Studio */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 4rem); }
.trio > div { border-top: 1px solid var(--firefly-deep); padding-top: 1.5rem; }
.trio h3 { font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem); margin-bottom: 0.75rem; }
.trio p { color: var(--mist); }
@media (max-width: 820px) { .trio { grid-template-columns: 1fr; } }

/* Journal */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--lake); }
.entries li { border-bottom: 1px solid var(--lake); }
.entries a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 2rem; align-items: baseline;
  padding: 1.6rem 0; color: var(--moon); text-decoration: none;
}
.entries h3 { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); transition: color 0.2s ease; }
.entries a:hover h3 { color: var(--firefly); }
.entries time { color: var(--mist); white-space: nowrap; }
.entries p { grid-column: 1 / -1; color: var(--mist); }
@media (max-width: 600px) {
  .entries a { grid-template-columns: 1fr; }
}

/* Contact */
.contact { text-align: center; }
.contact h2 { margin-bottom: 1.25rem; }
.contact p { margin-inline: auto; color: var(--mist); }
.form {
  width: min(100%, 36rem); margin: 2.5rem auto 0; text-align: left;
  display: grid; gap: 1.25rem;
}
.form-row { display: grid; gap: 0.4rem; }
.form label { color: var(--moon); font-size: 1rem; }
.form input[type="text"], .form input[type="email"], .form textarea {
  width: 100%; font: inherit; color: var(--moon);
  background: rgba(16, 41, 79, 0.45);
  border: 1px solid rgba(159, 220, 255, 0.28); border-radius: 3px;
  padding: 0.75rem 0.9rem;
}
.form textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }
.form input:focus-visible, .form textarea:focus-visible {
  outline: 2px solid var(--firefly); outline-offset: 1px; border-color: transparent;
}
.form .btn { justify-self: start; border: 0; }
.form .btn[disabled] { opacity: 0.6; cursor: default; }
.form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.6em; max-width: none; color: var(--moon); }
.form-status.is-error { color: #ffb4a8; }
.form-done {
  width: min(100%, 36rem); margin: 2.5rem auto 0;
  font-family: var(--display); font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem); line-height: 1.4;
  color: var(--moon);
  border-top: 1px solid var(--firefly-deep); padding-top: 1.5rem;
}

/* Footer */
.foot {
  border-top: 1px solid var(--lake);
  padding: 2.5rem var(--gutter) 3rem;
  display: grid; justify-items: center; gap: 1rem; text-align: center;
  color: var(--mist); font-size: 0.9375rem;
}
.foot .mark { width: min(15rem, 60vw); mix-blend-mode: screen; }
.foot p { margin: 0; max-width: 60ch; }

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none;
  width: 100vw; height: 100dvh; margin: 0;
}
.lightbox::backdrop { background: rgba(2, 6, 16, 0.94); }
.lightbox-inner { width: 100%; height: 100%; display: grid; place-items: center; padding: 3.5rem 1rem 1rem; }
.lightbox img { max-width: min(100%, 1280px); max-height: 100%; object-fit: contain; border-radius: 2px; }
.lightbox-close {
  position: fixed; top: 0.9rem; right: 1rem;
  background: transparent; color: var(--moon); cursor: pointer;
  border: 1px solid rgba(230, 238, 248, 0.5); border-radius: 3px;
  font: inherit; font-size: 1rem; padding: 0.4rem 0.9rem;
}
.lightbox-close:hover { border-color: #fff; color: #fff; }

/* ---------- Journal pages ---------- */

.post-head {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(8rem, 18vw, 13rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}
.post-art {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%; opacity: 0.5;
}
.post-head::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(5, 13, 31, 0.5) 0%, rgba(5, 13, 31, 0.55) 40%, var(--night) 100%);
}
.post-head .wrap, .post-body { width: min(100% - 2 * var(--gutter), 46rem); margin-inline: auto; }
.post-head h1 { font-size: clamp(2.25rem, 1.4rem + 4vw, 4.25rem); }
.post-head time { display: block; margin-top: 1.25rem; color: var(--mist); }
.post-body { padding-bottom: var(--section); }
.post-body h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem); margin: 2.6em 0 0.7em; }
.post-body p { max-width: none; }
.post-body .lede { margin-bottom: 1.4em; }
.post-body .back { display: inline-block; margin-top: 3.5rem; }

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