@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=Shippori+Mincho:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@300;400;500&display=swap');

:root {
  --bg: oklch(0.14 0.02 150);
  --bg-darkest: oklch(0.1 0.025 150);
  --panel: oklch(0.18 0.02 150);
  --panel-2: oklch(0.22 0.022 150);
  --text: oklch(0.93 0.006 150);
  --text-sub: oklch(0.85 0.008 150);
  --text-muted: oklch(0.6 0.012 150);
  --text-muted-2: oklch(0.5 0.012 150);
  --hairline: oklch(0.3 0.02 150);
  --hairline-soft: oklch(0.28 0.016 150);
  --accent: oklch(0.68 0.1 150);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  overflow-x: hidden;
}

::selection { background: var(--text); color: var(--bg); }

a { color: inherit; }

.serif { font-family: 'Cormorant Garamond', serif; }
.mincho { font-family: 'Shippori Mincho', serif; }

/* ---------- Loader ---------- */
body.is-loading { overflow: hidden; }
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
  transition: opacity 0.7s var(--ease-out-expo), visibility 0.7s;
}
.loader-mark {
  font-family: 'Shippori Mincho', serif;
  font-size: 56px;
  color: var(--text);
  opacity: 0.9;
  animation: loaderPulse 1.6s ease-in-out infinite;
}
.loader-bar {
  width: 140px;
  height: 1px;
  background: var(--hairline-soft);
  overflow: hidden;
}
.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--text-sub);
  transition: width 0.3s ease-out;
}
@keyframes loaderPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .loader-mark { animation: none; }
}

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, oklch(0.5 0.02 150), var(--accent));
  z-index: 60;
  will-change: transform;
}

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 70;
  border-radius: 50%;
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--text);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid var(--text);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out-expo), height 0.25s var(--ease-out-expo), opacity 0.25s;
  opacity: 0.6;
}
.cursor-ring.is-active {
  width: 64px; height: 64px;
  opacity: 1;
  background: oklch(0.6 0.06 150 / 0.12);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.is-solid {
  background: oklch(0.14 0.02 150 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  letter-spacing: 0.12em;
  font-weight: 500;
  text-decoration: none;
}
.nav-logo span {
  font-size: 12px;
  opacity: 0.6;
  margin-left: 6px;
}
.nav-links {
  display: flex;
  gap: clamp(18px, 4vw, 40px);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 300;
  color: var(--text-sub);
}
.nav-links a { text-decoration: none; }

/* ---------- Side vertical label ---------- */
.side-label {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-muted-2);
  font-weight: 300;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.side-label::before {
  content: '';
  width: 1px;
  height: 60px;
  background: var(--hairline);
  display: inline-block;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg2 {
  position: absolute;
  inset: -10%;
  will-change: transform;
  background: repeating-linear-gradient(52deg,
    transparent 0px, transparent 60px,
    oklch(0.4 0.06 150 / 0.3) 60px, oklch(0.4 0.06 150 / 0.3) 62px);
  mix-blend-mode: overlay;
  transition: transform 0.5s ease-out;
  z-index: 1;
}

/* ---------- Hero slideshow ---------- */
.hero-slideshow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity, transform;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: grayscale(0.15) brightness(0.62) contrast(1.08) saturate(0.9);
  transform: scale(1);
}
.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    oklch(0.14 0.02 150 / 0.15) 0%,
    oklch(0.14 0.02 150 / 0.55) 65%,
    oklch(0.14 0.02 150) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  will-change: transform, opacity;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 28px;
  font-weight: 300;
  opacity: 0;
  animation: heroIn 1s ease both;
  animation-delay: 0.1s;
}
.hero-title {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(64px, 14vw, 168px);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: heroIn 1.1s ease both;
  animation-delay: 0.25s;
}
.hero-roman {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 2.2vw, 24px);
  letter-spacing: 0.35em;
  color: var(--text-sub);
  margin-top: 18px;
  text-transform: uppercase;
  opacity: 0;
  animation: heroIn 1s ease both;
  animation-delay: 0.5s;
}
.hero-line {
  width: 1px;
  height: 0;
  background: var(--hairline);
  margin: 40px auto 0;
  animation: heroLineGrow 0.9s ease both;
  animation-delay: 0.75s;
}
.hero-catch {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--text-sub);
  letter-spacing: 0.1em;
  margin-top: 16px;
  opacity: 0;
  animation: heroIn 1s ease both;
  animation-delay: 0.95s;
}
.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: scrollCue 2.2s ease-in-out infinite;
  z-index: 5;
  transition: opacity 0.2s linear;
}
.scroll-cue-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}
.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: var(--text-muted-2);
}

