/* hibiki.day — cobalt-twilight Memphis listening parlor */

:root {
  --velvet-cobalt: #0b1428;
  --room-indigo: #152844;
  --echo-cobalt: #2a4a78;
  --aquarium-blue: #6f95c8;
  --resonant-mist: #b9d4f0;
  --saddle-leather: #3a2a1e;
  --tarnished-brass: #c2a473;
  --particle-spark: #d8e6f5;
  --leather-dark: #2a1c12;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--velvet-cobalt);
  color: var(--aquarium-blue);
  overflow-x: hidden;
  font-family: "Newsreader", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

/* fixed leather-grain noise overlay */
.leather-noise {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(95deg, transparent 0 2px, rgba(0,0,0,0.5) 2px 3px),
    repeating-linear-gradient(7deg, transparent 0 3px, rgba(0,0,0,0.35) 3px 4px),
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 45% 85%, rgba(0,0,0,0.4) 0 1px, transparent 2px);
  background-size: 6px 6px, 7px 7px, 90px 90px, 110px 110px, 130px 130px;
}

canvas#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

main {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
}

/* ---------- CHAMBERS ---------- */
.chamber {
  position: relative;
  height: 100vh;
  min-height: 560px;
  padding: 0 8vw 0 calc(8vw + 24px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

#ch-1 { background: radial-gradient(ellipse at 70% 20%, #11203c 0%, var(--velvet-cobalt) 60%); }
#ch-2 { background: radial-gradient(ellipse at 10% 30%, #102038 0%, var(--velvet-cobalt) 65%); }
#ch-3 { background: radial-gradient(ellipse at 85% 80%, #0f1d34 0%, var(--velvet-cobalt) 60%); }
#ch-4 { background: radial-gradient(ellipse at 50% 50%, #101e36 0%, var(--velvet-cobalt) 70%); }
#ch-5 { background: var(--velvet-cobalt); }

/* ---------- LEATHER STRAP ---------- */
.leather-strap {
  position: absolute;
  left: 6vw;
  top: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(180deg, var(--saddle-leather) 0%, var(--leather-dark) 100%);
  box-shadow:
    inset 0 0 18px rgba(0,0,0,0.6),
    inset 1px 0 0 rgba(194,164,115,0.18);
  z-index: 4;
}
.leather-strap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(95deg, transparent 0 2px, rgba(0,0,0,0.18) 2px 3px);
}
.leather-strap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 10%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px),
    radial-gradient(circle at 70% 24%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px),
    radial-gradient(circle at 40% 42%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px),
    radial-gradient(circle at 65% 60%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px),
    radial-gradient(circle at 35% 78%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px),
    radial-gradient(circle at 60% 92%, rgba(0,0,0,0.3) 0 1.5px, transparent 2px);
  background-size: 24px 120px;
}

/* brass rivets every 180px via repeating background on a stretched pseudo */
.leather-strap {
  background-image:
    radial-gradient(circle at 50% 90px, var(--tarnished-brass) 0 6px, #7a5f33 6px 7px, transparent 7.5px),
    linear-gradient(180deg, var(--saddle-leather) 0%, var(--leather-dark) 100%);
  background-size: 24px 180px, 100% 100%;
  background-repeat: repeat-y, no-repeat;
}

/* ---------- MEMPHIS SHAPES ---------- */
.memphis-shape {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  will-change: transform;
}

.confetti-cluster {
  top: 6%;
  right: 6vw;
  width: 480px;
  max-width: 60vw;
  opacity: 0.85;
}
.confetti-cluster svg { width: 100%; height: auto; }
.conf { transform-box: fill-box; transform-origin: center; }
.conf.c0 { fill: var(--echo-cobalt); }
.conf.c1 { fill: var(--aquarium-blue); }
.conf.c2 { fill: var(--tarnished-brass); }
.conf.c3 { fill: var(--saddle-leather); }
.confetti-cluster .conf { animation: wobble 6s ease-in-out infinite; }
.confetti-cluster .conf:nth-child(2n) { animation-duration: 7.4s; animation-delay: -1.2s; }
.confetti-cluster .conf:nth-child(3n) { animation-duration: 8.6s; animation-delay: -2.6s; }
.confetti-cluster .conf:nth-child(4n) { animation-duration: 5.6s; animation-delay: -3.8s; }
@keyframes wobble {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(5deg) translateY(-6px); }
}

.half-disc {
  top: 17%;
  left: -160px;
  width: 420px;
  opacity: 0.9;
}
.half-disc svg { width: 100%; height: auto; }

.ziggurat {
  bottom: 0;
  right: 6vw;
  width: 280px;
  max-width: 40vw;
}
.ziggurat svg { width: 100%; height: auto; display: block; }

.squiggle {
  top: 50%;
  left: 10vw;
  width: 600px;
  max-width: 70vw;
  transform: translateY(-50%) rotate(-12deg);
}
.squiggle svg { width: 100%; height: auto; }
#squiggle-path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 2.4s ease-out;
}
#ch-4.entered #squiggle-path { stroke-dashoffset: 0; }

