/* ============================================
   PORTFOLIO — Cyberpunk / Retro Tokyo / Akira Skin
   Standalone — no imports from style.css
   ============================================ */

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

/* === VARIABLES === */
:root {
  /* Background pulled from Shader site — warm dark charcoal, clearly NOT black */
  --bg:       #242120;   /* warm dark charcoal — matches Shader's general bg tone */
  --bg-2:     #2E2B28;   /* lifted warm surface for cards */
  --bg-3:     #38342F;   /* card hover layer */
  --text:     #EDE5D0;   /* warm parchment off-white */
  --text-dim: #B5A896;   /* warm muted brown-grey, lightened for readability on dark bg */

  --red:      #FF1A4B;   /* hot neon pink-red — the neon stripes */
  --magenta:  #E0177A;   /* deep magenta — the "Foos" sign glow */
  --purple:   #8833CC;   /* violet — building sign faces */
  --amber:    #FFB800;   /* warm gold neon — street sign warmth */
  --cyan:     #00CFEF;   /* electric teal */
  --green:    #00FF9F;   /* terminal green */

  --red-glow: rgba(255, 26, 75, 0.22);
  --red-line: rgba(255, 26, 75, 0.32);

  /* Fonts */
  /* --font:      'Space Mono', 'Courier New', monospace; */
  --font:         'IBM Plex Mono', 'Courier New', monospace;
  --font-display: 'Figtree', sans-serif;

  --nav-h:    68px;
  --pad:      clamp(20px, 5vw, 80px);
  --gap:      10px;
  --section:  clamp(80px, 10vw, 160px);

  /* Custom easing */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-swipe:  cubic-bezier(0.76, 0, 0.24, 1);
}

/* === BASE === */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

/* === SCAN LINES === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  z-index: 9990;
  pointer-events: none;
}

/* === CRT VIGNETTE === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 9989;
  pointer-events: none;
}

@media (hover: none) {
  body { cursor: auto; }
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* === CUSTOM CURSOR — red === */
.cursor,
.cursor-follower {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  top: -100px;
  left: -100px;
}

.cursor {
  width: 8px;
  height: 8px;
  background: var(--red);
  transition: width 0.3s var(--ease-out),
              height 0.3s var(--ease-out),
              opacity 0.3s;
}

.cursor-follower {
  width: 36px;
  height: 36px;
  overflow: visible;
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}

.cursor-ring__track {
  fill: none;
  stroke: rgba(217, 26, 42, 0.3);
  stroke-width: 1.5;
}

.cursor-ring__progress {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
  transform-origin: 18px 18px;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.12s linear;
}

.cursor.is-hovering {
  width: 0;
  height: 0;
  opacity: 0;
}

.cursor-follower.is-hovering {
  transform: translate(-50%, -50%) scale(1.56);
  opacity: 0.6;
}

/* === PAGE TRANSITION — red sweep === */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--red);
  z-index: 8000;
  pointer-events: none;
  transform: translateY(100%);
}

.page-transition.entering {
  pointer-events: all;
  transform: translateY(0);
  transition: transform 0.55s var(--ease-swipe);
}

.page-transition.exiting {
  transform: translateY(-100%);
  transition: transform 0.55s var(--ease-swipe);
}

/*
  Raise all page content above scan lines (body::before at z-index: 9990).
  Using semantic element selectors so ANY new section/header/footer added
  to the page is automatically above scan lines — no manual list to maintain.
  .project-hero-img is a div (not a section) so it's listed explicitly.
*/
body > header,
body > section,
body > footer,
body > .project-hero-img {
  position: relative;
  z-index: 9991;
}

/* === TYPOGRAPHY UTILITIES === */
.label {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--red);
}

/* Terminal data prefix */
.label::before {
  content: '';
}

/* === REVEAL / MASK ANIMATIONS === */
.reveal-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
}

.reveal-text {
  display: block;
  transform: translateY(105%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform;
}

body:not(.is-loading) .hero .reveal-text {
  transform: translateY(0);
}

.reveal-on-scroll.is-visible .reveal-text {
  transform: translateY(0);
}

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 9995;
}

