:root {
  --bg: #0a0705;
  --text: #dccdb6;
  --muted: #6f6f6f;
}

@font-face {
  font-family: "Archivo Custom";
  src: url("assets/fonts/Archivo-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Nyght Serif Custom";
  src: url("assets/fonts/NyghtSerif-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #070504;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.background-layer {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(10, 7, 5, 0.54), rgba(10, 7, 5, 0.54)),
    url("https://res.cloudinary.com/ddvaepjce/image/upload/v1776680183/Gemini_Generated_Image_y68dxay68dxay68d_o18s0q.png") center center / cover no-repeat;
  filter: blur(6px);
  transform: scale(1.12);
  transform-origin: center;
  pointer-events: none;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 120px;
  opacity: 0;
  transition: opacity 360ms ease;
}

.site-shell.is-ready {
  opacity: 1;
}

.hero-shell {
  display: flex;
  min-height: 100vh;
  padding: 24px 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-220px);
}

.ascii-stage {
  position: relative;
  display: inline-grid;
  place-items: center;
  transform: translateX(28px);
}

.display-canvas {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  opacity: 0.68;
  pointer-events: none;
  filter: saturate(0.96) contrast(1.12);
  image-rendering: pixelated;
}

.ascii-output {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  overflow: auto hidden;
  background: transparent;
  color: #8f2722;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 13px);
  line-height: 0.82;
  letter-spacing: 0.02em;
  white-space: pre;
  text-shadow:
    0 0 8px rgba(143, 39, 34, 0.16),
    0 0 18px rgba(143, 39, 34, 0.09),
    0 1px 2px rgba(0, 0, 0, 0.48);
  filter: contrast(1.08) saturate(1.08);
}

.signature {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 16px;
  font-family: "Nyght Serif Custom", serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.social-link {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: rgba(220, 205, 182, 0.82);
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.social-link:hover {
  color: rgba(220, 205, 182, 1);
  transform: translateY(-1px);
}

.social-link svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.social-link-itch-mark {
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  mask-image: url("assets/itchio-logo-textless-white.png");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url("assets/itchio-logo-textless-white.png");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  transform: scale(0.96);
}

.gallery-shell {
  position: relative;
  z-index: 1;
  margin-top: -400px;
  padding-bottom: 40px;
  opacity: 0;
  transform: translateY(40px);
  pointer-events: none;
  transition:
    opacity 420ms ease,
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-shell.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 24px;
  gap: 18px;
}

.gallery-card {
  grid-column: span 4;
  grid-row: span 14;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.gallery-card-intro {
  position: relative;
  padding: 18px;
  overflow: hidden;
  background: rgba(10, 7, 5, 0.72);
  border: 1px solid rgba(220, 205, 182, 0.08);
  cursor: default;
}

.gallery-card:nth-child(8n + 1) {
  grid-column: span 8;
  grid-row: span 18;
}

.gallery-card:nth-child(8n + 2) {
  grid-column: span 4;
  grid-row: span 18;
}

.gallery-card:nth-child(8n + 3) {
  grid-column: span 5;
  grid-row: span 13;
}

 .gallery-card:nth-child(8n + 4) {
  grid-column: span 7;
  grid-row: span 13;
}

.gallery-card:nth-child(8n + 5) {
  grid-column: span 3;
  grid-row: span 11;
}

.gallery-card:nth-child(8n + 6) {
  grid-column: span 5;
  grid-row: span 11;
}

.gallery-card:nth-child(8n + 7) {
  grid-column: span 4;
  grid-row: span 16;
}

.gallery-card:nth-child(8n + 8) {
  grid-column: span 8;
  grid-row: span 16;
}

.gallery-card.gallery-card-game-portrait {
  grid-column: span 4;
  grid-row: span 18;
}

.gallery-card.gallery-card-game-null {
  grid-column: span 5;
  grid-row: span 10;
}

.gallery-card.gallery-card-website {
  grid-column: span 8;
  grid-row: span 11;
}

.gallery-card.gallery-card-bicycleclub {
  grid-column: span 7;
  grid-row: span 10;
}

.gallery-card.gallery-card-scene-3 {
  grid-row: span 10;
}

.gallery-card.gallery-card-scene-2 {
  grid-row: span 10;
}


.gallery-thumb-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: rgba(9, 7, 6, 0.8);
}

.gallery-card.gallery-card-game .gallery-thumb-wrap {
  border: 1px solid rgba(220, 205, 182, 0.06);
  background: rgba(9, 7, 6, 0.92);
}

.gallery-ascii-thumb {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.gallery-ascii-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgba(112, 211, 122, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  line-height: 10px;
  white-space: pre;
  transform-origin: center center;
  text-shadow: 0 0 6px rgba(54, 179, 72, 0.2);
  will-change: transform;
}

.gallery-intro-inner {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
}

.gallery-intro-body {
  max-width: 18ch;
  color: rgba(220, 205, 182, 0.86);
  font-family: "Nyght Serif Custom", serif;
  font-size: clamp(34px, 3.8vw, 62px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.gallery-intro-body p {
  margin: 0 0 12px;
}

.gallery-intro-body p:last-child {
  margin-bottom: 0;
}

.gallery-intro-ascii {
  position: absolute;
  inset: -32px;
  z-index: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: rgba(220, 205, 182, 0.1);
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  line-height: 0.92;
  letter-spacing: -0.01em;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transform: scale(1.08);
  transform-origin: center;
  filter: contrast(1.08);
}

.gallery-thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 6, 5, 0.82), rgba(8, 6, 5, 0.08) 56%, rgba(8, 6, 5, 0));
  opacity: 0;
  transition: opacity 220ms ease;
}

.gallery-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
  transition: transform 260ms ease, opacity 260ms ease;
}

.gallery-thumb-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.9) contrast(1.02);
  transition: transform 260ms ease, opacity 260ms ease;
}

