/* Monkees Madness devlog site. Tokens and component shapes follow MonkeesAreKey/monkees-ui
   (app/globals.css, components/ui/{button,card,badge,tabs,typography,image-card}.tsx). */
:root {
  --background: #ffffff;
  --foreground: #000000;
  --card: #ffffff;
  --primary: #fac800;
  --primary-foreground: #000000;
  --secondary: #fee700;
  --muted: #f3f4f6;
  --muted-foreground: #4b5563;
  --accent: #526bce;
  --accent-foreground: #ffffff;
  --border: #000000;
  --ring: #fac800;
  --radius: 0.75rem;
  --shadow-sm: 2px 2px 0 0 #000;
  --shadow: 4px 4px 0 0 #000;
  --shadow-hover: 5px 5px 0 0 #000;
  --shadow-lg: 8px 8px 0 0 #000;
  --font-sans: "Comic Neue", "Comic Sans MS", system-ui, sans-serif;
  --font-heading: "Chewy", "Comic Neue", system-ui, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); border-bottom: 2px solid var(--border); padding-bottom: 0.3em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.9rem; }
.lead { font-size: 1.2rem; color: var(--muted-foreground); max-width: 60ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(250, 200, 0, 0.7); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
main > section, main > section.wrap { margin: 0 auto 64px; }
main > section.page-head { margin-bottom: 32px; }
.mt { margin-top: 24px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--primary); border-bottom: 2px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { height: 36px; width: auto; filter: brightness(0); }
.brand span { font-family: var(--font-heading); font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
#nav { display: flex; gap: 4px; }
#nav a {
  text-decoration: none; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem;
  padding: 6px 12px; border: 2px solid transparent; border-radius: calc(var(--radius) * 0.8);
}
#nav a:hover { background: rgba(255, 255, 255, 0.5); }
#nav a[aria-current] { background: var(--background); border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-toggle { display: none; }

/* Buttons (button.tsx) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; cursor: pointer;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--primary); color: var(--primary-foreground);
  font: 700 0.85rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none; white-space: nowrap; box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-outline { background: var(--background); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-accent { background: var(--accent); color: var(--accent-foreground); }
.btn-sm { min-height: 28px; padding: 4px 10px; font-size: 0.75rem; box-shadow: var(--shadow-sm); border-radius: calc(var(--radius) * 0.8); }
.btn-sm:hover { box-shadow: 3px 3px 0 0 #000; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 1rem; }
.btn.done { background: var(--secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }

/* Badges (badge.tsx) */
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; width: fit-content;
  border: 2px solid var(--border); border-radius: calc(var(--radius) * 0.6);
  background: var(--primary); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge-dark { background: var(--foreground); color: var(--primary); }
.badge-out { background: var(--background); }
.badge-yes { background: var(--accent); color: var(--accent-foreground); }

/* Cards (card.tsx, image-card.tsx) */
.card {
  background: var(--card); border: 2px solid var(--border); border-radius: calc(var(--radius) * 1.4);
  box-shadow: var(--shadow); overflow: hidden;
}
a.card { text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
a.card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hover); }
a.card:active { transform: translate(2px, 2px); box-shadow: none; }
.pad { padding: 20px; }

/* Hero */
.hero { background: var(--primary); border-bottom: 2px solid var(--border); padding: 48px 0 56px; margin-bottom: 40px !important; }
.hero-in { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; }
.hero h1 { margin-top: 14px; }
.hero .lead { color: #1f2937; }
.hero-vid { box-shadow: var(--shadow-lg); background: #000; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stat { border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--muted); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.stat span { font-size: 0.85rem; color: var(--muted-foreground); }

/* Grids */
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--border); margin-bottom: 20px; padding-bottom: 10px; }
.sec-head h2 { border: 0; padding: 0; margin: 0; }

/* Episode / game cards */
.ep img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-bottom: 2px solid var(--border); background: var(--muted); }
.ep-body { padding: 12px 14px 14px; }
.ep-body h3 { margin: 8px 0 4px; font-size: 1.2rem; }
.ep-body p { margin: 0; font-size: 0.92rem; }