.nav__bg {
  position: absolute;
  inset: 0;
  background: rgba(13, 11, 24, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 26, 42, 0.35);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.nav.is-scrolled .nav__bg {
  opacity: 0;
}

.nav__left {
  display: flex;
  align-items: center;
  gap: 62px;
  position: relative;
  z-index: 1;
}

.nav__logo {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__clock {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px rgba(255, 26, 75, 0.5);
}

.nav__link {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  position: relative;
  padding-bottom: 1px;
  transition: color 0.25s;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.35s var(--ease-out);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  width: 100%;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + clamp(48px, 7vw, 100px));
  padding-left: var(--pad);
  padding-right: var(--pad);
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Red grid background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(217, 26, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 26, 42, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

/* Stagger hero lines */
.hero__heading .reveal-wrap:nth-child(1) .reveal-text { --reveal-delay: 80ms; }
.hero__heading .reveal-wrap:nth-child(2) .reveal-text { --reveal-delay: 160ms; }
.hero__heading .reveal-wrap:nth-child(3) .reveal-text { --reveal-delay: 240ms; }

.hero__heading .reveal-text {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--red);
  text-shadow: 0 0 60px rgba(217, 26, 42, 0.25);
}

/* Italic em accent — amber */
.hero__heading em,
.project-title-block em,
.about__heading em,
.next-project__title em {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  font-weight: 400;
  color: var(--amber);
}

.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-top: clamp(40px, 6vw, 80px);
  max-width: 920px;
}

.hero__meta-left .label {
  display: block;
  margin-bottom: 14px;
}

.hero__meta-left p {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
}

/* Available badge */
.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--green);
}

.available-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px rgba(0, 255, 159, 0.4);
  flex-shrink: 0;
  animation: blink-dot 1.2s step-end infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* No sonar ::after on the retro version — dot blinks instead */
.available-dot::after {
  display: none;
}

.hero__bio {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
}

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: clamp(32px, 4vw, 60px);
}

.hero__scroll-line {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: var(--red-line);
  display: block;
}

/* ============================================
   HERO — SEARCH VARIANT (retro)
   ============================================ */
.hero--search {
  justify-content: flex-start;
  padding-bottom: 50px;
}

.hero__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(36px, 5vw, 56px);
  width: 100%;
  padding-bottom: 60px;
}

/* Override .hero > * z-index so .hero__center doesn't form a stacking context —
   mix-blend-mode on the search panel needs to see the heading pixels directly. */
.hero--search .hero__center {
  position: relative;
  z-index: auto;
}

.hero--search .hero__heading .reveal-text {
  font-size: 62px;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: -0.03em;
  word-spacing: -0.15em;
}

.hero--search .hero__scroll {
  margin-top: auto;
  align-self: flex-start;
  padding-top: 0;
}

/* ---- Search bar ---- */
.hero__search {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
  border: 2px solid var(--red);
  border-radius: 100px;
  background: transparent;
  transition: border-color 0.25s, border-width 0.25s, box-shadow 0.25s;
  box-shadow: 0 0 4px 0px rgba(255, 214, 224, 0.45),
              0 0 9px 1px rgba(255, 140, 175, 0.55),
              0 0 16px 3px rgba(255, 70, 120, 0.5),
              0 0 26px 5px rgba(255, 26, 75, 0.4),
              0 0 38px 8px rgba(255, 26, 75, 0.22);
}

.search-form:focus-within {
  border-color: var(--red);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  padding: 14px 20px;
  color: var(--text);
  cursor: text;
  letter-spacing: 0.04em;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-submit {
  border: none;
  background: var(--red);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 12px var(--red-glow);
}

.search-submit:hover {
  background: var(--magenta);
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(224, 23, 122, 0.4);
}

.search-response {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
  width: 100%;
  max-width: 700px;
  text-align: left;
  padding-left: 20px;
  min-height: 3.6em;
  opacity: 0;
  transition: opacity 0.2s;
  letter-spacing: 0.03em;
}

.search-response.is-visible {
  opacity: 1;
}

.search-link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-response.is-thinking::after,
.search-response.is-typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--red);
  opacity: 0.8;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 0; }
}

/* ---- Recent searches panel ---- */
.hero--search {
  z-index: 9993; /* above pinball canvas (9992) so search panel stays visible;
                    still below .drag-overlay (9994) so the coin's drag overlay
                    dims the search hero too, same as it does the thumbnails */
}

.hero--search .search-panel {
  position: absolute;
  width: 190px;
  text-align: left;
  mix-blend-mode: difference;
  z-index: 2;
  transition: left 0.05s linear;
}

.search-panel__label {
  display: block;
  margin-bottom: 8px;
  padding-left: 16px;
  color: rgba(255, 255, 255, 0.55);
}

/* Remove the // prefix for the search panel label */
.search-panel__label::before {
  content: none;
}

