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

:root {
  --bg: #faf8f5;
  --bg-2: #f0ece6;
  --gold: #8a6e3a;
  --gold-light: #a8864a;
  --gold-dim: rgba(138, 110, 58, 0.55);
  --violet: rgba(160, 140, 220, 0.18);
  --text: #0a0908;
  --text-dim: rgba(10, 9, 8, 0.72);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

.splash {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(201, 169, 110, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 5%, var(--violet) 0%, transparent 60%),
    radial-gradient(ellipse 35% 25% at 5% 15%, rgba(201, 169, 110, 0.08) 0%, transparent 55%),
    var(--bg);
}

/* ── Canvas & overlays ── */
#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.12) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.4s;
  opacity: 0;
}

.cursor-glow.visible {
  opacity: 1;
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
  opacity: 0.35;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(250, 248, 245, 0.7) 100%);
}

.grain {
  position: absolute;
  inset: -50%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' 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='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.5s steps(2) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5%, -5%); }
}

/* ── Grid crosshair ── */
.grid-bg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.grid-line {
  position: absolute;
  background: rgba(168, 134, 74, 0.12);
}

.grid-line--h {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: scaleX(0);
  animation: gridExpandH 1.8s var(--ease-out) 0.4s forwards;
}

.grid-line--v {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: scaleY(0);
  animation: gridExpandV 1.8s var(--ease-out) 0.4s forwards;
}

@keyframes gridExpandH {
  to { transform: scaleX(1); }
}

@keyframes gridExpandV {
  to { transform: scaleY(1); }
}

/* ── Corner brackets ── */
.corner {
  position: absolute;
  width: 48px;
  height: 48px;
  z-index: 6;
  opacity: 0;
  animation: cornerIn 0.8s var(--ease-out) 0.6s forwards;
}

.corner span {
  position: absolute;
  background: var(--gold-dim);
}

.corner span:first-child { width: 100%; height: 1px; top: 0; left: 0; }
.corner span:last-child { width: 1px; height: 100%; top: 0; left: 0; }

.corner--tl { top: 2rem; left: 2rem; }
.corner--tr { top: 2rem; right: 2rem; transform: scaleX(-1); }
.corner--bl { bottom: 2rem; left: 2rem; transform: scaleY(-1); }
.corner--br { bottom: 2rem; right: 2rem; transform: scale(-1); }

@keyframes cornerIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; }
}

.corner--tr { animation-name: cornerInTR; }
.corner--bl { animation-name: cornerInBL; }
.corner--br { animation-name: cornerInBR; }

@keyframes cornerInTR {
  from { opacity: 0; transform: scaleX(-1) scale(0.8); }
  to { opacity: 1; transform: scaleX(-1); }
}

@keyframes cornerInBL {
  from { opacity: 0; transform: scaleY(-1) scale(0.8); }
  to { opacity: 1; transform: scaleY(-1); }
}

@keyframes cornerInBR {
  from { opacity: 0; transform: scale(-1) scale(0.8); }
  to { opacity: 1; transform: scale(-1); }
}

/* ── Side vertical text ── */
.side-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.55em;
  color: rgba(10, 9, 8, 0.58);
  writing-mode: vertical-rl;
  opacity: 0;
  animation: sideFade 1s ease 1s forwards;
}

.side-text span:nth-child(odd) {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.35em;
  color: rgba(138, 110, 58, 0.85);
}

.side-text--left { left: 1.8rem; }
.side-text--right { right: 1.8rem; }

@keyframes sideFade {
  to { opacity: 1; }
}

/* ── Top / bottom bars ── */
.top-bar,
.bottom-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: rgba(10, 9, 8, 0.6);
  opacity: 0;
  animation: barIn 0.8s ease 0.8s forwards;
}

.top-bar { top: 2.2rem; }
.bottom-bar { bottom: 2.2rem; flex-direction: column; gap: 0.4rem; }

.top-bar__label em {
  font-style: normal;
  color: #5c4818;
}

.top-bar__divider { opacity: 0.3; }

.bottom-bar__url {
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(138, 110, 58, 0.9);
}

@keyframes barIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.bottom-bar { animation-name: barInBottom; }

@keyframes barInBottom {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Stage & phases ── */
.stage {
  position: relative;
  z-index: 7;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.phase.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

/* ── Welcome block ── */
.welcome-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
}

.welcome-block.revealed {
  opacity: 1;
  pointer-events: auto;
}

.intro-line {
  width: 1px;
  height: 0;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
}

.intro-line--2 {
  width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dim), transparent);
  transform: scaleX(0);
  opacity: 0;
}

.welcome-block.revealed .intro-line--1 {
  animation: lineGrow 1s var(--ease-out) 0.1s forwards;
}

.welcome-block.revealed .intro-line--2 {
  animation: lineGrowH 1.2s var(--ease-out) 0.4s forwards;
}

@keyframes lineGrow {
  to { height: 60px; }
}

@keyframes lineGrowH {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

.intro-eyebrow {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.7em;
  color: rgba(10, 9, 8, 0.65);
  opacity: 0;
  padding-left: 0.7em;
}

.welcome-block.revealed .intro-eyebrow {
  animation: fadeUp 0.8s ease 0.7s forwards;
}

/* ── Brand phase ── */
.phase--brand {
  opacity: 0;
  transform: scale(0.92);
  gap: 1.6rem;
}

.phase--brand.active {
  opacity: 1;
  transform: scale(1);
}

.emblem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: -0.2rem;
}