.gallery-thumb-video-right {
  object-position: 72% center;
}

.gallery-thumb-game {
  object-fit: cover;
  object-position: center center;
}

.gallery-card-game-portrait .gallery-thumb-game {
  object-position: center top;
}

.gallery-card:hover .gallery-thumb,
.gallery-card:hover .gallery-thumb-video {
  transform: scale(1.02);
  opacity: 0.94;
}

.gallery-copy {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  z-index: 1;
  padding-top: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-card-title,
.gallery-card-meta {
  margin: 0;
}

.gallery-card-title {
  color: var(--text);
  font-size: 15px;
  font-family: "Tiempos Text Regular", "Tiempos Text", serif;
  font-weight: 400;
}

.gallery-card-meta {
  margin-top: 6px;
  color: rgba(220, 205, 182, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.gallery-card:hover .gallery-thumb-wrap::after,
.gallery-card:hover .gallery-copy {
  opacity: 1;
  transform: translateY(0);
}

.post-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 48px 24px 24px;
  align-content: start;
}

.post-overlay[hidden] {
  display: none;
}

.post-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 2, 0.82);
  backdrop-filter: blur(18px);
}

.post-panel {
  position: relative;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 0;
  overflow: auto;
  background: rgba(13, 10, 8, 0.92);
  border: 1px solid rgba(220, 205, 182, 0.08);
}

.post-panel.is-game {
  width: min(calc((100vh - 230px) * 1.62), calc(100vw - 160px));
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.post-panel.is-game::-webkit-scrollbar {
  display: none;
}

#postBanner[hidden],
.post-banner-video[hidden] {
  display: none;
}

.post-game-wrap[hidden] {
  display: none;
}

.post-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  border: 0;
  background: rgba(8, 6, 5, 0.74);
  color: rgba(220, 205, 182, 0.8);
  padding: 8px 10px;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
}

.post-banner {
  display: block;
  width: 100%;
  height: min(44vh, 420px);
  object-fit: cover;
}

.post-carousel[hidden] {
  display: none;
}