.search-panel__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-panel__item {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: white;
  padding: 0;
  padding-left: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.search-panel__item:hover {
  opacity: 0.5;
}


@media (max-width: 900px) {
  .search-panel { display: none; }
}

/* ============================================
   WORKS GRID
   ============================================ */
.works {
  padding: 0 var(--pad) var(--section);
  max-width: calc(1120px + 2 * var(--pad));
  margin-inline: auto;
}

/* Pinball is on: the works section (which already establishes its own
   stacking context via body>section) pops above the dim overlay (9996) so
   its thumbnails read at full brightness. The game canvas (9999) stays
   above everything, so its own graphics are never occluded by them. A
   child's z-index alone (e.g. .project-card__image) can't escape .works's
   own stacking context — the ancestor itself has to be the one raised. */
.pinball-active .works {
  z-index: 9997;
}

/* ---- Full-width card ---- */
.project-card--full {
  margin-bottom: calc(var(--gap) + 15px);
}

.project-card--full .project-card__image {
  aspect-ratio: 16 / 7;
}

/* ---- Rows ---- */
.project-row {
  display: grid;
  gap: var(--gap);
  margin-bottom: calc(var(--gap) + 15px);
}

.project-row--4 { grid-template-columns: repeat(4, 1fr); }
.project-row--2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Stagger in rows */
.project-row .project-card:nth-child(1) { --reveal-delay: 0ms; }
.project-row .project-card:nth-child(2) { --reveal-delay: 80ms; }
.project-row .project-card:nth-child(3) { --reveal-delay: 160ms; }
.project-row .project-card:nth-child(4) { --reveal-delay: 240ms; }

/* ---- Card ---- */
.project-card {
  cursor: none;
}

.project-card__link {
  display: block;
}

.project-card__image {
  overflow: hidden;
  position: relative;
  background: var(--bg-2);
  border-radius: 12px;
  transition: outline 0.3s, box-shadow 0.3s;
}


.project-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.75s var(--ease-out);
  will-change: transform;
}

.project-card__link:hover .project-card__img {
  transform: scale(1.05);
}

.project-row--4 .project-card__image {
  aspect-ratio: 4 / 3;
}

.project-row--3 .project-card__image {
  aspect-ratio: 4 / 3;
}

.project-row--2 .project-card__image {
  aspect-ratio: 16 / 10;
}

/* Card hover — red glow outline */
.project-card__link:hover .project-card__image {
  outline: 1px solid rgba(217, 26, 42, 0.6);
  box-shadow: 0 0 24px rgba(217, 26, 42, 0.12);
}

/* Placeholder fill — dark atmospheric purples */
.project-card__placeholder {
  position: absolute;
  inset: 0;
  background: hsl(var(--ph-hue, 25deg), 8%, var(--ph-l, 14%));
  transition: transform 0.75s var(--ease-out);
  will-change: transform;
}

/* Subtle diagonal stripe on dark */
.project-card__placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 255, 0.04) 40px,
      rgba(255, 255, 255, 0.04) 41px
    );
  opacity: 0.4;
}

.project-card__link:hover .project-card__placeholder {
  transform: scale(1.05);
}

/* Subtle red tint overlay on hover */
.project-card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(217, 26, 42, 0);
  transition: background 0.4s;
  z-index: 1;
  pointer-events: none;
}

.project-card__link:hover .project-card__image::before {
  background: rgba(217, 26, 42, 0.04);
}

/* Info row */
.project-card__info {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 12px;
}

.project-card__category {
  display: block;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0;
  line-height: 1.4;
}

.project-card__year {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1.4;
}

.project-card__title {
  font-family: var(--font);
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: right;
  color: var(--text);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: clamp(40px, 5vw, 80px) var(--pad) var(--section);
  border-top: 1px solid var(--red-line);
}

.about__inner {
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  gap: 120px;
  align-items: start;
}

/* Bio heading + body */
.about__bio-heading {
  flex: 0 0 42%;
  max-width: 42%;
}

.about__bio-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
}

.about__bio-body {
  margin-top: 30px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}

.about__strike {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}

/* 2-column grid */
.about__columns {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 120px;
  align-items: start;
  justify-content: start;
}

.about__col-label {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 28px;
}

.about__col-label--spaced {
  margin-top: 40px;
}

.about__col-entry {
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.55;
}

.about__col-entry strong {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.about__col-entry span {
  color: var(--text-dim);
}

.about__col-list {
  list-style: none;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-dim);
}

.about__col-group {
  margin-bottom: 24px;
}

.about__col-group strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.about__col-link {
  text-decoration: underline;
  color: var(--cyan);
  font-size: 13px;
  transition: opacity 0.2s;
}

.about__col-link:hover {
  opacity: 0.6;
}

.about__col-plain {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: clamp(40px, 5vw, 80px) var(--pad) 40px;
  border-top: 1px solid var(--red-line);
}

.footer__cta {
  max-width: 1120px;
  margin-inline: auto;
  margin-bottom: 24px;
}

