:root {
  color-scheme: light;
  --paper: #f3efe5;
  --ink: #111419;
  --muted: #62625b;
  --soft: #838379;
  --accent: #0b8f67;
  --line: rgba(17, 20, 24, 0.12);
  --shadow: 0 22px 50px rgba(33, 26, 18, 0.12);
  --radius: 28px;
  --page-width: min(1100px, calc(100vw - 28px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0c1118;
  --ink: #f3f6fb;
  --muted: #a2afc1;
  --soft: #7f8a9b;
  --accent: #8de7bf;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
}

html[data-theme='dark'] body {
  background: #0c1118;
}

body,
button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.page-shell__halo {
  position: absolute;
  filter: blur(90px);
  opacity: 0.5;
}

.page-shell__halo--one {
  top: -120px;
  left: -80px;
  width: 320px;
  height: 320px;
  display: none;
}

.page-shell__halo--two {
  top: 120px;
  right: -90px;
  width: 340px;
  height: 340px;
  display: none;
}

.page-shell__grid {
  position: absolute;
  inset: 0;
  display: none;
}

.site-shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.spine {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 92px;
  height: 320px;
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: center;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden auto;
  z-index: 20;
  transition: width 180ms ease, padding 180ms ease, transform 180ms ease, border-radius 180ms ease;
}

.spine[data-spine-expanded='true'] {
  width: 286px;
  padding: 18px 16px;
  border-radius: 32px;
  justify-items: stretch;
  height: auto;
}

.spine[data-spine-expanded='true'] .spine__copy,
.spine[data-spine-expanded='true'] .spine__nav-label,
.spine[data-spine-expanded='true'] .spine__foot {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.spine[data-spine-expanded='true'] .spine__copy,
.spine[data-spine-expanded='true'] .spine__nav-label {
  transition-delay: 40ms;
}

.spine[data-spine-expanded='true'] .spine__brand {
  grid-template-columns: 56px minmax(0, 1fr);
}

html[data-theme='dark'] .spine {
  background: #0c1118;
}

.spine__brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  justify-items: center;
}

.spine__logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(17, 20, 24, 0.12);
  box-shadow: 0 12px 24px rgba(31, 25, 15, 0.12);
  margin-inline: auto;
}

.spine__copy {
  display: none;
  gap: 3px;
  min-width: 0;
}

.spine[data-spine-expanded='true'] .spine__copy {
  display: grid;
}

.spine__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.spine__tag {
  color: var(--muted);
  font-size: 0.86rem;
}

.section-header__text,
.story-card p,
.note-card p,
.contact-aside p,
.legal-article p,
.team-card p,
.game-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.spine__nav {
  display: grid;
  gap: 6px;
  width: 100%;
}

.spine__nav-link {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  color: var(--muted);
  background: var(--paper);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
  justify-items: center;
}

html[data-theme='dark'] .spine__nav-link {
  background: #111722;
}

.spine__nav-link:hover {
  transform: translateX(2px);
  border-color: rgba(17, 20, 24, 0.12);
  color: var(--ink);
}

.spine[data-spine-expanded='true'] .spine__nav-link {
  grid-template-columns: 24px minmax(0, 1fr);
  justify-items: stretch;
  min-height: 48px;
  padding: 0 14px;
}

.spine__nav-link[aria-current='page'] {
  color: var(--ink);
  background: rgba(11, 143, 103, 0.09);
  border-color: rgba(11, 143, 103, 0.24);
}

.spine__nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.spine__nav-label {
  display: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.spine[data-spine-expanded='true'] .spine__nav-label {
  display: inline;
}

.spine__foot {
  display: none !important;
  margin: 0;
  color: var(--soft);
  font-size: 0.84rem;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.spine[data-spine-expanded='true'] .spine__foot {
  display: block !important;
}

.site-shell__canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.site-main {
  width: min(var(--page-width), calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 42px;
  display: grid;
  gap: 22px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

html[data-theme='dark'] .card {
  background: #0f1521;
}

.section-header {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.section-header h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  max-width: 10ch;
}

.page-header {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.page-header .section-header h1 {
  font-size: clamp(2rem, 3.6vw, 3.8rem);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

html[data-theme='dark'] .pill {
  background: #111722;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

html[data-theme='dark'] .button {
  background: #111722;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 20, 24, 0.18);
}

.button--secondary,
.button--ghost {
  background: var(--paper);
}

.button--ghost {
  color: var(--muted);
}

.button--play {
  min-width: 260px;
  padding: 0 40px;
  background: var(--accent);
  color: #fff;
  border-color: rgba(18, 140, 90, 0.9);
}

html[data-theme='dark'] .button--play {
  background: var(--accent);
  color: #07110c;
  border-color: rgba(77, 214, 145, 0.42);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.home-grid__intro,
.note-card,
.story-card,
.team-intro,
.error-state,
.contact-form,
.contact-aside,
.legal-link-card,
.success-card {
  padding: 20px;
}

.home-grid__intro {
  display: grid;

/* Tweak contact aside visuals: subtler pills and clearer hierarchy */
.contact-aside {
  padding: 20px 22px;
  border-radius: 20px;
  align-items: start;
}

.contact-aside .pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: start;
  padding: 4px 10px;
  height: 28px;
  min-height: 0;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  background: rgba(11, 143, 103, 0.12);
  border: none;
  border-radius: 999px;
  box-shadow: none;
}

.contact-aside h2 {
  font-size: 1.18rem;
  margin: 2px 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.contact-aside p {
  color: var(--soft);
  line-height: 1.7;
  margin: 0;
}
.home-grid__intro {
  display: grid;
  gap: 18px;
  background: var(--paper);
  min-height: 420px;
}

html[data-theme='dark'] .home-grid__intro {
  background: #0f1521;
}

.home-grid__intro h1,
.story-card h2,
.note-card h2,
.team-card h2,
.contact-aside h2,
.legal-link-card h2,
.game-card h2,
.error-state h1,
.success-card h2,
.legal-article h2 {
  margin: 0;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.home-grid__intro h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  max-width: 10ch;
}

.home-grid__intro p {
  max-width: 60ch;
  line-height: 1.8;
  color: var(--muted);
}

.home-grid__sidebar {
  display: grid;
  gap: 14px;
}

.note-card {
  display: grid;
  gap: 10px;
}

.note-card h2,
.story-card h2,
.contact-aside h2,
.legal-link-card h2,
.success-card h2,
.error-state h1 {
  font-size: 1.15rem;
}

.story-grid,
.team-grid,
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.story-grid--single {
  grid-template-columns: 1fr;
}

.story-card,
.legal-link-card,
.success-card,
.contact-aside {
  display: grid;
  gap: 12px;
}

.team-future--wide {
  grid-column: 1 / -1;
  align-content: center;
  min-height: 132px;
}

.story-card p,
.legal-link-card p,
.contact-aside p,
.success-card p,
.error-state p {
  max-width: 58ch;
}

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  overflow: hidden;
}

.game-card__visual {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: #111722;
}

.game-card__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}

.game-card__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.game-card__fallback {
  position: absolute;
  inset: auto auto 24px 24px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.game-card__stamp {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-card__body {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme='dark'] .game-card__body {
  background: rgba(15, 21, 33, 0.86);
}

.game-card__body h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.game-card__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.game-card__facts div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(17, 20, 24, 0.04);
  border: 1px solid rgba(17, 20, 24, 0.06);
}

html[data-theme='dark'] .game-card__facts div {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.game-card__facts span {
  color: var(--soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.game-card__facts strong {
  font-size: 0.95rem;
}

.team-intro {
  display: grid;
  gap: 12px;
}

.team-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  overflow: hidden;
}

.team-card__avatar {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  color: #fff;
  font-size: 1.55rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111722;
  overflow: hidden;
}

.team-card__portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.team-card__body {
  display: grid;
  gap: 8px;
}

.team-card__meta {
  color: var(--soft);
  font-size: 0.88rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--ink);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(17, 20, 24, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

html[data-theme='dark'] .contact-form input,
html[data-theme='dark'] .contact-form textarea {
  background: rgba(255, 255, 255, 0.04);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(11, 143, 103, 0.22);
  border-color: rgba(11, 143, 103, 0.3);
}

.contact-stack {
  display: grid;
  gap: 14px;
}

.legal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.legal-link-card {
  align-content: start;
}

.legal-article {
  display: grid;
  gap: 14px;
  max-width: 860px;
  padding: 22px;
}

.legal-article p {
  line-height: 1.85;
}

.error-state {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

html[data-theme='dark'] .footer {
  background: #0c1118;
}

.footer__inner {
  width: min(var(--page-width), calc(100vw - 36px));
  margin: 0 auto;
  padding: 12px 0 14px;
  display: grid;
  gap: 10px;
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 24px;
}

.footer__group {
  display: grid;
  gap: 8px;
  padding: 10px 0 8px;
  border-top: 1px solid var(--line);
}

.footer__group h3 {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  line-height: 1.2;
}

.footer__links a strong {
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 600;
}

.footer__links--surface,
.footer__links--contact {
  display: flex;
  flex-wrap: wrap;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.footer__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.footer__note--left {
  font-weight: 700;
  color: var(--ink);
}

.footer__note--right {
  text-align: right;
  max-width: 58ch;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle__icon {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--moon {
  display: block;
}

.theme-toggle__icon--sun {
  display: none;
}

html[data-theme='dark'] .theme-toggle {
  background: #0f1521;
  color: #fff;
}

html[data-theme='dark'] .theme-toggle__icon--moon {
  display: none;
}

html[data-theme='dark'] .theme-toggle__icon--sun {
  display: block;
}

@media (max-width: 860px) {
  .spine {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: calc(100vw - 20px);
    max-height: none;
    margin: 10px auto 0;
  }

  .spine__copy,
  .spine__nav-label,
  .spine__foot {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .site-shell {
    grid-template-columns: 1fr;
  }

  .spine,
  .spine:hover,
  .spine:focus-within {
    width: calc(100vw - 20px);
    padding: 16px 12px;
  }

  .spine__nav-link {
    grid-template-columns: 24px 1fr;
  }

  .home-grid,
  .contact-grid,
  .game-card,
  .footer__grid,
  .legal-grid,
  .story-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .game-card__visual {
    min-height: 360px;
  }

  .site-main,
  .footer__inner {
    width: min(100vw - 20px, 1100px);
  }
}

@media (max-width: 720px) {
  .spine__brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .spine__logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .site-main {
    padding: 18px 0 34px;
  }

  .home-grid__intro,
  .note-card,
  .story-card,
  .team-intro,
  .error-state,
  .contact-form,
  .contact-aside,
  .legal-link-card,
  .success-card,
  .legal-article {
    padding: 16px;
  }

  .game-card__visual {
    min-height: 280px;
  }

  .game-card__body {
    padding: 18px;
  }

  .game-card__facts,
  .team-card {
    grid-template-columns: 1fr;
  }

  .team-card__avatar {
    width: 82px;
    height: 82px;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__links {
    flex-direction: column;
    gap: 6px;
  }

  .footer__links a {
    width: 100%;
  }

  .footer__bottom {
    align-items: flex-start;
  }

  .footer__note--right {
    text-align: left;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
}