.brand-title {
  position: relative;
  z-index: 2;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 500;
  font-size: 2.8rem;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  display: flex;
  gap: 0.05em;
}

.brand-title--verse {
  flex-wrap: nowrap;
  justify-content: center;
  font-size: clamp(1.05rem, 3.8vw, 1.75rem);
  letter-spacing: 0.12em;
  padding-left: 0.12em;
  white-space: nowrap;
}

.brand-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateY(90deg);
  filter: blur(8px);
  background: linear-gradient(135deg, #0a0908 10%, #3d3020 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-char.revealed {
  animation: charCinematic 1s var(--ease-out) forwards;
}

@keyframes charCinematic {
  0% { opacity: 0; transform: translateY(40px) rotateY(90deg); filter: blur(8px); }
  60% { opacity: 1; transform: translateY(-4px) rotateY(0deg); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) rotateY(0deg); filter: blur(0); }
}

.brand-shine {
  position: absolute;
  inset: 30%;
  z-index: 3;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.7) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: shine 3s ease-in-out 2.2s infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

@keyframes shine {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

.brand-en {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.85em;
  color: #6b5528;
  padding-left: 0.85em;
  margin-top: -0.6rem;
  opacity: 0;
  transform: translateY(12px);
}

.brand-en.revealed {
  animation: fadeUp 0.9s var(--ease-out) forwards;
}

.verse-block {
  text-align: center;
  overflow: hidden;
}

.verse {
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.6em;
  color: rgba(10, 9, 8, 0.78);
  padding-left: 0.6em;
  opacity: 0;
  transform: translateY(100%);
}

.verse.revealed {
  animation: verseSlide 0.9s var(--ease-out) forwards;
}

.verse--2.revealed { animation-delay: 0.15s; }

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

/* ── Loading phase ── */
.phase--loading {
  bottom: 18%;
  opacity: 0;
  transform: translateY(20px);
  gap: 0.8rem;
  width: min(340px, 80vw);
}

.phase--loading.active {
  opacity: 1;
  transform: translateY(0);
}

.loader-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.loader-index,
.loader-pct {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: #6b5528;
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
}

.loader-pct::after {
  content: '%';
  font-size: 0.55rem;
  opacity: 0.6;
}

.loader-track {
  flex: 1;
  height: 2px;
  background: rgba(28, 26, 23, 0.08);
  position: relative;
  overflow: visible;
}

.loader-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7a6235, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(168, 134, 74, 0.35);
  transition: width 0.04s linear;
}

.loader-glow {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px 3px rgba(168, 134, 74, 0.45);
  transition: left 0.04s linear;
}

.loader-status {
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.55em;
  color: rgba(10, 9, 8, 0.62);
  text-align: center;
  padding-left: 0.55em;
  min-height: 1em;
  transition: opacity 0.3s;
}

.loader-ticks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 2rem;
}

.loader-ticks span {
  width: 1px;
  height: 6px;
  background: rgba(168, 134, 74, 0.25);
  transform: scaleY(0);
  transform-origin: bottom;
  animation: tickPop 0.3s var(--ease-out) forwards;
}

.loader-ticks span:nth-child(1) { animation-delay: 1.8s; }
.loader-ticks span:nth-child(2) { animation-delay: 1.95s; }
.loader-ticks span:nth-child(3) { animation-delay: 2.1s; }
.loader-ticks span:nth-child(4) { animation-delay: 2.25s; }
.loader-ticks span:nth-child(5) { animation-delay: 2.4s; }
.loader-ticks span:nth-child(6) { animation-delay: 2.55s; }
.loader-ticks span:nth-child(7) { animation-delay: 2.7s; }
.loader-ticks span:nth-child(8) { animation-delay: 2.85s; }
.loader-ticks span:nth-child(9) { animation-delay: 3s; }
.loader-ticks span:nth-child(10) { animation-delay: 3.15s; }

@keyframes tickPop {
  to { transform: scaleY(1); }
}

/* ── Exit curtains ── */
.curtain {
  position: absolute;
  top: 0;
  width: 50.5%;
  height: 100%;
  background: var(--bg);
  z-index: 20;
  transition: transform 1s var(--ease-in-out);
}

.curtain--left {
  left: 0;
  transform: translateX(-101%);
}

.curtain--right {
  right: 0;
  transform: translateX(101%);
}

.curtain--left.close {
  transform: translateX(0);
}

.curtain--right.close {
  transform: translateX(0);
}

/* ── Shared ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .side-text { display: none; }

  .corner { width: 32px; height: 32px; }
  .corner--tl, .corner--tr { top: 1.2rem; }
  .corner--bl, .corner--br { bottom: 1.2rem; }
  .corner--tl, .corner--bl { left: 1.2rem; }
  .corner--tr, .corner--br { right: 1.2rem; }

  .brand-title { font-size: 2.1rem; }
  .brand-title--verse { font-size: clamp(0.95rem, 3.4vw, 1.35rem); letter-spacing: 0.08em; padding-left: 0.08em; }

  .top-bar, .bottom-bar { font-size: 0.55rem; }
}

@media (hover: none) {
  html, body { cursor: auto; }
  .cursor-glow { display: none; }
}
