:root {
  --ink: #f0ece3;
  --muted: #9aa7b4;
  --dim: #657383;
  --gold: #d6b36d;
  --cyan: #8cc8d9;
  --night: #07101a;
  --deep-night: #02060a;
  --rail-left: clamp(1.25rem, 5vw, 5.5rem);
  --rail-width: min(35rem, calc(100vw - 2.5rem));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--deep-night);
  font-family: "Cormorant Garamond", PingFang SC, "Hiragino Sans GB",
    "Microsoft YaHei", Georgia, serif;
  overflow-x: hidden;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  content: "";
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
}

.site-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  padding: clamp(1.4rem, 4vw, 4.5rem) var(--rail-left);
  overflow: hidden;
}

.site-bg,
.site-bg::before,
.site-bg::after {
  position: absolute;
  inset: 0;
  z-index: -3;
  content: "";
}

.site-bg {
  background-color: var(--deep-night);
  background-image: url("assets/zcdunn-gate.jpg");
  background-repeat: no-repeat;
  background-position: 52% 50%;
  background-size: min(92vw, 1540px) auto;
  transform: scale(1.035);
  filter: saturate(0.94) contrast(1.02) brightness(0.95);
  animation: scene-arrive 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.site-bg::before {
  z-index: -2;
  background:
    radial-gradient(
      circle at 53% 46%,
      rgba(214, 179, 109, 0.2),
      rgba(214, 179, 109, 0.05) 16%,
      rgba(7, 16, 26, 0) 32%
    ),
    linear-gradient(
      90deg,
      rgba(2, 6, 10, 0.88) 0%,
      rgba(3, 8, 14, 0.72) 23%,
      rgba(7, 16, 26, 0.18) 45%,
      rgba(7, 16, 26, 0.02) 68%,
      rgba(2, 6, 10, 0.58) 100%
    );
}

.site-bg::after {
  z-index: -1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.02) 27%,
      rgba(0, 0, 0, 0.05) 63%,
      rgba(0, 0, 0, 0.8) 100%
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.76) 0%,
      rgba(0, 0, 0, 0.02) 18%,
      rgba(0, 0, 0, 0.02) 82%,
      rgba(0, 0, 0, 0.78) 100%
    ),
    radial-gradient(
      ellipse at 13% 50%,
      rgba(9, 21, 34, 0.5),
      rgba(9, 21, 34, 0) 46%
    );
}

.particle-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle-field span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  opacity: 0;
  background: rgba(238, 225, 190, 0.92);
  box-shadow:
    0 0 calc(var(--s) * 5) rgba(214, 179, 109, 0.5),
    0 0 calc(var(--s) * 11) rgba(140, 200, 217, 0.24);
  animation:
    particle-rise var(--d) linear infinite,
    particle-pulse calc(var(--d) * 0.58) ease-in-out infinite;
  animation-delay: var(--delay);
}

.particle-field span:nth-child(1) { --x: 49%; --y: 72%; --s: 3px; --d: 14s; --delay: -1s; }
.particle-field span:nth-child(2) { --x: 56%; --y: 64%; --s: 2px; --d: 16s; --delay: -8s; }
.particle-field span:nth-child(3) { --x: 62%; --y: 43%; --s: 2px; --d: 18s; --delay: -3s; }
.particle-field span:nth-child(4) { --x: 72%; --y: 34%; --s: 2px; --d: 19s; --delay: -11s; }
.particle-field span:nth-child(5) { --x: 38%; --y: 35%; --s: 2px; --d: 17s; --delay: -6s; }
.particle-field span:nth-child(6) { --x: 82%; --y: 55%; --s: 3px; --d: 22s; --delay: -15s; }
.particle-field span:nth-child(7) { --x: 31%; --y: 68%; --s: 2px; --d: 20s; --delay: -12s; }
.particle-field span:nth-child(8) { --x: 67%; --y: 77%; --s: 2px; --d: 15s; --delay: -5s; }
.particle-field span:nth-child(9) { --x: 53%; --y: 49%; --s: 3px; --d: 21s; --delay: -16s; }
.particle-field span:nth-child(10) { --x: 88%; --y: 28%; --s: 2px; --d: 18s; --delay: -9s; }
.particle-field span:nth-child(11) { --x: 44%; --y: 82%; --s: 2px; --d: 16s; --delay: -14s; }
.particle-field span:nth-child(12) { --x: 59%; --y: 23%; --s: 2px; --d: 23s; --delay: -7s; }
.particle-field span:nth-child(13) { --x: 75%; --y: 70%; --s: 2px; --d: 20s; --delay: -2s; }
.particle-field span:nth-child(14) { --x: 24%; --y: 50%; --s: 2px; --d: 17s; --delay: -10s; }
.particle-field span:nth-child(15) { --x: 50%; --y: 57%; --s: 2px; --d: 13s; --delay: -4s; }
.particle-field span:nth-child(16) { --x: 64%; --y: 84%; --s: 3px; --d: 24s; --delay: -18s; }
.particle-field span:nth-child(17) { --x: 79%; --y: 45%; --s: 2px; --d: 15s; --delay: -13s; }
.particle-field span:nth-child(18) { --x: 35%; --y: 18%; --s: 2px; --d: 19s; --delay: -6s; }

