@import url('https://fonts.googleapis.com/css2?family=Ibarra+Real+Nova:ital,wght@0,600;0,700;1,400&family=Inter:wght@400;500&display=swap');

:root {
  --72-ink-1000: #050505;
  --72-ink-900: #0b0b0a;
  --72-ink-800: #151412;
  --72-ink-700: #292622;
  --72-paper-50: #f4efe5;
  --72-paper-200: #c8c0b3;
  --72-red-500: #d9523e;
  --72-color-background: var(--72-ink-1000);
  --72-color-surface: var(--72-ink-900);
  --72-color-surface-hover: var(--72-ink-800);
  --72-color-border: var(--72-ink-700);
  --72-color-text-primary: var(--72-paper-50);
  --72-color-text-secondary: var(--72-paper-200);
  --72-color-accent: var(--72-red-500);
  --72-layout-content-max: 1312px;
  --72-page-padding: clamp(24px, 4.45vw, 64px);
  --72-font-display: 'Ibarra Real Nova', Georgia, serif;
  --72-font-ui: 'Inter', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--72-color-background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--72-color-background);
  color: var(--72-color-text-primary);
  font-family: var(--72-font-ui);
  -webkit-font-smoothing: antialiased;
}

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

.studio-shell {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
}

.studio-shell::before,
.studio-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.studio-shell::before {
  z-index: -2;
  background: url('/assets/portfolio-background.png') center / cover no-repeat;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.015);
}

.studio-shell::after {
  z-index: -1;
  background: rgba(0, 0, 0, 0.72);
}

.studio-content {
  display: flex;
  width: min(100%, calc(var(--72-layout-content-max) + (var(--72-page-padding) * 2)));
  min-height: 100svh;
  margin: 0 auto;
  padding: var(--72-page-padding);
  flex-direction: column;
  gap: clamp(72px, 7.2vw, 104px);
}

.brand-header,
.site-footer,
.category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.brand-header {
  min-height: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--72-color-border);
  background: var(--72-color-background);
}

.brand-lockup {
  letter-spacing: 0.12em;
}

.brand-lockup:focus-visible {
  outline: 1px solid var(--72-color-accent);
  outline-offset: 8px;
}

.brand-index {
  color: var(--72-color-text-secondary);
}

.hero {
  display: flex;
  min-height: 400px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

.hero-index {
  color: var(--72-color-text-secondary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.025em;
}

.hero-heading {
  display: flex;
  align-items: flex-end;
  gap: 42px;
}

.hero h1 {
  display: flex;
  margin: 0;
  flex-direction: column;
  font-family: var(--72-font-display);
  font-size: clamp(76px, 8vw, 112px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.93;
  text-transform: uppercase;
}

.studio-mark {
  display: block;
  width: 93px;
  height: 93px;
  margin-bottom: 9px;
  flex: 0 0 auto;
}

.hero-statement {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-statement p {
  max-width: 620px;
  margin: 0;
  color: var(--72-color-accent);
  font-family: var(--72-font-display);
  font-size: 28px;
  font-style: italic;
  line-height: 26px;
}

.games-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-header {
  min-height: 32px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--72-color-border);
  background: var(--72-color-background);
  color: var(--72-color-accent);
}

.category-header span:last-child {
  color: var(--72-color-text-secondary);
}

.games-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--72-color-border);
  background: var(--72-color-border);
}

.game-card {
  display: flex;
  min-width: 0;
  min-height: 560px;
  flex-direction: column;
  background: rgba(5, 5, 5, 0.94);
}

.game-art {
  display: grid;
  min-height: 270px;
  padding: 36px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--72-color-border);
  background: rgba(11, 11, 10, 0.88);
}

.game-art img {
  display: block;
  width: min(100%, 320px);
  max-height: 190px;
  object-fit: contain;
}

.game-art--empty {
  background: rgba(7, 7, 7, 0.76);
}

