/* Spin Dungeon — official player website */

:root {
  --ink: #0c0a09;
  --ink-2: #161210;
  --panel: #241c18;
  --panel-2: #2f2620;
  --bone: #f0e6d4;
  --bone-dim: #b9aa94;
  --rust: #d2622e;
  --rust-hot: #e87840;
  --moss: #5a7d62;
  --gold: #e0b57a;
  --line: rgba(240, 230, 212, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1120px;
  --radius: 6px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--bone);
  background: var(--ink);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.65;
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rust-hot);
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(12, 10, 9, 0.78);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  color: var(--bone);
  text-decoration: none;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--bone-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: flex-end;
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone-dim);
  text-decoration: none;
}

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

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--rust);
}

/* Full-bleed hero */
.hero-stage {
  position: relative;
  min-height: min(86vh, 760px);
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-stage__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 10, 9, 0.15) 0%, rgba(12, 10, 9, 0.55) 55%, rgba(12, 10, 9, 0.96) 100%),
    url("../assets/promo/hero-keyart.png") center / cover no-repeat;
  z-index: -1;
  transform: scale(1.02);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.06) translate3d(-1.2%, -0.8%, 0);
  }
}

.hero-stage__content {
  padding: 5.5rem 0 3.2rem;
  max-width: 36rem;
}

.hero-stage__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-hot);
  margin: 0 0 0.85rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.hero-stage h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 4.6rem);
  line-height: 0.98;
  margin: 0 0 1rem;
  font-weight: 700;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.75);
}

.hero-stage__lead {
  font-size: 1.18rem;
  color: var(--bone);
  margin: 0 0 1.6rem;
  max-width: 32ch;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.hero-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--rust);
  color: #fff8f0;
  box-shadow: 0 10px 30px rgba(210, 98, 46, 0.35);
}

.btn--primary:hover {
  background: var(--rust-hot);
  color: #fff;
}

.btn--ghost {
  background: rgba(12, 10, 9, 0.45);
  border-color: rgba(240, 230, 212, 0.28);
  color: var(--bone);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Sections */
.section {
  padding: 3.2rem 0;
}

.section--tight {
  padding-top: 2rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}

.section__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
}

.section__head p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 0.95rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.4rem;
  align-items: stretch;
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 0.98rem;
}

.card a.card__link {
  display: inline-block;
  margin-top: 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
}

.feature-media {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 280px;
  background:
    linear-gradient(160deg, rgba(12, 10, 9, 0.15), rgba(12, 10, 9, 0.72)),
    url("../assets/promo/feature-ring.png") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.4rem 0;
}

.feature-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin: 0;
  line-height: 1.1;
}

.feature-copy p {
  margin: 0;
  color: var(--bone-dim);
  max-width: 38ch;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
}

/* Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--bone-dim);
  white-space: nowrap;
}

/* Codex */
.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.codex-item {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
}

/* Must beat .codex-item { display:flex } so filter hidden works */
.codex-item[hidden] {
  display: none !important;
}

.codex-item__art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(210, 98, 46, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(47, 38, 32, 0.85), rgba(12, 10, 9, 0.95));
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 4px;
}

.codex-item__art img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.codex-item__art--skill {
  position: relative;
  aspect-ratio: 56 / 80;
  background:
    radial-gradient(circle at 50% 35%, rgba(210, 98, 46, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(30, 24, 20, 0.9), rgba(12, 10, 9, 0.98));
}

.skill-card-img {
  width: 84px !important;
  height: 120px !important;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.skill-cost {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bone);
  line-height: 1;
}

.skill-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
}

.filter-bar {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}

.filter-chip:hover {
  color: var(--bone);
  border-color: rgba(210, 98, 46, 0.45);
}

.filter-chip.is-active {
  color: var(--ink);
  background: var(--ember, #d2622e);
  border-color: var(--ember, #d2622e);
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bone-dim);
  cursor: pointer;
}

.filter-count {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bone-dim);
}

.codex-item h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 0;
}

