:root {
  --paper: #fff9ee;
  --paper-strong: #fff2d5;
  --ink: #171717;
  --muted: #5e5a51;
  --line: #262018;
  --green: #64c864;
  --blue: #40a8e8;
  --pink: #ff6b8b;
  --yellow: #ffd447;
  --red: #f0563d;
  --mint: #d9f7bf;
  --shadow: 0 24px 70px rgba(23, 23, 23, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(255, 249, 238, 0.88);
  border-bottom: 2px solid rgba(23, 23, 23, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--yellow);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 800;
}

.main-nav a {
  padding: 8px 11px;
  border: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--yellow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  min-height: calc(100svh - 74px);
  gap: clamp(34px, 7vw, 96px);
  padding: clamp(42px, 8vw, 90px) clamp(18px, 6vw, 88px) 50px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: clamp(3.6rem, 13vw, 9rem);
  line-height: 0.84;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.hero-text,
.blog-hero p,
.project-copy p,
.article-lead {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  color: var(--ink);
  font-weight: 900;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button.primary {
  background: var(--green);
}

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

.button.dark {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--blue);
}

.button.danger {
  background: var(--red);
}

.hero-visual {
  position: relative;
  display: grid;
  min-height: 520px;
  place-items: center;
}

.device {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 0.72;
  rotate: -5deg;
  filter: drop-shadow(20px 24px 0 rgba(23, 23, 23, 0.09));
}

.device-loop {
  position: absolute;
  top: -34px;
  right: 68px;
  width: 82px;
  height: 82px;
  border: 18px solid var(--blue);
  border-radius: 50%;
  background: transparent;
}

.device-face {
  position: absolute;
  inset: 42px 0 0;
  padding: 26px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-radius: 34px 34px 58px 34px;
  box-shadow: 11px 11px 0 var(--ink);
}

.screen {
  position: relative;
  height: 48%;
  overflow: hidden;
  padding: 18px;
  background: #bff29e;
  border: 4px solid var(--ink);
  border-radius: 20px;
}

.screen p {
  position: absolute;
  right: 16px;
  bottom: 10px;
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.screen-grid span {
  min-height: 44px;
  border: 3px solid var(--ink);
  background: rgba(255, 249, 238, 0.56);
}

.screen-player,
.screen-chip {
  position: absolute;
  border: 3px solid var(--ink);
}

.screen-player {
  left: 46px;
  bottom: 42px;
  width: 30px;
  height: 30px;
  background: var(--pink);
}

.screen-chip {
  right: 52px;
  top: 58px;
  width: 38px;
  height: 20px;
  background: var(--blue);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 36px 10px 0;
}

.dpad {
  position: relative;
  width: 92px;
  height: 92px;
}

.dpad span {
  position: absolute;
  inset: 32px 0;
  background: var(--ink);
  border-radius: 8px;
}

.dpad span + span {
  inset: 0 32px;
}

.buttons {
  display: flex;
  gap: 14px;
}

.buttons span {
  width: 48px;
  height: 48px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
}

.buttons span + span {
  background: var(--blue);
}

.game-tags {
  position: absolute;
  right: 4%;
  bottom: 8%;
  display: grid;
  gap: 10px;
}

.game-tags span {
  padding: 9px 12px;
  font-weight: 950;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.section {
  padding: clamp(52px, 8vw, 110px) clamp(18px, 6vw, 88px);
}

.section-heading {
  max-width: 920px;
  margin-bottom: 32px;
}

.section-heading.compact h2 {
  max-width: 620px;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.studio-grid article,
.post-card,
.post-row,
.admin-card,
.admin-row {
  background: rgba(255, 255, 255, 0.66);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(23, 23, 23, 0.92);
}

.studio-grid article {
  padding: 24px;
}

.studio-grid p,
.post-card p,
.post-row p,
.article p,
.muted-text {
  color: var(--muted);
}

.project-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.7fr);
  gap: clamp(24px, 6vw, 78px);
  align-items: center;
  padding: clamp(52px, 8vw, 104px) clamp(18px, 6vw, 88px);
  color: var(--paper);
  background: var(--ink);
}

.project-band .eyebrow {
  color: var(--yellow);
}

.project-copy p {
  color: rgba(255, 249, 238, 0.76);
}

.project-panel {
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--paper);
  box-shadow: 12px 12px 0 var(--blue);
}

.mini-game-list {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--ink);
}

.mini-game-list small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.status-dot {
  width: 18px;
  height: 18px;
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.tile-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.tile {
  min-height: 96px;
  border: 2px solid var(--ink);
}

.tile.pink {
  background: var(--pink);
}

.tile.green {
  background: var(--green);
}

.tile.yellow {
  background: var(--yellow);
}

.tile.blue {
  background: var(--blue);
}

.tile.ink {
  background: var(--ink);
}

.tile.red {
  background: var(--red);
}

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

.post-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.post-card:hover,
.post-row:hover {
  transform: translate(4px, 4px);
  box-shadow: 3px 3px 0 rgba(23, 23, 23, 0.92);
}

.post-card.feature {
  background: var(--mint);
}

.post-date {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 5px 9px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  background: var(--yellow);
  border: 2px solid var(--ink);
}

.links-band {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
  padding: clamp(42px, 6vw, 72px) clamp(18px, 6vw, 88px);
  background: var(--paper-strong);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.links-band h2 {
  font-size: clamp(1.8rem, 4vw, 3.3rem);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.social-links a {
  padding: 10px 13px;
  font-weight: 950;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 6vw, 88px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.blog-hero,
.article {
  max-width: 920px;
  padding: clamp(48px, 9vw, 112px) clamp(18px, 6vw, 88px) 34px;
}

.blog-hero h1,
.article h1 {
  font-size: clamp(3.8rem, 12vw, 8rem);
}

.post-list {
  display: grid;
  gap: 18px;
  max-width: 980px;
  padding: 18px clamp(18px, 6vw, 88px) clamp(70px, 8vw, 110px);
}

.post-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  padding: 24px;
}

.post-row.muted {
  opacity: 0.72;
}

.post-row h2 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

.article {
  margin: 0 auto;
}

.article h1 {
  margin-bottom: 24px;
}

.article p,
.article li {
  font-size: 1.16rem;
}

.article-content h2 {
  margin-top: 38px;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.article-content ul {
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
  font-weight: 950;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.admin-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 84px) 0;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-title h1,
.admin-card h1 {
  font-size: clamp(3rem, 8vw, 6rem);
}

.admin-card {
  padding: clamp(22px, 4vw, 36px);
}

.admin-card.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.admin-list {
  display: grid;
  gap: 18px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
}

.admin-row h2 {
  font-size: clamp(1.5rem, 3vw, 2.8rem);
}

.admin-row small {
  color: var(--muted);
  font-weight: 800;
}

.admin-row form {
  margin: 0;
}

.form-stack,
.editor-form {
  display: grid;
  gap: 18px;
}

.form-stack label,
.editor-form label {
  display: grid;
  gap: 8px;
  font-weight: 950;
}

input,
textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid var(--ink);
  border-radius: 0;
}

textarea {
  resize: vertical;
}

.content-editor {
  min-height: 360px;
  font-family: "Courier New", monospace;
  line-height: 1.6;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  width: fit-content;
}

.check-row input {
  width: 20px;
  height: 20px;
}

.editor-help {
  color: var(--muted);
}

.form-error {
  padding: 12px;
  color: var(--ink);
  font-weight: 900;
  background: #ffd1d1;
  border: 2px solid var(--ink);
}

@media (max-width: 900px) {
  .hero,
  .project-band,
  .links-band,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 440px;
  }

  .studio-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .social-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero {
    padding-top: 34px;
  }

  .hero-visual {
    min-height: 360px;
  }

  .device {
    width: min(84vw, 310px);
  }

  .device-face {
    border-radius: 26px 26px 44px 26px;
  }

  .game-tags {
    right: auto;
    left: 0;
    bottom: 0;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tile {
    min-height: 72px;
  }

  .site-footer,
  .admin-title {
    flex-direction: column;
    align-items: flex-start;
  }
}