.archive-rail {
  position: relative;
  align-self: center;
  width: var(--rail-width);
  max-width: 100%;
  padding-block: clamp(1rem, 2.8vw, 2.4rem);
}

.archive-rail::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1.05rem;
  width: 1px;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(140, 200, 217, 0),
    rgba(140, 200, 217, 0.4),
    rgba(214, 179, 109, 0.38),
    rgba(214, 179, 109, 0)
  );
}

.kicker,
.roles,
.status,
.project-link,
.doorline {
  letter-spacing: 0.04em;
}

.kicker {
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 1.1rem;
  color: var(--cyan);
  font-size: clamp(0.82rem, 1.18vw, 1rem);
  font-weight: 600;
  text-shadow: 0 0 22px rgba(140, 200, 217, 0.25);
}

.name {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4.9rem, 10vw, 9.7rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0;
  text-shadow:
    0 0 36px rgba(214, 179, 109, 0.24),
    0 12px 60px rgba(0, 0, 0, 0.42);
  transition:
    letter-spacing 500ms ease,
    color 500ms ease;
}

.name:hover {
  color: #fff7e4;
  letter-spacing: 0.025em;
}

.roles {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.46rem;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  margin: 1.45rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.24vw, 1.24rem);
  font-weight: 500;
  line-height: 1.3;
}

.roles span {
  transition:
    color 220ms ease,
    transform 220ms ease,
    text-shadow 220ms ease;
}

.roles span:hover {
  color: var(--ink);
  transform: translateY(-2px);
  text-shadow: 0 0 18px rgba(140, 200, 217, 0.24);
}

.rule {
  width: min(23rem, 76vw);
  height: 1px;
  margin: clamp(1.35rem, 3.1vw, 2.5rem) 0;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(214, 179, 109, 0.72),
    rgba(140, 200, 217, 0.38),
    rgba(140, 200, 217, 0)
  );
}

.rule::after {
  display: block;
  width: 28%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-120%);
  animation: line-shimmer 5.8s 2s ease-in-out infinite;
}

.statement {
  max-width: 31rem;
}

.statement p {
  margin: 0;
  font-size: clamp(1.32rem, 2.6vw, 2.35rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0;
  text-shadow: 0 8px 36px rgba(0, 0, 0, 0.48);
}

.statement p + p {
  max-width: 25rem;
  margin-top: 0.85rem;
  color: rgba(232, 230, 225, 0.72);
  font-size: clamp(0.93rem, 1.55vw, 1.08rem);
  line-height: 1.8;
}

.status {
  margin-top: clamp(1.35rem, 3vw, 2.2rem);
  color: var(--muted);
  font-size: clamp(0.9rem, 1.06vw, 1.05rem);
  font-weight: 500;
  line-height: 1.75;
}

.status p {
  margin: 0;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  margin-top: clamp(1.6rem, 3.4vw, 2.55rem);
  color: var(--ink);
  font-size: clamp(0.94rem, 1.08vw, 1.08rem);
  font-weight: 600;
  text-decoration: none;
  transition:
    color 240ms ease,
    filter 240ms ease,
    transform 240ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  color: #ffe2a1;
  filter: drop-shadow(0 0 12px rgba(214, 179, 109, 0.35));
  transform: translateY(-2px);
  outline: none;
}

.project-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.42rem;
}