.post-carousel {
  position: relative;
  width: 100%;
  height: min(44vh, 420px);
  background: rgba(9, 7, 6, 0.96);
  overflow: hidden;
}

.post-carousel-viewport {
  position: absolute;
  inset: 0;
}

.post-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  background: rgba(9, 7, 6, 0.96);
}

.post-carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.post-carousel-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-carousel-ascii {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.post-carousel-ascii pre {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgba(112, 211, 122, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 12px;
  white-space: pre;
  transform-origin: center center;
  text-shadow: 0 0 6px rgba(54, 179, 72, 0.22);
  will-change: transform;
}

.post-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(220, 205, 182, 0.14);
  background: rgba(8, 6, 5, 0.72);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.post-carousel-prev {
  left: 14px;
}

.post-carousel-next {
  right: 14px;
}

.post-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1;
}

.post-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(220, 205, 182, 0.28);
  padding: 0;
}

.post-carousel-dot.is-active {
  background: rgba(220, 205, 182, 0.84);
}

.post-banner-video[hidden] {
  display: none;
}

.post-game-wrap {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1920 / 1118;
  background: #0a0705;
  overflow: hidden;
  position: relative;
}

.post-game-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1118px;
  margin: 0;
  border: 0;
  background: #0a0705;
  transform: translate(-50%, -50%) scale(var(--game-scale, 1));
  transform-origin: center center;
}

.post-panel.is-game .post-body {
  flex: 0 0 auto;
  padding: 14px 18px 18px;
}

.post-panel.is-game .post-title {
  font-size: clamp(20px, 2.4vw, 32px);
}

@media (max-width: 900px) {
  .post-panel.is-game {
    width: min(calc((100vh - 180px) * 1.28), calc(100vw - 32px));
  }

  .post-game-wrap {
    aspect-ratio: 1920 / 1118;
  }
}

.post-body {
  padding: 28px 28px 36px;
}

.post-meta {
  margin: 0 0 10px;
  color: rgba(220, 205, 182, 0.58);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.post-title {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(28px, 4vw, 52px);
  line-height: 0.98;
  font-family: "Tiempos Text Regular", "Tiempos Text", serif;
  font-weight: 400;
}

.post-content {
  max-width: 64ch;
  color: rgba(220, 205, 182, 0.86);
  font-size: 14px;
  line-height: 1.7;
}

.post-content p {
  margin: 0 0 16px;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}

.post-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid rgba(220, 205, 182, 0.16);
  background: rgba(220, 205, 182, 0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.post-action-link:hover {
  background: rgba(220, 205, 182, 0.12);
  border-color: rgba(220, 205, 182, 0.28);
}

.hidden-video {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
    padding-bottom: 80px;
  }

  .hero-shell {
    padding: 16px 0;
    transform: translateY(-96px);
  }

  .ascii-output {
    font-size: clamp(6px, 1.85vw, 10px);
  }

  .ascii-stage {
    transform: translateX(14px);
  }

  .gallery-shell {
    margin-top: -156px;
  }

  .gallery-grid,
  .gallery-card,
  .gallery-card:nth-child(8n + 1),
  .gallery-card:nth-child(8n + 2),
  .gallery-card:nth-child(8n + 3),
  .gallery-card:nth-child(8n + 4),
  .gallery-card:nth-child(8n + 5),
  .gallery-card:nth-child(8n + 6),
  .gallery-card:nth-child(8n + 7),
  .gallery-card:nth-child(8n + 8),
  .gallery-card.gallery-card-game-portrait,
  .gallery-card.gallery-card-website {
    grid-column: 1 / -1;
    grid-row: span 12;
  }

  .post-overlay {
    padding: 28px 12px 12px;
  }

  .post-panel {
    width: min(100vw - 24px, 980px);
    max-height: calc(100vh - 24px);
  }

  .post-body {
    padding: 20px 18px 28px;
  }

  .post-banner {
    height: 32vh;
  }

  .post-carousel {
    height: 32vh;
  }

  .post-carousel-nav {
    width: 34px;
    height: 34px;
  }
}