.footer__cta .label {
  display: block;
  margin-bottom: 20px;
}

.footer__label--large {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-transform: none;
  color: var(--text);
}

@media (max-width: 768px) {
  .footer__label--large {
    font-size: 28px;
  }
}

.footer__email {
  display: inline-block;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--red);
  position: relative;
}

.footer__email::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.45s var(--ease-out);
}

.footer__email:hover::after {
  width: 100%;
}

.footer__bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 16px;
}

/* Socials moved under the email */
.footer__socials {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

/* Live clock — retro style */
.footer__clock {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255, 26, 75, 0.4);
}

.footer__social {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  position: relative;
  padding-bottom: 1px;
  transition: color 0.25s;
}

.footer__social::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.footer__social:hover {
  color: var(--text);
}

.footer__social:hover::after {
  width: 100%;
}

/* ============================================
   PROJECT PAGE
   ============================================ */
.project-intro {
  padding: calc(var(--nav-h) + clamp(48px, 6vw, 80px)) var(--pad) 0;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: clamp(40px, 5vw, 72px);
  position: relative;
  padding-bottom: 1px;
  transition: color 0.25s;
}

.project-back::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}

.project-back:hover {
  color: var(--red);
}

.project-back:hover::after {
  width: 100%;
}

.project-back .arrow {
  font-size: 14px;
  transition: transform 0.25s var(--ease-out), color 0.25s;
}

.project-back:hover .arrow {
  transform: translateX(-4px);
  color: var(--red);
}

/* Project title */
.project-title-block {
  margin-bottom: clamp(40px, 5vw, 64px);
}

/* Stagger project title lines */
.project-title-block .reveal-wrap:nth-child(1) .reveal-text { --reveal-delay: 60ms; }
.project-title-block .reveal-wrap:nth-child(2) .reveal-text { --reveal-delay: 140ms; }

.project-title-block .reveal-text {
  font-family: var(--font-display);
  font-size: clamp(42px, 6.5vw, 100px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--red);
  text-shadow: 0 0 60px rgba(217, 26, 42, 0.2);
}

/* Metadata row */
/* 3-column project overview */
.project-overview {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  border-bottom: 1px solid var(--red-line);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.project-overview--no-stats {
  grid-template-columns: 1fr 2fr;
}

.project-overview--no-stats .project-overview__col:last-child {
  padding-right: 100px;
}

.project-overview__col {
  padding: clamp(36px, 4vw, 60px) clamp(28px, 3vw, 48px);
  border-right: 1px solid var(--red-line);
}

.project-overview__col:first-child {
  padding-left: 0;
}

.project-overview__col:last-child {
  border-right: none;
  padding-right: 0;
}

.project-overview__label {
  display: block;
  margin-bottom: 14px;
}

.project-overview__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.project-overview__summary {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 28px;
}

.project-overview__section {
  margin-bottom: 20px;
}

.project-overview__section-title {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-overview__section-body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}

.project-overview__section-body + .project-overview__section-body {
  margin-top: 12px;
}

/* Stats */
.project-stats {
  list-style: none;
}

.project-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--red-line);
}

.project-stat:first-child {
  padding-top: 0;
}

