* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --paper: #f4f3f0;
  --ink: #0a0a0a;
  --soft-ink: #2a2a2a;
  --muted: #555;
  --line: #d6d4cf;
  --accent: #b84f33;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

.gallery-page {
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

.gallery-hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
}

.gallery-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transform: scale(1.012);
  transition:
    opacity 1.6s cubic-bezier(.16, 1, .3, 1),
    transform 2s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.gallery-hero-canvas.is-visible {
  opacity: 1;
  transform: scale(1);
}

.gallery-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 40px;
  z-index: 5;
  mix-blend-mode: difference;
  color: #fff;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0;
}

.gallery-brand {
  font-size: 13px;
  font-weight: 700;
}

.gallery-topbar-meta {
  font-size: 11px;
  opacity: .85;
}

.gallery-hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  z-index: 4;
  pointer-events: none;
}

.gallery-kicker {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

.gallery-kicker > span {
  display: inline-block;
}

.gallery-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  line-height: .86;
  letter-spacing: 0;
  font-size: clamp(56px, 13vw, 220px);
  text-transform: uppercase;
  /* mask the letters' rise without clipping cap tops */
  overflow: hidden;
  padding-top: .16em;
  margin-top: -.16em;
  backface-visibility: hidden;
}

/* CSS-driven entrance — works with no JS / if gallery.js fails to load */
.gallery-title-letter {
  display: inline-block;
  will-change: transform;
  backface-visibility: hidden;
  animation: galleryTitleRise 1.1s cubic-bezier(.16, 1, .3, 1) both;
}

.gallery-title-letter:nth-child(1) { animation-delay: .20s; }
.gallery-title-letter:nth-child(2) { animation-delay: .27s; }
.gallery-title-letter:nth-child(3) { animation-delay: .34s; }
.gallery-title-letter:nth-child(4) { animation-delay: .41s; }
.gallery-title-letter:nth-child(5) { animation-delay: .48s; }
.gallery-title-letter:nth-child(6) { animation-delay: .55s; }
.gallery-title-letter:nth-child(7) { animation-delay: .62s; }

@keyframes galleryTitleRise {
  from { transform: translate3d(0, 110%, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-title-letter {
    animation: none;
    transform: none;
  }
}

.gallery-lede {
  margin-top: 32px;
  max-width: 760px;
  font-size: clamp(14px, 1.4rem, 18px);
  line-height: 1.75;
  font-weight: 400;
  color: var(--soft-ink);
}

.gallery-scrollcue,
.gallery-work-count {
  position: absolute;
  bottom: 28px;
  z-index: 5;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0;
}

.gallery-scrollcue {
  left: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-scrollcue::before {
  content: "";
  width: 1px;
  height: 36px;
  background: var(--ink);
  display: inline-block;
}

.gallery-work-count {
  right: 40px;
}

.gallery-marquee {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
}

.gallery-marquee-inner {
  display: inline-block;
  animation: marquee 28s linear infinite;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0;
  padding: 14px 0;
  text-transform: uppercase;
}

.gallery-section {
  padding: 96px 40px 40px;
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
}

.gallery-about {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.gallery-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0;
  opacity: .5;
  margin-bottom: 20px;
}

.gallery-heading {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 48px);
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: uppercase;
}

.gallery-copy {
  font-size: clamp(13px, 1.25vw, 15px);
  line-height: 1.9;
  color: var(--soft-ink);
  max-width: 60ch;
}

.gallery-copy + .gallery-copy {
  margin-top: 18px;
}

.gallery-stats {
  display: flex;
  gap: 40px;
  margin-top: 36px;
  flex-wrap: wrap;
  font-family: 'Space Mono', monospace;
}

.gallery-stat-number {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
}

.gallery-stat-icon {
  width: clamp(34px, 4vw, 56px);
  height: clamp(34px, 4vw, 56px);
  stroke-width: 1.8;
}

.gallery-stat-label {
  font-size: 11px;
  letter-spacing: 0;
  opacity: .55;
  margin-top: 6px;
}

.gallery-index-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 16px;
}

.gallery-index-head .gallery-heading {
  font-size: clamp(28px, 4vw, 56px);
}

.gallery-index-note {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  max-width: 340px;
  text-align: right;
}

.gallery-list {
  border-top: 1px solid var(--ink);
}

.gallery-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 30px 8px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding .3s ease, background .3s ease, color .3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-row:hover {
    padding-left: 28px;
    padding-right: 28px;
    background: var(--ink);
    color: var(--paper);
  }
}

