/*  Dimension replica — styles  */

:root {
  --bg: #0a0a0a;
  --ink: #f3f1ec;
  --ink-dim: #9a9a94;
  --ink-faint: rgba(255, 255, 255, 0.35);
  --radius: 14px;
  --font-display: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-art: "Didot", "Times New Roman", serif;
  /* 首屏大标题单独一套：以后想换标题字体，只改这一行 */
  --font-hero:  "Cormorant Garamond", "Poppins", system-ui, sans-serif;
}

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

html {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  /* reserve the scrollbar track so locking the gate causes no layout shift */
  scrollbar-gutter: stable;
}

/* pre-entry gate — locks scrolling without any JS scroll listener */
html.locked,
html.locked body {
  overflow: hidden;
}

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

.scroll-spacer {
  width: 1px;
}

/*  pinned stage  */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

/* soft center glow — tinted by the ambient module (fallback if it is absent) */
.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120vmin;
  height: 90vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side,
      rgba(var(--amb-c, 32, 32, 36), 0.42),
      rgba(var(--amb-c, 32, 32, 36), 0.16) 55%,
      transparent 75%);
  pointer-events: none;
}

/* faint elliptical orbit outline */
.orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* constant — was rewritten every frame */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/*  cards (created by JS)  */

.card {
  /* 宽高走变量：环形那份直接取短边做正方形，以后改尺寸只动这两行 */
  --card-w: 540px;
  --card-h: 300px;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  overflow: hidden;
  will-change: transform, opacity;
  box-shadow: rgba(0, 0, 0, 0.35) 0 18px 50px -20px;
  pointer-events: none;
  /* 环形 ↔ 竖排之间是长方体 ↔ 正方形，交给浏览器补间 */
  transition: width 0.55s var(--ease), height 0.55s var(--ease);
}

/* 首屏环形：正方形，边长取卡片短边（桌面 300、移动 340）。
   改的是元素本身的比例，图片仍是 object-fit: cover —— 所以是裁切，
   不会像等比拉伸那样把画面压扁。 */
.card.is-ring {
  width: min(var(--card-w), var(--card-h));
  height: min(var(--card-w), var(--card-h));
}

.card.is-active {
  pointer-events: auto;
  cursor: pointer;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* fallback tint if an image fails to load */
.card {
  background: linear-gradient(135deg, #26262a, #17171a);
}

/*  hero gate (center block)  */

.hero-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-center.gone .hero-cta {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/*  hero title — 几何无衬线，界面感  */

.hero-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: 4rem;
  color: var(--ink);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.75);
}





.hero-sub {
  margin-top: 20px;
  font-family: var(--font-hero);
  font-size: 1.2rem;
  letter-spacing: 0.09em;
  color: rgba(243, 241, 236, 0.62);
  max-width: 34em;
  line-height: 1.6;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
}

/*  hero CTA  */

.hero-cta {
  position: relative;
  display: inline-flex;
  margin-top: 38px;
}

.hero-halo {
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--amb-c, 32, 32, 36), 0.45), transparent 72%);
  filter: blur(14px);
  animation: halo-breathe 5s ease-in-out infinite;
}

/* opacity only — animating scale() on a blurred layer forces it to
   re-rasterise on every frame; opacity stays on the compositor */
@keyframes halo-breathe {

  0%,
  100% {
    opacity: 0.32;
  }

  50% {
    opacity: 0.72;
  }
}

.hero-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px -18px rgba(0, 0, 0, 0.9);
  transition:
    color 0.4s ease,
    border-color 0.4s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    letter-spacing 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.5s ease;
}