.project-mark {
  position: relative;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(214, 179, 109, 0.54);
  border-radius: 50%;
  box-shadow:
    inset 0 0 12px rgba(214, 179, 109, 0.12),
    0 0 18px rgba(140, 200, 217, 0.15);
}

.project-mark::before,
.project-mark::after {
  position: absolute;
  inset: 50% auto auto 50%;
  content: "";
  background: currentColor;
  transform: translate(-50%, -50%);
}

.project-mark::before {
  width: 0.52rem;
  height: 1px;
}

.project-mark::after {
  width: 1px;
  height: 0.52rem;
}

.doorline {
  max-width: 28rem;
  margin: clamp(2rem, 4.4vw, 3.6rem) 0 0;
  color: var(--dim);
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 500;
  line-height: 1.85;
  white-space: nowrap;
  transition:
    color 300ms ease,
    text-shadow 300ms ease;
}

.doorline:hover {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(214, 179, 109, 0.24);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 780ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal-1 {
  animation-delay: 240ms;
}

.reveal-2 {
  animation-delay: 380ms;
}

.reveal-3 {
  animation-delay: 520ms;
}

.reveal-4 {
  animation-delay: 660ms;
}

.reveal-5 {
  animation-delay: 800ms;
}

.reveal-6 {
  animation-delay: 940ms;
}

.reveal-7 {
  animation-delay: 1080ms;
}

.reveal-8 {
  animation-delay: 1220ms;
}

@keyframes scene-arrive {
  0% {
    opacity: 0;
    transform: scale(1.055);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes line-shimmer {
  0%,
  58% {
    transform: translateX(-120%);
  }

  74%,
  100% {
    transform: translateX(420%);
  }
}

@keyframes particle-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.78);
  }

  15%,
  78% {
    opacity: 0.78;
  }

  100% {
    opacity: 0;
    transform: translate3d(18px, -72px, 0) scale(1.12);
  }
}

@keyframes particle-pulse {
  0%,
  100% {
    filter: brightness(0.82);
  }

  50% {
    filter: brightness(1.45);
  }
}

@media (max-width: 760px) {
  :root {
    --rail-left: clamp(1rem, 5vw, 1.6rem);
    --rail-width: calc(100vw - 2rem);
  }

  .site-shell {
    align-items: start;
    min-height: 100svh;
    padding-block: clamp(1.15rem, 6vh, 3.5rem);
  }

  .site-bg {
    background-position: 50% 54%;
    background-size: auto min(88svh, 780px);
    filter: saturate(0.9) contrast(1.04) brightness(0.9);
  }

  .site-bg::before {
    background:
      radial-gradient(
        circle at 52% 47%,
        rgba(214, 179, 109, 0.18),
        rgba(214, 179, 109, 0.04) 18%,
        rgba(7, 16, 26, 0) 36%
      ),
      linear-gradient(
        180deg,
        rgba(3, 8, 14, 0.88) 0%,
        rgba(5, 12, 20, 0.66) 42%,
        rgba(7, 16, 26, 0.16) 70%,
        rgba(3, 8, 14, 0.68) 100%
      );
  }

  .archive-rail {
    align-self: start;
    padding-top: clamp(0.5rem, 4vh, 2rem);
  }

  .name {
    font-size: clamp(4.35rem, 17vw, 6.2rem);
  }

  .roles {
    gap: 0.28rem;
    font-size: clamp(0.72rem, 3.05vw, 0.9rem);
    letter-spacing: 0.02em;
  }

  .rule {
    margin-block: 1.2rem;
  }

  .statement {
    max-width: 22rem;
  }

  .statement p {
    font-size: clamp(1.18rem, 6.2vw, 1.62rem);
  }

  .statement p + p {
    max-width: 19rem;
    font-size: 0.88rem;
  }

  .status {
    max-width: 19rem;
  }

  .doorline {
    max-width: none;
    font-size: clamp(0.55rem, 2.3vw, 0.68rem);
    letter-spacing: 0.02em;
  }

  .particle-field span {
    --s: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