.gallery-row-no {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: .6;
}

.gallery-row-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 38px);
  letter-spacing: 0;
  line-height: 1.05;
}

.gallery-row-jp,
.gallery-row-desc {
  font-size: 13px;
  color: inherit;
  font-weight: 400;
}

.gallery-row-jp {
  opacity: .62;
  margin-top: 6px;
}

.gallery-row-desc {
  opacity: .5;
  margin-top: 4px;
}

.gallery-row-tags {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0;
  opacity: .45;
  margin-top: 10px;
}

.gallery-row-end {
  display: flex;
  align-items: center;
  gap: 24px;
}

.gallery-tech {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0;
  border: 1px solid currentColor;
  padding: 5px 9px;
  border-radius: 100px;
  opacity: .8;
}

.gallery-arrow {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gallery-arrow .amix-icon {
  width: 24px;
  height: 24px;
}

.gallery-footer {
  padding: 80px 40px 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 32px;
}

.gallery-footer-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(40px, 8vw, 120px);
  line-height: .9;
  letter-spacing: 0;
}

.gallery-footer-meta {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  text-align: right;
  line-height: 2;
}

.gallery-footer-meta a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-fade {
  position: fixed;
  inset: 0;
  z-index: 99999;
  opacity: 1;
  transition: opacity .45s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.page-fade.hide {
  opacity: 0;
}

.page-loader {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, .28);
  border-top-color: #888;
  animation: pspin .8s linear infinite;
}

.gallery-loader {
  color: var(--ink);
  animation: galleryLoaderOut .48s ease 1.05s forwards;
}

.gallery-loader.is-active {
  opacity: 1;
  visibility: visible;
  animation: none;
}

.gallery-loader-inner {
  text-align: center;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: galleryLoaderIn .46s cubic-bezier(.16, 1, .3, 1) .08s forwards;
}

.gallery-loader.is-active .gallery-loader-inner {
  opacity: 1;
  transform: translateY(0);
  animation: none;
}

.gallery-loader-brand {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 800;
  line-height: 1;
}

.gallery-loader-title {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes pspin {
  to { transform: rotate(360deg); }
}

@keyframes galleryLoaderIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes galleryLoaderOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 680px) {
  .gallery-topbar {
    padding: 18px 16px;
    gap: 10px;
  }

  .gallery-topbar-meta {
    display: none;
  }

  .gallery-hero-text {
    padding: 0 16px;
  }

  .gallery-lede {
    font-size: 13px;
    line-height: 1.7;
    margin-top: 24px;
    max-width: 31em;
  }

  .gallery-section {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 64px;
  }

  .gallery-about {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery-index-note {
    text-align: left;
  }

  .gallery-row {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 20px 4px;
  }

  .gallery-row:hover {
    padding: 20px 4px;
    background: transparent;
    color: var(--ink);
  }

  .gallery-row-end {
    display: none;
  }

  .gallery-footer {
    padding: 56px 16px 36px;
  }

  .gallery-footer-meta {
    text-align: left;
  }

  .gallery-scrollcue {
    left: 16px;
    right: auto;
    bottom: 20px;
    font-size: 10px;
  }

  .gallery-work-count {
    right: 16px;
    left: auto;
    bottom: 20px;
    font-size: 10px;
  }
}