.game-details {
  display: flex;
  min-height: 288px;
  padding: 24px;
  flex: 1;
  flex-direction: column;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--72-color-text-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.game-meta span:last-child {
  color: var(--72-color-accent);
  text-align: right;
}

.game-details h2 {
  margin: 42px 0 8px;
  font-family: var(--72-font-display);
  font-size: clamp(34px, 3.3vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.game-details p {
  max-width: 30ch;
  margin: 0;
  color: var(--72-color-text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.game-description-space {
  display: block;
  min-height: 20px;
}

.game-actions {
  display: flex;
  margin-top: auto;
  padding-top: 36px;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.game-actions a,
.game-no-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.game-actions a {
  position: relative;
  padding-bottom: 4px;
}

.game-actions a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--72-color-accent);
  content: '';
  transform: scaleX(0.28);
  transform-origin: left;
  transition: transform 180ms ease;
}

.game-actions a:hover::after,
.game-actions a:focus-visible::after {
  transform: scaleX(1);
}

.game-actions a:focus-visible,
.playground-link:focus-visible,
.directory-row:focus-visible,
.playground-back:focus-visible {
  outline: 1px solid var(--72-color-accent);
  outline-offset: 5px;
}

.game-no-link {
  margin-top: auto;
  padding-top: 36px;
  color: var(--72-color-text-secondary);
}

.playground-link {
  display: flex;
  min-height: 72px;
  padding: 0 24px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--72-color-border);
  background: rgba(5, 5, 5, 0.9);
  color: var(--72-color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 180ms ease, color 180ms ease;
}

.playground-link span:last-child {
  color: var(--72-color-accent);
  font-size: 20px;
}

.playground-link:hover {
  background: rgba(21, 20, 18, 0.96);
  color: var(--72-color-text-primary);
}

.playground-content {
  gap: clamp(64px, 8vw, 120px);
}

.playground-back:hover {
  color: var(--72-color-accent);
}

.directory {
  display: flex;
  min-height: 600px;
  flex-direction: column;
  gap: 72px;
}

.directory-intro h1 {
  margin: 18px 0 8px;
  font-family: var(--72-font-display);
  font-size: clamp(64px, 9vw, 124px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.directory-intro p {
  margin: 0;
  color: var(--72-color-text-secondary);
  font-size: 14px;
}

.directory-table {
  border: 1px solid var(--72-color-border);
  background: rgba(5, 5, 5, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.directory-head,
.directory-row {
  display: grid;
  padding: 0 20px;
  grid-template-columns: 56px minmax(160px, 0.75fr) minmax(240px, 1.4fr) 132px;
  gap: 18px;
  align-items: center;
}

.directory-head {
  min-height: 40px;
  color: var(--72-color-text-secondary);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.directory-row {
  min-height: 72px;
  border-top: 1px solid var(--72-color-border);
  color: var(--72-color-text-secondary);
  font-size: 12px;
  line-height: 1.35;
  transition: background-color 160ms ease, color 160ms ease;
}

a.directory-row:hover {
  background: var(--72-color-surface-hover);
  color: var(--72-color-text-primary);
}

.directory-row strong {
  color: var(--72-color-text-primary);
  font-size: 14px;
  font-weight: 500;
}

.directory-row > span:last-child {
  color: var(--72-color-accent);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: right;
}

.directory-row--reserved {
  opacity: 0.58;
}

.site-footer {
  min-height: 48px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--72-color-border);
  background: var(--72-color-background);
  color: var(--72-color-text-secondary);
}

@media (min-width: 701px) and (max-width: 1000px) {
  .games-list {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 360px;
    flex-direction: row;
  }

  .game-art {
    width: 42%;
    min-height: 360px;
    border-right: 1px solid var(--72-color-border);
    border-bottom: 0;
  }

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

@media (max-width: 700px) {
  .studio-content {
    padding-top: 24px;
    padding-bottom: 28px;
    gap: 72px;
  }

  .brand-header,
  .site-footer,
  .category-header {
    font-size: 10px;
  }

  .brand-header {
    min-height: 48px;
    padding-bottom: 16px;
  }

  .hero {
    min-height: 420px;
    gap: 20px;
  }

  .hero-heading {
    width: 100%;
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(50px, 16.5vw, 76px);
    line-height: 0.92;
  }

  .studio-mark {
    width: clamp(44px, 13.5vw, 64px);
    height: clamp(44px, 13.5vw, 64px);
    margin-bottom: 4px;
  }

  .hero-statement {
    gap: 12px;
  }

  .hero-statement p {
    max-width: 340px;
    font-size: 21px;
    line-height: 1.05;
  }

  .category-header {
    min-height: 32px;
    padding-bottom: 12px;
  }

  .games-list {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 0;
  }

  .game-art {
    min-height: 240px;
    padding: 28px;
  }

  .game-art img {
    max-height: 170px;
  }

  .game-art--empty {
    min-height: 180px;
  }

  .game-details {
    min-height: 270px;
    padding: 20px;
  }

  .game-details h2 {
    margin-top: 38px;
    font-size: clamp(38px, 12vw, 52px);
  }

  .game-details p {
    font-size: 15px;
  }

  .playground-link {
    min-height: 64px;
    padding: 0 16px;
    font-size: 10px;
  }

  .playground-content {
    gap: 64px;
  }

  .playground-header {
    align-items: flex-start;
    gap: 24px;
  }

  .directory {
    min-height: 560px;
    gap: 56px;
  }

  .directory-intro h1 {
    font-size: clamp(56px, 20vw, 88px);
  }

  .directory-head {
    display: none;
  }

  .directory-row {
    min-height: 104px;
    padding: 16px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px 12px;
    align-content: center;
  }

  .directory-row > span:nth-child(3) {
    grid-column: 2;
  }

  .directory-row > span:last-child {
    grid-column: 2;
    text-align: left;
  }

  .site-footer {
    min-height: 48px;
    padding-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .game-actions a::after,
  .playground-link,
  .directory-row {
    transition: none;
  }
}