.dot-field {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--echo-cobalt) 1.5px, transparent 1.6px);
  background-size: 48px 48px;
  opacity: 0.5;
}

/* ---------- DRAPE CURTAINS ---------- */
.drape {
  position: absolute;
  left: 0;
  width: 100vw;
  height: 30vh;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(96deg, transparent 0 3px, rgba(0,0,0,0.16) 3px 4px),
    linear-gradient(180deg, var(--saddle-leather) 0%, var(--leather-dark) 100%);
  box-shadow: 0 0 60px rgba(111,149,200,0.18);
  opacity: 0.92;
}
.drape-left  { top: 0;    transform: translateX(-110vw); }
.drape-right { bottom: 0; transform: translateX(110vw); }
.entered .drape-left  { animation: sweep-from-left  1.1s cubic-bezier(.22,.61,.36,1) forwards; }
.entered .drape-right { animation: sweep-from-right 1.1s cubic-bezier(.22,.61,.36,1) forwards; }
@keyframes sweep-from-left {
  0%   { transform: translateX(-110vw); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(110vw); }
}
@keyframes sweep-from-right {
  0%   { transform: translateX(110vw); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(-110vw); }
}

/* ---------- CONTENT BLOCK + BORDER FRAME ---------- */
.content-block {
  position: relative;
  z-index: 6;
  max-width: 52ch;
  padding: 2.6rem 2.4rem 2.8rem;
}
.decay-60 { margin-top: 12vh; }
.decay-36 { margin-top: 26vh; }
.decay-22 { margin-top: 36vh; }
.decay-13 { margin-top: 44vh; align-self: flex-start; }

.border-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: visible;
}
.border-frame rect {
  width: calc(100% - 3px);
  height: calc(100% - 3px);
  fill: none;
  stroke: var(--aquarium-blue);
  stroke-width: 1.5px;
  stroke-dasharray: 12 8;
  animation: dash-march 9s linear infinite;
}
@keyframes dash-march {
  to { stroke-dashoffset: -200; }
}
.entered .border-frame rect {
  animation: dash-march 9s linear infinite, freq-lock 1.2s ease-out;
}
@keyframes freq-lock {
  0%   { stroke-width: 2.5px; stroke-dasharray: 4 4; }
  100% { stroke-width: 1.5px; stroke-dasharray: 12 8; }
}

/* ---------- NUMERALS ---------- */
.numeral {
  position: absolute;
  top: -0.72em;
  left: 1.6rem;
  padding: 0 0.4rem;
  background: var(--velvet-cobalt);
  font-family: "Zilla Slab Highlight", "Zilla Slab", serif;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  color: var(--tarnished-brass);
  z-index: 7;
}

/* ---------- TYPOGRAPHY ---------- */
.domain-mark {
  font-family: "Zilla Slab", serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  letter-spacing: -0.015em;
  line-height: 0.96;
  color: var(--resonant-mist);
}
.domain-mark .dot { color: var(--tarnished-brass); }

.ringing-line {
  font-family: "Zilla Slab", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  color: var(--aquarium-blue);
  margin-top: 1.4rem;
}

.fragment {
  font-family: "Zilla Slab", serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  letter-spacing: -0.015em;
  line-height: 1.02;
  color: var(--resonant-mist);
}
.fragment-line {
  font-family: "Zilla Slab", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--aquarium-blue);
  margin-top: 1rem;
}

.meditation {
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--aquarium-blue);
}
.meditation .resonate {
  transition: color 0.7s ease, text-shadow 0.7s ease;
}
.meditation .resonate.pulsing {
  color: var(--resonant-mist);
  text-shadow: 0 0 12px rgba(185,212,240,0.5);
}

.receding-list {
  list-style: none;
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  color: var(--aquarium-blue);
}
.receding-list .r { line-height: 1.7; margin-bottom: 0.35rem; opacity: 0.95; }
.r0 { font-size: 1.1rem; }
.r1 { font-size: 0.98rem; }
.r2 { font-size: 0.88rem; color: #6388bb; }
.r3 { font-size: 0.8rem;  color: #587cae; }
.r4 { font-size: 0.73rem; color: #4f72a2; }
.r5 { font-size: 0.67rem; color: #466794; }
.r6 { font-size: 0.62rem; color: #3e5d86; }

.colophon {
  font-family: "Zilla Slab", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #2f4d75;
  max-width: 40ch;
}

/* fade-in for content on chamber enter */
.content-block { opacity: 0.18; transform: translateY(14px); transition: opacity 1.2s ease, transform 1.2s ease; }
.entered .content-block { opacity: 1; transform: translateY(0); }
#ch-1 .content-block { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .chamber { padding: 0 6vw 0 calc(6vw + 24px); }
  .leather-strap { left: 3vw; }
  .confetti-cluster { right: 2vw; }
  .ziggurat { right: 2vw; }
  .content-block { padding: 2rem 1.5rem 2.2rem; }
}