.project-stat__number {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.project-stat__desc {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}

/* Project hero image */
.project-hero-img {
  padding: 0 var(--pad);
  margin-bottom: 25px;
}

.project-hero-img > img,
.project-hero-img > video {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.project-hero-img .project-placeholder {
  aspect-ratio: 16 / 8;
}

/* Hero image slide cycle */
.hero-cycle {
  position: relative;
  overflow: hidden;
  display: block;
  line-height: 0;
  border-radius: 12px;
}

.hero-cycle__img {
  display: block;
  width: 100%;
}

.hero-cycle__img--b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-slide-b 7s linear infinite;
}

@keyframes hero-slide-b {
  0%          { transform: translateX(100%);  animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  8%          { transform: translateX(0); }
  50%         { transform: translateX(0);     animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  58%         { transform: translateX(-100%); animation-timing-function: step-start; }
  58.1%, 100% { transform: translateX(100%); }
}

/* Archive card image cycle */
.archive-cycle {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.archive-cycle__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archive-cycle__img--nxt {
  transform: translateX(100%);
}

/* Project gallery */
.project-gallery {
  padding: 0 var(--pad) var(--section);
}

.project-gallery .project-row {
  gap: 25px;
  margin-bottom: 25px;
}

.project-gallery__full {
  margin-bottom: 25px;
}

.project-gallery img,
.project-gallery video {
  border-radius: 12px;
  display: block;
  width: 100%;
}

/* Centered image — renders at natural width, no scale-up */
.project-gallery__centered {
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
}

.project-gallery__centered img {
  width: auto;
  max-width: 100%;
}

.project-split__image {
  border-radius: 12px;
  overflow: hidden;
}

.project-split__image img {
  display: block;
  width: 100%;
}

/* Copy block */
.project-copy-block {
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.project-copy-block__heading {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.project-gallery__video-frame {
  background: var(--bg-2);
}

.project-copy-block__body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-dim);
}

/* Split block */
.project-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  align-items: start;
  margin-top: clamp(48px, 6vw, 80px);
  margin-bottom: 25px;
}

.project-split--reverse {
  grid-template-columns: 1fr 1fr;
}

.project-split--reverse .project-split__image {
  order: 2;
}

.project-split--reverse .project-split__copy {
  order: 1;
  padding-left: 20px;
  padding-right: 40px;
}

.project-split__copy {
  padding-top: 40px;
  padding-right: 35px;
}

.project-split__heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.project-split__body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-dim);
}

/* Dark panel split variant */
.project-split--stretch {
  align-items: stretch;
}

.project-split__copy--dark {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-split__copy--dark .project-split__heading {
  color: #fff;
}

.project-split__copy--dark .project-split__body {
  color: rgba(255, 255, 255, 0.65);
}

.project-split__image--dark {
  border-radius: 12px;
  overflow: hidden;
  background: #1e1e1e;
}

.project-split__image--dark img {
  display: block;
  width: 100%;
}

/* Unified dark split — no gap, shared background */
.project-split--unified-dark {
  background: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  gap: 0;
}

.project-split--unified-dark .project-split__image,
.project-split--unified-dark .project-split__image--dark {
  border-radius: 0;
}

.project-split--unified-dark .project-split__copy--dark {
  background: transparent;
  border-radius: 0;
}

/* 3-up row */
.project-row--3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Station cycler (fb2) */
.project-fullbleed-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 25px;
}

.project-fullbleed-2__left,
.project-fullbleed-2__right {
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.fb2-photo {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.fb2-photo--active {
  transform: translateX(0);
}

.fb2-photo--exit {
  transform: translateX(-100%);
}

.fb2-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fb2-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  transition: opacity 0.4s ease;
}

.fb2-video ~ .fb2-video {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}

.fb2-video--active {
  opacity: 1;
}

.fb2-video:not(.fb2-video--active) {
  opacity: 0;
}

.fb2-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.fb2-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.fb2-dot--active {
  background: #fff;
  border-color: #fff;
}

/* --- 3-panel swipe cycler --- */
.fb3-cell {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

/* Set A: in normal flow — sizes the cell */
.fb3-img--a {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Set B: absolute overlay, hidden until wipe reveals it */
.fb3-img--b {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: none;
}

.fb3-cell.showing-b .fb3-img--b {
  opacity: 1;
}

/* Trainswipe curtain — slides in, holds, slides out */
.fb3-wipe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateX(-101%);
  z-index: 10;
  pointer-events: none;
  will-change: transform;
}

.fb3-cell.is-wipe-in .fb3-wipe {
  animation: fb3WipeIn 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fb3-cell.is-held .fb3-wipe {
  transform: translateX(0);
}

.fb3-cell.is-wipe-out .fb3-wipe {
  animation: fb3WipeOut 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fb3WipeIn {
  from { transform: translateX(-101%); }
  to   { transform: translateX(0); }
}

@keyframes fb3WipeOut {
  from { transform: translateX(0); }
  to   { transform: translateX(101%); }
}

/* Gallery placeholders */
.project-placeholder {
  background: hsl(var(--ph-hue, 250deg), 20%, var(--ph-l, 13%));
  width: 100%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.project-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 255, 0.04) 40px,
      rgba(255, 255, 255, 0.04) 41px
    );
  opacity: 0.4;
}

/* Caption under gallery image */
.gallery-caption {
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding-top: 10px;
  line-height: 1.6;
}

/* ============================================
   PROJECT THUMBNAIL CAROUSEL (stacking)
   ============================================ */
.projects-carousel-section {
  display: flex;
  align-items: flex-start;
  gap: clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--red-line);
  padding: clamp(40px, 6vw, 72px) 0;
}

.projects-carousel__label {
  flex-shrink: 0;
  padding-left: var(--pad);
  line-height: 1.05;
}

.projects-carousel__label-line {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
}

.projects-carousel {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.projects-carousel::-webkit-scrollbar { display: none; }
.projects-carousel.is-dragging        { cursor: grabbing; }

.projects-carousel__track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.project-thumb {
  display: block;
  flex-shrink: 0;
  width: clamp(240px, 26vw, 380px);
  text-decoration: none;
  color: inherit;
  position: sticky;
  left: 0;
  background: var(--bg);
  border-radius: 12px;
}

.project-thumb__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-2);
}

.project-thumb__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Next project link */
.next-project {
  padding: var(--section) var(--pad);
  border-top: 1px solid var(--red-line);
}

.next-project__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.next-project .label {
  display: block;
  margin-bottom: 20px;
}

.next-project__link {
  display: block;
  width: 100%;
}

.next-project__title .reveal-text {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 80px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--red);
}

