:root {
  --bone: #F3F1EC;
  --graphite: #1F2421;
  --brass: #8C6A3D;
  --line: #D9D3C7;
  --sans: "IBM Plex Sans", sans-serif;
  --serif: "Newsreader", "Times New Roman", serif;
}

[hidden]{display:none !important}

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

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--graphite);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }

a { color: var(--brass); }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--bone);
  color: var(--graphite);
  padding: 8px 12px;
  z-index: 80;
}

.skip:focus { top: 12px; }

.frame {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: 100vh;
}

.site-header {
  grid-column: 1 / 4;
  grid-row: 1;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 22px 24px;
  background: var(--graphite);
  color: var(--bone);
  border-right: 3px solid var(--brass);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bone);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
  min-width: 0;
}

.brand span { overflow-wrap: anywhere; }

.rail-place {
  margin: 10px 0 0;
  color: var(--brass);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.site-header nav {
  display: flex;
  flex-direction: column;
  margin-top: 32px;
}

.site-header nav a {
  color: var(--bone);
  text-decoration: none;
  padding: 9px 0;
  border-bottom: 1px solid rgba(217, 211, 199, 0.28);
}

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

.account {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 28px;
}

.rail-mail {
  margin: 0 0 6px;
  font-size: 0.88rem;
}

.rail-mail a {
  color: var(--brass);
  text-decoration: none;
}

#player-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#player-name {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.sheet {
  grid-column: 4 / 13;
  grid-row: 1;
  min-width: 0;
  padding: 46px 40px 76px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 36px;
  align-content: start;
}

.sheet > * { grid-column: 1 / -1; min-width: 0; }

.eyebrow {
  margin: 0;
  color: var(--brass);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
}

.hero-copy h1,
.prose h1 {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(2.4rem, 4.6vw, 4.3rem);
  letter-spacing: -0.02em;
}

.sheet h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
}

.lede,
.prose p,
.hero-copy p,
.band-caption p,
.steps p,
.features p,
.facts span {
  margin: 0;
  max-width: 68ch;
}

.hero-figure {
  margin: 0 0 18px;
  border: 1px solid var(--line);
}

.hero-figure img,
.band img,
.method-photo {
  display: block;
  width: 100%;
  height: auto;
}

.method-photo {
  width: min(100%, 380px);
  border: 1px solid var(--line);
  margin-top: 8px;
}

.facts,
.cards,
.steps,
.features {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.features { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.facts li,
.steps li,
.features li {
  border-top: 2px solid var(--brass);
  padding-top: 12px;
  min-width: 0;
}

.facts strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.steps { counter-reset: step; }

.steps li::before,
.features li::before {
  display: block;
  margin-bottom: 8px;
  color: var(--brass);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
}

.features li:nth-child(1)::before { content: "01"; }
.features li:nth-child(2)::before { content: "02"; }
.features li:nth-child(3)::before { content: "03"; }
.features li:nth-child(4)::before { content: "04"; }

.steps h3,
.features h3,
.game-card h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

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

.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bone);
}

.game-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  height: auto;
}

.game-card h3 { margin: 16px 16px 0; }

.play-link { margin: 14px 16px 16px; }

.band img {
  max-height: 460px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.band-caption { padding-top: 14px; }

.prose { max-width: 70ch; }

.prose p + p { margin-top: 1rem; }

.stack-form {
  margin-top: 8px;
  max-width: 36rem;
}

.stack-form label,
.check {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.9rem;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check input {
  width: auto;
  margin-top: 0.3rem;
}

input,
textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--bone);
  color: var(--graphite);
  font: inherit;
}

textarea { min-height: 140px; resize: vertical; }

.btn,
.play-link,
.modal-close {
  appearance: none;
  display: inline-block;
  border: 1px solid var(--brass);
  background: var(--brass);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  padding: 0.72rem 1rem;
  cursor: pointer;
}

.btn-line,
.site-header .btn-line {
  background: transparent;
  color: var(--bone);
  border-color: var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--graphite);
  border-color: var(--graphite);
}

.btn:hover,
.play-link:hover,
.modal-close:hover {
  background: var(--graphite);
  color: var(--bone);
  border-color: var(--brass);
}

.site-header .btn-line:hover {
  background: var(--bone);
  color: var(--graphite);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 36, 33, 0.62);
}

.age-modal { z-index: 50; }

.modal-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--bone);
  color: var(--graphite);
  border: 1px solid var(--line);
  padding: 28px 22px 22px;
}

.modal-panel h2 { margin: 10px 0; font-size: 2rem; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  color: var(--graphite);
  border-color: var(--line);
  padding: 0.4rem 0.65rem;
}

.form-error {
  color: var(--brass);
  border-left: 2px solid var(--brass);
  padding-left: 10px;
  margin: 12px 0 0;
}

.stack-form .btn,
#login-form .btn,
#signup-form .btn { margin-top: 16px; }

#cookie-banner {
  position: fixed;
  z-index: 36;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--graphite);
  color: var(--bone);
  border: 1px solid var(--brass);
}

#cookie-banner p { margin: 0; max-width: 70ch; }

.site-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--graphite);
  color: var(--bone);
  padding: 42px 32px 22px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
}

.footer-brand,
.footer-grid nav,
.footer-grid > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.footer-brand strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.footer-brand p,
.footer-grid p { margin: 0; }

.footer-grid h2 {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.footer-grid a {
  color: var(--bone);
  text-decoration: none;
}

.footer-grid a:hover { color: var(--brass); }

.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--brass);
  color: var(--brass);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.4;
}

.footer-base {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.footer-base a { color: var(--bone); }

@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .frame { display: block; }
  .site-header {
    position: relative;
    height: auto;
    width: 100%;
    overflow: visible;
    border-right: 0;
    border-bottom: 3px solid var(--brass);
  }
  .site-header nav {
    margin-top: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  .site-header nav a { border-bottom: 0; }
  .account {
    margin-top: 16px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sheet { padding: 28px 16px 56px; }
  .facts,
  .cards,
  .steps,
  .features { grid-template-columns: 1fr; }
  .site-footer { padding: 32px 16px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  #cookie-banner { left: 10px; right: 10px; bottom: 10px; }
}