@keyframes scrollCue {
  0% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(10px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.7; }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroLineGrow {
  from { height: 0; }
  to { height: 56px; }
}

/* ---------- Section shared ---------- */
.section {
  padding: 0 clamp(20px, 6vw, 80px) 140px;
  position: relative;
  overflow: hidden;
}
.section-watermark {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, black 8%, black 92%, transparent 100%);
}
.section-watermark-track {
  display: flex;
  width: max-content;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(90px, 16vw, 260px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px oklch(0.26 0.02 150);
  white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.section-watermark-center .section-watermark-track {
  animation-direction: reverse;
  animation-duration: 26s;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .section-watermark-track { animation: none; }
}
.section-head, .works-grid, .about-inner, .contact-title, .contact-desc, .contact-links, .contact-footer {
  position: relative;
  z-index: 1;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 200px 0 56px;
  border-bottom: 1px solid var(--hairline-soft);
  flex-wrap: wrap;
  gap: 16px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(56px, 10vw, 132px);
  letter-spacing: -0.01em;
  font-weight: 500;
  line-height: 0.95;
}
.section-count {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  font-weight: 300;
}

/* ---------- Works grid ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: clamp(150px, 17vw, 230px);
  grid-auto-flow: dense;
  gap: clamp(10px, 1.6vw, 22px);
  margin-top: 56px;
  perspective: 1200px;
}
.work-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
  background: var(--panel);
}
.work-card.is-in {
  opacity: 1;
  transform: translateY(0);
}
.work-card-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out-expo);
  will-change: transform;
}
.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
  transform: translateZ(0);
}
.work-card:hover img {
  transform: scale(1.08) translateZ(20px);
}
.work-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, oklch(0.1 0.025 150 / 0.8) 100%);
  pointer-events: none;
}
.work-card-caption {
  position: absolute;
  left: 18px; bottom: 16px; right: 18px;
  color: oklch(0.92 0.008 150);
}
.work-card-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.work-card-meta {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 4px;
}
.work-card-index {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted-2);
  font-family: 'Cormorant Garamond', serif;
}

/* span helpers, cycled by JS */
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-1x1 { grid-column: span 1; grid-row: span 1; }
.span-1x2 { grid-column: span 1; grid-row: span 2; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }

/* ---------- Work Detail (full page) ---------- */
.work-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-darkest);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-expo);
  overflow: hidden;
}
.work-detail.is-open {
  opacity: 1;
  pointer-events: auto;
}

.wd-close {
  position: absolute;
  top: 26px; right: clamp(20px, 4vw, 48px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text-sub);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  cursor: pointer;
}
.wd-close span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  font-size: 12px;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.wd-close:hover span {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

.wd-rail {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: clamp(70px, 8vw, 108px);
  overflow-y: auto;
  padding: 90px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 4;
  scrollbar-width: none;
}
.wd-rail::-webkit-scrollbar { display: none; }
.wd-rail-item {
  width: 68%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.4;
  border: 1px solid transparent;
  transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  flex: 0 0 auto;
}
.wd-rail-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.4);
}
.wd-rail-item:hover { opacity: 0.75; }
.wd-rail-item.is-active {
  opacity: 1;
  border-color: var(--hairline);
  transform: scale(1.06);
}
.wd-rail-item.is-active img { filter: none; }

.wd-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px clamp(100px, 12vw, 160px) 120px;
}
.wd-frame {
  position: relative;
  max-width: min(78vw, 760px);
  max-height: 62vh;
  padding: 26px;
}
.wd-image {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.wd-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}
.wd-corner {
  position: absolute;
  width: 34px; height: 34px;
  pointer-events: none;
}
.wd-corner-tl {
  top: 0; left: 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.wd-corner-br {
  bottom: 0; right: 0;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}
.wd-caption {
  text-align: center;
  margin-top: 32px;
}
.wd-index {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}
.wd-title {
  font-size: clamp(20px, 2.6vw, 30px);
  margin-top: 12px;
}
.wd-meta {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 8px;
}

.wd-nav {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: 28px;
  display: flex;
  gap: 14px;
  z-index: 5;
}
.wd-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--hairline-soft);
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  color: var(--text-sub);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.wd-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.wd-nav-btn img {
  width: 32px; height: 40px;
  object-fit: cover;
  filter: grayscale(0.4);
}
.wd-nav-next { flex-direction: row-reverse; }
.wd-nav-next span { text-align: right; }

@media (max-width: 720px) {
  .wd-rail { display: none; }
  .wd-stage { padding: 90px 24px 130px; }
  .wd-nav { left: 24px; right: 24px; justify-content: space-between; }
  .wd-nav-btn img { display: none; }
}

/* ---------- About ---------- */
.about {
  padding: 0 clamp(20px, 6vw, 80px) 160px;
  border-top: 1px solid var(--hairline-soft);
  position: relative;
  overflow: hidden;
}
.about-inner {
  display: flex;
  gap: clamp(30px, 6vw, 90px);
  padding-top: 180px;
  flex-wrap: wrap;
}
.about-graphic {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.about-graphic::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, transparent 0px, transparent 38px, oklch(0.36 0.03 150) 38px, oklch(0.36 0.03 150) 39px),
    linear-gradient(160deg, oklch(0.26 0.026 150) 0%, var(--bg) 100%);
}
.about-graphic::after {
  content: '葱';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(80px, 12vw, 140px);
  color: oklch(0.42 0.045 150);
  letter-spacing: 0.1em;
}
.about-graphic .about-graphic-ring {
  position: absolute;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.35;
}
.about-text { flex: 1 1 380px; min-width: 280px; }
.about-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(40px, 6vw, 76px);
  letter-spacing: -0.01em;
  font-weight: 500;
  margin-bottom: 8px;
}
.about-subtitle {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  margin-bottom: 36px;
  text-transform: uppercase;
}
.about-body {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 2;
  color: var(--text-sub);
  max-width: 560px;
}
.about-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 44px;
  max-width: 420px;
}
.about-fact {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--hairline-soft);
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 0.05em;
}
.about-fact:last-child { border-bottom: 1px solid var(--hairline-soft); }
.about-fact-label { color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact {
  padding: 200px clamp(20px, 6vw, 80px) 90px;
  border-top: 1px solid var(--hairline-soft);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(44px, 7vw, 96px);
  letter-spacing: -0.01em;
  font-weight: 500;
}
.contact-desc {
  font-family: 'Shippori Mincho', serif;
  font-size: 15px;
  color: var(--text-muted);
  margin: 20px auto 56px;
  max-width: 420px;
  line-height: 1.9;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: clamp(30px, 6vw, 70px);
  flex-wrap: wrap;
}
.contact-link {
  color: oklch(0.9 0.008 150);
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 8px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.contact-footer {
  margin-top: 110px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted-2);
}

@media (max-width: 640px) {
  .side-label { display: none; }
}