.next-project__arrow {
  display: block;
  font-size: 48px;
  font-weight: 300;
  margin-top: 20px;
  color: var(--red);
  transition: transform 0.35s var(--ease-out), color 0.25s;
}

.next-project__link:hover .next-project__arrow {
  transform: translateX(12px);
  color: var(--amber);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .project-meta {
    grid-template-columns: 80px 1fr 1fr;
  }
  .project-meta__item:last-child {
    grid-column: 2 / -1;
    border-top: 1px solid var(--red-line);
    padding-top: 24px;
  }
}

@media (max-width: 1024px) {
  .project-row--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__inner {
    flex-direction: column;
    gap: 40px;
  }

  .about__bio-heading {
    flex: none;
    max-width: 100%;
  }

  .about__columns {
    grid-template-columns: repeat(2, auto);
    gap: 60px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav__menu { gap: 20px; }

  .project-overview {
    grid-template-columns: 1fr;
  }

  .project-overview__col {
    border-right: none;
    border-bottom: 1px solid var(--red-line);
    padding: clamp(28px, 4vw, 40px) 0;
  }

  .project-overview__col:last-child {
    border-bottom: none;
    padding-right: 0;
  }

  .project-split,
  .project-split--reverse {
    grid-template-columns: 1fr;
  }

  .project-split--reverse .project-split__image,
  .project-split--reverse .project-split__copy {
    order: unset;
  }

  .hero__meta {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-row--4,
  .project-row--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .project-meta {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .project-meta__item:last-child {
    grid-column: auto;
    border-top: none;
    padding-top: 0;
  }
}

@media (max-width: 580px) {
  .about__columns {
    grid-template-columns: 1fr;
  }

  .project-row--4,
  .project-row--2 {
    grid-template-columns: 1fr;
  }

  .project-card--full .project-card__image {
    aspect-ratio: 4 / 3;
  }

  .nav__menu { gap: 16px; }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .project-meta__item:last-child {
    border-top: none;
    padding-top: 0;
  }

  /* Disable custom cursor on touch */
  body { cursor: auto; }
  .cursor,
  .cursor-follower { display: none; }

  /* Hero tagline — match the project title size (e.g. "Fireside") on mobile */
  .hero--search .hero__heading .reveal-text {
    font-size: 36px;
  }

  /* Homepage work grid: merge the two 3-up rows into one continuous 2-column
     flow so it reads as clean pairs (2/2/2) instead of each 3-item row
     wrapping on its own (2/1/2/1). The 2-up row (Fireside+Oxrow) is left
     as its own full-width row, untouched. */
  .works {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 20px;
  }

  .project-row--2 {
    grid-column: 1 / -1;
  }

  .project-row--3 {
    display: contents;
  }

  /* Tighten space above card title/category by 2px */
  .project-card__info {
    padding-top: 10px;
  }

  /* TL;DR/Problem/Research column was losing ~100px to a desktop-only
     right-padding rule that's more specific than the 768px reset —
     match its specificity so mobile actually gets full width. */
  .project-overview--no-stats .project-overview__col:last-child {
    padding-right: 0;
  }

  /* Right-align the nav clock so wrapped "TPE" / time lines share an edge */
  .nav__clock {
    text-align: right;
  }

  /* Nav: drop the clock and let the menu take its spot on the right,
     top-aligned with "Adam Chang". .nav__left is unwrapped via
     display:contents so the logo and menu become direct children of
     .nav, letting justify-content: space-between push the menu all the
     way to the far right instead of sitting next to the logo. */
  .nav {
    align-items: flex-start;
    padding-top: 24px;
  }

  .nav__left {
    display: contents;
  }

  .nav__clock {
    display: none;
  }
}

/* ============================================
   FILM GRAIN OVERLAY
   Animated SVG feTurbulence noise — shifts
   position each frame to simulate film grain
   ============================================ */
/* Canvas grain — drawn by JS, sits behind all page content */
.film-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;           /* below nav, cards, text — above bare bg */
  pointer-events: none;
  mix-blend-mode: soft-light;  /* gentler — barely touches text/UI */
  opacity: 0.55;
}

/* ============================================
   THEME TOGGLE — iOS-style pill, bottom-left
   Retro version = ON state (red track, knob right)
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9995;
  /* pill dimensions — same as clean version */
  width: 44px;
  height: 26px;
  border-radius: 13px;
  /* ON track — neon red */
  background: var(--red);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: block;
  font-size: 0;
  box-shadow: 0 0 16px var(--red-glow),
              0 0 32px rgba(255, 26, 75, 0.15),
              inset 0 1px 3px rgba(0,0,0,0.2);
  transition: box-shadow 0.16s var(--ease-out),
              transform 0.2s var(--ease-out);
}

.theme-toggle:hover {
  box-shadow: 0 0 24px rgba(255, 26, 75, 0.6),
              0 0 48px rgba(255, 26, 75, 0.2),
              inset 0 1px 3px rgba(0,0,0,0.2);
  transform: scale(1.04);
}

/* Knob — RIGHT = on */
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  top: 3px;
  left: 21px; /* 44 - 20 - 3 */
  box-shadow: 0 1px 5px rgba(0,0,0,0.3),
              0 0 0 0.5px rgba(0,0,0,0.08);
  transition: left 0.16s var(--ease-out);
}