.codex-item p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 0.9rem;
  flex: 1;
}

.codex-item__trait {
  flex: 0 0 auto;
  margin: 0;
  color: var(--bone);
  font-size: 0.82rem;
  line-height: 1.45;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.codex-item__trait strong {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  color: var(--ember, #d2622e);
  margin-right: 0.35rem;
}

.codex-item__start {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.45;
}

.codex-item__start-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.codex-item__start-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
}

.codex-item__start-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ember, #d2622e);
}

.codex-item__start-link {
  display: inline-block;
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--bone-dim);
  text-decoration: none;
}

.codex-item__start-link:hover {
  color: var(--ember, #d2622e);
}

.codex-item__start ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  color: var(--bone);
}

.codex-item__start li span {
  display: inline-block;
  min-width: 2.2em;
  margin-right: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--bone-dim);
}

.codex-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sprite-anim {
  --fw: 48;
  --fh: 48;
  --cols: 5;
  --rows: 1;
  --frames: 5;
  --row: 0;
  --fps: 10;
  --scale: 2.5;
  --sheet-w: calc(var(--cols) * var(--fw) * 1px);
  --sheet-h: calc(var(--rows) * var(--fh) * 1px);
  width: calc(var(--fw) * var(--scale) * 1px);
  height: calc(var(--fh) * var(--scale) * 1px);
  background-repeat: no-repeat;
  background-size: calc(var(--sheet-w) * var(--scale)) calc(var(--sheet-h) * var(--scale));
  background-position: 0 calc(var(--row) * var(--fh) * var(--scale) * -1px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: sprite-strip calc(var(--frames) / var(--fps) * 1s) steps(var(--frames)) infinite;
}

.sprite-anim--flip {
  transform: scaleX(-1);
}

@keyframes sprite-strip {
  from {
    background-position: 0 calc(var(--row) * var(--fh) * var(--scale) * -1px);
  }
  to {
    background-position: calc(var(--frames) * var(--fw) * var(--scale) * -1px)
      calc(var(--row) * var(--fh) * var(--scale) * -1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sprite-anim,
  .hero-stage__bg {
    animation: none;
  }
}

/* Vision board (player roadmap) */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

.board__col {
  background: rgba(22, 18, 16, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 240px;
}

.board__col h3 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.9rem;
  color: var(--gold);
}

.ticket {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rust);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.7rem;
}

.ticket h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.ticket p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--bone-dim);
}

/* Prose */
.prose {
  max-width: 68ch;
}

.prose h2 {
  font-family: var(--font-display);
  margin: 2.1rem 0 0.65rem;
}

.prose h3 {
  font-family: var(--font-display);
  margin: 1.4rem 0 0.45rem;
}

.prose p,
.prose li {
  color: var(--bone-dim);
}

.prose strong {
  color: var(--bone);
}

.prose ul {
  padding-left: 1.2rem;
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--rust);
  background: rgba(36, 28, 24, 0.9);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  color: var(--bone-dim);
}

.timeline {
  display: grid;
  gap: 1.1rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
}

.timeline__body h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.timeline__body p {
  margin: 0;
  color: var(--bone-dim);
}

.page-band {
  padding: 2.8rem 0 1.2rem;
}

.page-band h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  margin: 0 0 0.55rem;
}

.page-band p {
  margin: 0;
  color: var(--bone-dim);
  max-width: 48ch;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.6rem;
  color: var(--bone-dim);
  font-size: 0.9rem;
}

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

.cta-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.4rem 1.75rem;
  background:
    radial-gradient(ellipse 80% 120% at 50% 0%, rgba(210, 98, 46, 0.22), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.cta-band__copy {
  max-width: 36rem;
}

.cta-band h2 {
  font-family: var(--font-display);
  margin: 0 0 0.45rem;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
}

.cta-band p {
  margin: 0;
  color: var(--bone-dim);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .grid-3,
  .grid-2,
  .board,
  .timeline__item {
    grid-template-columns: 1fr;
  }

  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero-stage {
    min-height: 72vh;
  }
}
