:root {
  --paper: #f3ede3;
  --paper-dark: #e8dfd1;
  --ink: #1a1410;
  --ink-soft: #4a4038;
  --ink-muted: #7a7068;
  --sega-blue: #0060aa;
  --sega-red: #d4001a;
  --sega-red-dark: #a80015;
  --white: #fffdf8;
  --border: #cfc4b4;
  --shadow: 0 18px 50px rgba(26, 20, 16, 0.12);
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Figtree", system-ui, sans-serif;
  --sidebar-w: 220px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

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

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

em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--sega-red);
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: var(--white);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 4px solid var(--sega-red);
}

.sidebar-logo img {
  width: 150px;
  height: auto;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 3rem;
}

.sidebar-nav a {
  padding: 0.65rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 253, 248, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s, padding-left 0.2s;
}

.sidebar-nav a:hover {
  color: var(--white);
  padding-left: 0.5rem;
}

.sidebar-note {
  margin-top: auto;
  font-size: 0.8rem;
  color: rgba(255, 253, 248, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  background: var(--white);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s;
}

.menu-btn.open span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-btn.open span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Page layout */
.page {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  padding: 4rem 3rem 3rem;
  min-height: 88vh;
  align-items: center;
  background:
    linear-gradient(135deg, var(--white) 0%, var(--paper) 55%, var(--paper-dark) 100%);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sega-blue);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.5vw, 4.8rem);
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.cta {
  display: inline-block;
  background: var(--sega-red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.9rem 1.75rem;
  border: 2px solid var(--sega-red-dark);
  transition: transform 0.2s, background 0.2s;
}

.cta:hover {
  background: var(--sega-red-dark);
  transform: translateY(-2px);
}

/* Collage */
.hero-collage {
  position: relative;
  height: 520px;
}

.collage-item {
  position: absolute;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-main {
  width: 58%;
  height: 72%;
  top: 8%;
  left: 0;
  z-index: 3;
  transform: rotate(-2deg);
}

.collage-a {
  width: 42%;
  height: 38%;
  top: 0;
  right: 0;
  z-index: 2;
  transform: rotate(3deg);
}

.collage-b {
  width: 38%;
  height: 34%;
  bottom: 12%;
  right: 4%;
  z-index: 4;
  transform: rotate(-4deg);
}

.collage-c {
  width: 36%;
  height: 30%;
  bottom: 0;
  left: 18%;
  z-index: 1;
  transform: rotate(2deg);
}

/* Ticker */
.ticker {
  overflow: hidden;
  background: var(--sega-blue);
  color: var(--white);
  border-bottom: 3px solid var(--ink);
  padding: 0.65rem 0;
}

.ticker-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scroll 28s linear infinite;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ticker-track span:nth-child(even) {
  opacity: 0.45;
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* Sections */
.section {
  padding: 4.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.section h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.filter:hover,
.filter.active {
  background: var(--ink);
  color: var(--white);
}

/* Bento grid */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  grid-auto-rows: auto;
}

.game-tile {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 2px solid var(--ink);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.game-tile.hidden {
  display: none;
}

.game-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.game-tile.featured {
  grid-column: span 2;
}

.game-tile.wide {
  grid-column: span 2;
}

.game-photo {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(180deg, #ebe3d6 0%, #e0d6c8 100%);
}

.game-photo.portrait {
  height: 420px;
  padding: 1.25rem;
}

.game-photo.landscape {
  aspect-ratio: 460 / 215;
  height: auto;
  padding: 0.75rem 1rem;
}

.game-tile.featured .game-photo.portrait {
  height: 480px;
}

.game-tile.featured .game-photo.landscape,
.game-tile.wide .game-photo.landscape {
  aspect-ratio: 460 / 215;
}

.game-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.game-meta {
  padding: 1rem 1.1rem 1.15rem;
  border-top: 2px solid var(--ink);
}

.game-meta .year {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--sega-red);
  text-transform: uppercase;
}

.game-meta h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0.2rem 0 0.35rem;
}

.game-meta p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

.platform {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sega-blue);
}

/* Consoles */
.consoles {
  background: var(--white);
}

.console-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.console-card {
  padding: 1.5rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 200px;
}

.console-card.console-photo {
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: 280px;
}

.console-card.console-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  min-height: 280px;
}

.console-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.25rem;
  background: linear-gradient(transparent, rgba(26, 20, 16, 0.88));
  color: var(--white);
}

.console-card.accent {
  border-color: var(--sega-red);
}

.console-year {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--sega-blue);
  text-transform: uppercase;
}

.console-caption .console-year {
  color: rgba(255, 255, 255, 0.7);
}

.console-card h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0.25rem 0 0.4rem;
}

.console-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.console-caption p {
  color: rgba(255, 255, 255, 0.85);
}

/* History */
.history-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.history-body p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.history-body em {
  color: var(--ink);
  font-style: italic;
}

blockquote {
  margin-top: 1.5rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--sega-red);
}

blockquote p {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

blockquote cite {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.milestones {
  list-style: none;
  border: 2px solid var(--ink);
  background: var(--white);
}

.milestones li {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.milestones li:last-child {
  border-bottom: none;
}

.milestones strong {
  display: inline-block;
  min-width: 3.5rem;
  color: var(--sega-red);
  font-weight: 800;
}

/* News */
.news-list {
  list-style: none;
  border-top: 2px solid var(--ink);
}

.news-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.news-year {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--sega-blue);
}

.news-list h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.news-list p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  padding: 2.5rem 3rem 3rem;
  text-align: center;
  background: var(--ink);
  color: rgba(255, 253, 248, 0.55);
}

.footer-logo {
  margin: 0 auto 1rem;
  width: 130px;
  height: auto;
  opacity: 0.95;
}

.footer p {
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-tile.featured,
  .game-tile.wide {
    grid-column: span 2;
  }

  .game-photo.portrait {
    height: 360px;
  }

  .game-tile.featured .game-photo.portrait {
    height: 400px;
  }

  .console-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-btn {
    display: flex;
  }

  .page {
    margin-left: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 5rem 1.5rem 2rem;
    min-height: auto;
  }

  .hero-collage {
    height: 340px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .game-tile,
  .game-tile.featured,
  .game-tile.wide,
  .game-tile.tall {
    grid-column: span 1;
  }

  .game-photo.portrait {
    height: 320px;
    padding: 1rem;
  }

  .game-tile.featured .game-photo.portrait {
    height: 360px;
  }

  .game-photo.landscape {
    padding: 0.5rem 0.75rem;
  }

  .console-strip {
    grid-template-columns: 1fr;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