/* Pre-navigation slide, added by JS on click so the toggle visibly
   animates before the page-transition wipe covers the screen — a full
   page load follows, so there's otherwise no continuous DOM to animate. */
.theme-toggle.is-switching {
  background: rgb(51, 53, 58);
}

.theme-toggle.is-switching::after {
  left: 3px;
}

/* Tooltip */
.theme-toggle[data-tooltip]::before {
  display: none;
}

/* ── Arcade Coin ──────────────────────────────────────────────── */
.arcade-coin {
  position: fixed;
  bottom: 20px;
  left: 32px;
  width: 68px;
  height: 68px;
  z-index: 9995;
  cursor: grab;
  opacity: 0;
  transform: translateX(-110px) rotate(-360deg);
  pointer-events: none;
}

.arcade-coin.is-rolling {
  animation: coin-roll-in 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

.arcade-coin.has-landed {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@keyframes coin-roll-in {
  from {
    transform: translateX(-110px) rotate(-360deg);
    opacity: 0;
  }
  to {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
}

.arcade-coin::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 208%;
  height: 208%;
  margin-left: -104%;
  margin-top: -104%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,0,0.85) 0%, rgba(255,140,0,0.35) 35%, transparent 65%);
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.arcade-coin.is-glowing::before {
  animation: coin-glow-pulse 3s ease-in-out 3 forwards;
}

/* "Play" hover label — same styling as .label (EXPLORE, Where are you
   based?, etc.), centered above the coin with a 30px gap. */
.arcade-coin::after {
  content: 'Play';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 5px;
  transform: translateX(-50%);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.arcade-coin:hover::after {
  color: var(--red);
}

.arcade-coin.is-dragging::after {
  opacity: 0;
}

@keyframes coin-glow-pulse {
  0%   { opacity: 0;   transform: scale(0.6); }
  35%  { opacity: 1;   transform: scale(1);   }
  65%  { opacity: 0;   transform: scale(0.8); }
  100% { opacity: 0;   transform: scale(0.6); }
}

.arcade-coin__face,
.arcade-coin__side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  user-select: none;
}

.arcade-coin__side {
  width: auto;
  left: 50%;
  opacity: 0;
}

/* Smooth return to face-forward when not spinning */
.arcade-coin__face {
  transition: transform 0.35s ease-out, opacity 0.15s ease-out;
}

.arcade-coin__side {
  transition: opacity 0.15s ease-out;
}

/* JS adds .is-spinning on mouseenter, removes on mouseleave */
.arcade-coin.is-spinning .arcade-coin__face {
  animation: coin-face-spin 1.4s linear infinite;
  transition: none;
}

.arcade-coin.is-spinning .arcade-coin__side {
  animation: coin-side-spin 1.4s linear infinite;
  transition: none;
}

/* One rotation on idle — 0.7s covers exactly the first half of the keyframes */
.arcade-coin.is-idle-spinning .arcade-coin__face {
  animation: coin-face-spin 1.1s linear 1 forwards;
  transition: none;
}

.arcade-coin.is-idle-spinning .arcade-coin__side {
  animation: coin-side-spin 1.1s linear 1 forwards;
  transition: none;
}

@keyframes coin-face-spin {
  /* Easing is baked into keyframe stops so loop boundary is seamless */
  0%    { transform: scaleX(1); }
  10%   { transform: scaleX(0.8); }
  20%   { transform: scaleX(0.1); }
  23%   { transform: scaleX(0); }
  27%   { transform: scaleX(0); }
  30%   { transform: scaleX(0.1); }
  40%   { transform: scaleX(0.8); }
  50%   { transform: scaleX(1); }
  60%   { transform: scaleX(0.8); }
  70%   { transform: scaleX(0.1); }
  73%   { transform: scaleX(0); }
  77%   { transform: scaleX(0); }
  80%   { transform: scaleX(0.1); }
  90%   { transform: scaleX(0.8); }
  100%  { transform: scaleX(1); }
}

@keyframes coin-side-spin {
  0%, 18%   { opacity: 0; }
  23%, 27%  { opacity: 1; }
  32%, 68%  { opacity: 0; }
  73%, 77%  { opacity: 1; }
  82%, 100% { opacity: 0; }
}

/* ── Video wipe reveal on thumbnail hover ──────────────────────── */
.card-wipe {
  position: absolute;
  inset: 0;
  background: var(--red);
  z-index: 3;
  pointer-events: none;
  transform: translateX(-101%);
  will-change: transform;
}

.card-wipe.is-wiping-fwd {
  animation: card-wipe-fwd 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.card-wipe.is-wiping-bwd {
  animation: card-wipe-bwd 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes card-wipe-fwd {
  from { transform: translateX(-101%); }
  to   { transform: translateX(101%); }
}

@keyframes card-wipe-bwd {
  from { transform: translateX(101%); }
  to   { transform: translateX(-101%); }
}

.arcade-coin.is-dragging {
  cursor: grabbing;
  z-index: 9998;
}

/* Show edge view while holding */
.arcade-coin.is-dragging .arcade-coin__face {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.arcade-coin.is-dragging .arcade-coin__side {
  opacity: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 120%;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
}

/* Dark overlay behind insert + coin while dragging */
.drag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.90);
  z-index: 9994;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.drag-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.18;
  pointer-events: none;
  animation: overlay-grain 0.8s steps(8) infinite;
}

@keyframes overlay-grain {
  0%   { background-position:   0px   0px; }
  12%  { background-position: -60px  40px; }
  25%  { background-position:  30px -70px; }
  37%  { background-position: -80px -20px; }
  50%  { background-position:  50px  60px; }
  62%  { background-position: -30px -50px; }
  75%  { background-position:  70px  30px; }
  87%  { background-position: -50px  80px; }
  100% { background-position:   0px   0px; }
}

.drag-overlay.is-visible {
  opacity: 1;
}


/* Insert slot */
.coin-insert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9996;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: default;
}

.coin-insert img {
  display: block;
  height: 179px;
  width: auto;
  position: relative;
  z-index: 1;
}



.coin-insert.is-visible {
  opacity: 1;
}

/* Logo glows gold when coin hovers over it */
.nav__logo.drop-target--active {
  color: var(--amber);
  text-shadow: 0 0 20px rgba(255, 184, 0, 0.7);
  transition: color 0.15s, text-shadow 0.15s;
}

/* ============================================
   ARCHIVE PAGE (retro overrides)
   ============================================ */

.archive-gallery {
  padding: calc(var(--nav-h) + 64px) var(--pad) var(--section);
  max-width: calc(1120px + 2 * var(--pad));
  margin-inline: auto;
  position: relative;
  z-index: 9991;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 56px;
  row-gap: 80px;
  align-items: start;
}

.archive-item {
  cursor: pointer;
}

.archive-item__img-wrap {
  overflow: hidden;
  background: var(--bg-2);
  border-radius: 12px;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.archive-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: unset;
  transition: opacity 0.3s ease;
}

.archive-item:hover img {
  opacity: 0.75;
}

.archive-item__caption {
  margin-top: 10px;
}

.archive-item__title {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.archive-item__stat {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.6;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.archive-item__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.18s;
}

.archive-item__link:hover {
  color: var(--red);
}

.archive-item__link svg {
  flex-shrink: 0;
}

.archive-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 9, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.archive-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.archive-lightbox__img {
  display: block;
  max-width: min(653px, 90vw);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translateY(6px);
  opacity: 0;
  transition: transform 0.32s var(--ease-out), opacity 0.28s ease;
}

.archive-lightbox.is-open .archive-lightbox__img {
  transform: translateY(0);
  opacity: 1;
}

.archive-lightbox__close {
  position: absolute;
  top: 28px;
  left: 28px;
  background: none;
  border: none;
  font-size: 16px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  font-family: var(--font);
  transition: color 0.18s;
}

.archive-lightbox__close:hover {
  color: var(--red);
}

@media (max-width: 900px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 32px;
    row-gap: 56px;
  }
}

@media (max-width: 540px) {
  .archive-grid {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }
  .archive-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
  }
}