/* Media */
.vid { width: 100%; background: #000; }
.vid.wide { aspect-ratio: 16 / 9; }
.vid.tall { aspect-ratio: 9 / 16; }
.vid.square { aspect-ratio: 1 / 1; }
.player { background: #000; }
.media { margin: 0; display: flex; flex-direction: column; }
.media video { border-bottom: 2px solid var(--border); }
figcaption { padding: 10px 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cap { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted-foreground); white-space: pre-line; }
.tallgrid { align-items: start; }

/* Banners */
.banners { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; align-items: start; }
.banner { margin: 0; }
.banner img { width: 100%; border-bottom: 2px solid var(--border); background: var(--muted); }
.b-header { grid-column: span 4; }
.b-post { grid-column: span 2; }
.b-square, .b-thumbnail { grid-column: span 2; }
.b-story { grid-column: span 2; grid-row: span 2; }
.banners .b-story img { max-height: 520px; object-fit: cover; object-position: top; }

/* Screenshots */
.shot { display: block; }
.shot img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-bottom: 2px solid var(--border); }
.shot span { display: block; padding: 8px 12px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* Copy blocks */
.copy { border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px; background: var(--background); }
.copy-label { padding: 8px 12px; border-bottom: 2px solid var(--border); background: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.copy pre { margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word; font: 0.95rem/1.5 var(--font-sans); }
.copy-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 2px solid var(--border); font-size: 0.8rem; }

/* Tables (also markdown) */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--muted); vertical-align: top; }
th { background: var(--muted); border-bottom: 2px solid var(--border); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.05em; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 680px; }
code {
  font-family: ui-monospace, "Geist Mono", Consolas, monospace; font-size: 0.82em;
  border: 2px solid var(--border); border-radius: 6px; background: var(--muted); padding: 1px 5px; box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* Details */
details summary { cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; }
details[open] summary { margin-bottom: 12px; }
.script { padding: 16px 20px; margin-bottom: 28px; }
.script table, .pad table, .walk table { display: block; overflow-x: auto; }

/* Page head */
.page-head { padding-top: 40px; }
.page-head h1 { margin: 12px 0 8px; }
.crumb { display: inline-block; margin-right: 12px; font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.crumb:hover { text-decoration: underline; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager .btn { white-space: normal; text-align: left; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li a { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0 8px 16px; text-decoration: none; position: relative; }
.timeline li a::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border: 2px solid var(--border); background: var(--primary); border-radius: 50%; }
.timeline li a:hover strong { text-decoration: underline; }
.tl-t { display: flex; flex-direction: column; font-size: 0.92rem; line-height: 1.35; }
ul.ticks, ul.dashes { padding-left: 0; list-style: none; }
ul.ticks li, ul.dashes li { padding-left: 26px; position: relative; margin-bottom: 6px; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
ul.dashes li::before { content: "–"; position: absolute; left: 4px; font-weight: 700; }

/* Walkthrough */
.walks { display: grid; gap: 22px; }
.walk { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.walk-vid { background: #000; border-right: 2px solid var(--border); }
.walk-body { padding: 16px 20px; }
.walk-body h3 { margin: 10px 0 12px; }
.walk-body details { margin-top: 16px; }

/* Prose (game guides) */
.prose h2 { font-size: 1.4rem; margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* Step lists (guide scripts) */
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 0 0 12px 38px; margin-bottom: 12px; border-bottom: 2px solid var(--muted); }
ol.steps li:last-child { border-bottom: 0; margin-bottom: 0; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center;
  border: 2px solid var(--border); border-radius: 50%; background: var(--primary); font-weight: 700; font-size: 0.8rem;
}
ol.steps p { margin: 0; font-size: 0.95rem; }
ol.steps .keys { margin-top: 6px; font-size: 0.85rem; color: var(--muted-foreground); }

/* Game guide */
.game { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.game-side { display: grid; gap: 22px; }
.game-side .copy { margin: 0; }
.game-side .media video { max-height: 560px; object-fit: contain; }

/* CTA */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; background: var(--secondary); }
.cta h2 { border: 0; padding: 0; }
.cta p { margin: 0; max-width: 56ch; }

/* Media kit (tabs.tsx) */
.kit-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 20px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--muted); box-shadow: var(--shadow); }
.tabs button {
  border: 2px solid transparent; background: transparent; cursor: pointer; padding: 6px 12px; border-radius: calc(var(--radius) * 0.8);
  font: 700 0.85rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground);
}
.tabs button:hover { color: var(--foreground); }
.tabs button[aria-selected="true"] { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-sm); }
.select select {
  appearance: none; font: 700 0.9rem var(--font-sans); padding: 10px 36px 10px 12px; border: 2px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  max-width: 100%; cursor: pointer; color: var(--foreground);
}
.kit-ep { margin-bottom: 48px; }
.kit-ep [data-tab="long"] .media { max-width: 820px; }

/* Footer */
.foot { border-top: 2px solid var(--border); background: var(--muted); padding: 28px 0; margin-top: 40px; }
.foot p { margin: 0 0 6px; font-size: 0.92rem; }

/* Responsive */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .g4, .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .banners { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-header, .b-post { grid-column: span 2; }
  .b-square, .b-thumbnail, .b-story { grid-column: span 1; grid-row: auto; }
}
@media (max-width: 820px) {
  .hero-in, .two, .g2-1, .walk, .game { grid-template-columns: 1fr; }
  .game-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .walk-vid { border-right: 0; border-bottom: 2px solid var(--border); }
  .g3, .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { flex-direction: column; align-items: flex-start; }
  .nav-toggle { display: inline-flex; }
  .nav-toggle { border: 2px solid var(--border); border-radius: var(--radius); background: var(--background); font: 700 0.85rem var(--font-sans); text-transform: uppercase; padding: 6px 12px; box-shadow: var(--shadow-sm); cursor: pointer; }
  #nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--primary); border-bottom: 2px solid var(--border); padding: 8px 16px 14px; }
  #nav.open { display: flex; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: 16px; }
  .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  .ep-body { padding: 8px 10px 10px; }
  .ep-body h3 { font-size: 1rem; }
  .ep-body p { font-size: 0.8rem; }
  .cap { font-size: 0.78rem; }
  .tallgrid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banners { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 0 40px; }
  .brand span { font-size: 1.3rem; }
  .brand img { height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, a.card { transition: none; }
}