/* iris fill that grows out of the cursor */
.hero-btn::before {
  content: "";
  position: absolute;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, #fbf9f4, #dedbd4 62%, #cbc8c1);
  transform: scale(0);
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-btn-label {
  position: relative;
  white-space: nowrap;
}

.hero-arrow {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.4;
  transform: translateX(-5px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-btn:hover {
  color: #0b0b0c;
  border-color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.32em;
  transform: translateY(-2px);
  box-shadow:
    0 22px 60px -22px rgba(var(--amb-c, 32, 32, 36), 0.85),
    0 10px 30px -18px rgba(0, 0, 0, 0.9);
}

.hero-btn:hover::before {
  transform: scale(1);
}

.hero-btn:hover .hero-arrow {
  opacity: 1;
  transform: translateX(0);
}

.hero-btn:active {
  transform: translateY(0) scale(0.985);
}

.hero-btn:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

/*  access key modal  */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.modal-mask.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: min(88vw, 400px);
  padding: 34px 32px 26px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(30, 30, 32, 0.96), rgba(16, 16, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.36s cubic-bezier(0.22, 0.9, 0.28, 1);
}

.modal-mask.open .modal {
  transform: translateY(0) scale(1);
}

.modal.shake {
  animation: shake 0.42s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  20% {
    transform: translateY(0) translateX(-8px);
  }

  40% {
    transform: translateY(0) translateX(7px);
  }

  60% {
    transform: translateY(0) translateX(-5px);
  }

  80% {
    transform: translateY(0) translateX(3px);
  }
}

.modal-label {
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.modal-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.modal-input {
  margin-top: 22px;
  width: 100%;
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.14em;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.modal-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.06em;
}

.modal-input:focus {
  border-color: rgba(242, 242, 242, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

.modal-err {
  height: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: #ff7a7a;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-err.show {
  opacity: 1;
}

.modal-ok {
  margin-top: 10px;
  width: 100%;
  cursor: pointer;
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 13px 0;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: #0b0b0c;
  background: linear-gradient(180deg, #f6f4ef, #d9d6cf);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 14px 34px -18px rgba(255, 255, 255, 0.5);
}

.modal-ok:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.modal-ok:active {
  transform: translateY(0);
}

.modal-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.3);
}

/*  scroll hint  */

.scroll-hint {
  position: absolute;
  left: 48px;
  bottom: 42px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  pointer-events: none;
}

.scroll-hint span {
  font-size: 11px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.scroll-hint i {
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  position: relative;
}

.scroll-hint i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--ink);
  animation: hint-drip 1.8s ease-in-out infinite;
}

@keyframes hint-drip {
  0% {
    top: -40%;
  }

  100% {
    top: 110%;
  }
}

/*  thread connecting stacked cards  */

.thread {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.14) 22%,
      rgba(255, 255, 255, 0.14) 78%,
      transparent 100%);
  opacity: 0;
  pointer-events: none;
}

/*  travelling gradient fill 
   Two soft light bands pour down the thread on a loop, tinted by
   whatever colour the ambient module is currently sampling.       */

.thread::before,
.thread::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  height: 26%;
  border-radius: 999px;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(var(--amb-c, 32, 32, 36), 0.95) 32%,
      rgba(255, 255, 255, 0.85) 62%,
      transparent 100%);
  filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation: thread-fill 4.4s cubic-bezier(0.5, 0, 0.4, 1) infinite;
}

.thread::before {
  animation-delay: -2.2s;
}

@keyframes thread-fill {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  14% {
    opacity: 1;
  }

  86% {
    opacity: 1;
  }

  100% {
    transform: translateY(400%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .thread::before,
  .thread::after {
    animation: none;
    transform: translateY(120%);
    opacity: 0.45;
  }
}

.thread-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side,
      rgba(var(--amb-c, 32, 32, 36), 0.6),
      rgba(var(--amb-c, 32, 32, 36), 0.22) 55%,
      transparent 75%);
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
}

/*  active work info (left)  */

.work-info {
  position: absolute;
  left: clamp(24px, 5vw, 72px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 300px;
  pointer-events: none;
}

.wi-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.wi-num {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}

.wi-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 2.9vw, 44px);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.05;
}

.wi-desc {
  margin: 12px 0 0 34px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 250px;
}

/* mobile-only combined "Category · Year" line (hidden on desktop) */
.wi-meta {
  display: none;
}

/*  category (right)  */

.work-cat {
  position: absolute;
  right: 15%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: baseline;
  gap: 12px;
  pointer-events: none;
  white-space: nowrap;
}

.wc-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.3vw, 34px);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.wc-year {
  font-size: 12px;
  color: var(--ink-dim);
}

/*  work nav (right edge)  */

.work-nav {
  position: absolute;
  right: clamp(18px, 2.6vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.work-nav button {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-faint);
  transition: color 0.25s ease;
  padding: 1px 0;
}

.work-nav button:hover {
  color: rgba(255, 255, 255, 0.7);
}

.work-nav button.active {
  color: var(--ink);
  font-weight: 600;
}

/*  text crossfade on work change  */

.swap {
  animation: swap-in 0.45s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes swap-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

/*  responsive — calibrated against the original site's mobile layout  */

/* mobile: the thread becomes a gentle S-curve (desktop keeps the straight line) */
.thread-curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 860px) {

  
  .card {
    --card-w: 540px;   /* 想改回竖版就写 --card-h: 425px（= 540 / 1.27） */
  }

  /* thread: straight line → S-curve */
  .thread {
    display: none;
  }

  .thread-curve {
    display: block;
  }

  /* mobile: cards only — no number, title, category · year or description.
     The right category panel and right-edge nav are off as well. */
  .work-info,
  .work-cat,
  .work-nav {
    display: none;
  }

  .scroll-hint {
    left: 20px;
    bottom: 20px;
  }

  .hero-title {
    font-size: clamp(26px, 7.6vw, 38px);
  }

  .hero-sub {
    font-size: 12px;
  }

  .hero-btn {
    padding: 12px 16px;
    font-size: 10px;
    z-index: 999;
  }
}