:root {
  /* Typography source notes: Cormorant Garamond, Playfair Display** from Google Fonts, Noto Serif KR, IBM Plex Mono** from Google Fonts for star coordinates. */
  --abyss: #15100C;
  --brown: #2A1D16;
  --ceramic: #D8C7A3;
  --sand: #A88B67;
  --kelp: #4F5A3B;
  --rust: #9B4C32;
  --cyan: #16F6D2;
  --violet: #8C4DFF;
  --ember: #FF6A3D;
  --display: "Cormorant Garamond", Cormorant, Georgia, serif;
  --display-source-token: "Display**";
  --heading: "Playfair Display", Playfair, Georgia, serif;
  --body: "Noto Serif KR", "Noto Serif", "Apple SD Gothic Neo", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --mono-source-token: "Mono**";
}

* { box-sizing: border-box; }

html {
  background: var(--abyss);
  color: var(--ceramic);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--body);
  background:
    radial-gradient(circle at 82% 12%, rgba(140, 77, 255, .16), transparent 30rem),
    radial-gradient(circle at 18% 78%, rgba(22, 246, 210, .08), transparent 24rem),
    linear-gradient(115deg, var(--abyss), var(--brown) 54%, #100b08);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(216, 199, 163, .28) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 80% 70%, rgba(155, 76, 50, .24) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(97deg, rgba(255,255,255,.025) 0 1px, transparent 1px 7px);
}

.cursor-bloom {
  position: fixed;
  width: 23rem;
  height: 23rem;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 15;
  border-radius: 50%;
  opacity: .72;
  background:
    radial-gradient(circle, rgba(22, 246, 210, .30), rgba(140, 77, 255, .16) 28%, rgba(255, 106, 61, .06) 47%, transparent 69%);
  filter: blur(12px);
  mix-blend-mode: screen;
}

.plankton-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 14;
}

.spark {
  position: absolute;
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 1rem var(--cyan), 0 0 1.8rem var(--violet);
  animation: fadeSpark 1.1s ease-out forwards;
}

.tide-hour {
  position: relative;
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.2rem, 5vw, 6rem) clamp(3rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 7rem);
  overflow: hidden;
  isolation: isolate;
}

.tide-hour::before {
  content: attr(data-hour);
  position: absolute;
  right: 4vw;
  top: 5vh;
  font-family: var(--mono);
  color: rgba(216, 199, 163, .12);
  font-size: clamp(3rem, 12vw, 12rem);
  letter-spacing: -.07em;
  z-index: -1;
}

.hero-hour {
  background:
    radial-gradient(ellipse at 38% 68%, rgba(216, 199, 163, .14), transparent 32rem),
    radial-gradient(circle at 74% 48%, rgba(22, 246, 210, .07), transparent 23rem);
}

.dawn-hour {
  background:
    radial-gradient(circle at 61% 42%, rgba(168, 139, 103, .24), transparent 26rem),
    linear-gradient(160deg, rgba(79,90,59,.36), rgba(42,29,22,.86) 50%, var(--abyss));
}

.dusk-hour {
  background:
    radial-gradient(circle at 66% 32%, rgba(140,77,255,.22), transparent 25rem),
    radial-gradient(circle at 50% 72%, rgba(155,76,50,.14), transparent 34rem),
    var(--brown);
}

.midnight-hour {
  background:
    radial-gradient(circle at var(--mx, 70%) var(--my, 45%), rgba(22,246,210,.16), transparent 14rem),
    radial-gradient(circle at 78% 68%, rgba(140,77,255,.15), transparent 18rem),
    linear-gradient(180deg, #0f0b09, var(--abyss));
}

.left-ledger {
  grid-column: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: .3rem;
  color: var(--sand);
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.tall-ledger { min-height: 58vh; justify-content: space-between; }

.ledger-mark,
.coordinate,
.scratch {
  max-width: 14rem;
  border-left: 1px solid rgba(216, 199, 163, .24);
  padding-left: .75rem;
}

.moon-chip {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  color: var(--ceramic);
  border: 1px solid rgba(216, 199, 163, .28);
  border-radius: 46% 54% 42% 58%;
  background: rgba(42,29,22,.62);
  box-shadow: inset 0 0 1.4rem rgba(168,139,103,.18), 0 0 1rem rgba(22,246,210,.05);
}

.kword {
  font-family: var(--body);
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  color: rgba(216, 199, 163, .18);
  text-transform: none;
  letter-spacing: -.06em;
  transition: color .35s ease, text-shadow .35s ease, transform .35s ease;
}

.kword.lit,
.hidden-inscription.lit {
  color: var(--cyan);
  text-shadow: 0 0 .8rem var(--cyan), 0 0 2rem var(--violet);
  transform: translateX(.35rem) skewX(-4deg);
}

.site-title-block {
  grid-column: 2;
  align-self: start;
  max-width: 66rem;
  padding-top: clamp(.2rem, 2vw, 1rem);
}

.micro-stamp {
  margin: 0 0 .8rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ember);
}

.micro-stamp.violet { color: var(--violet); }
.micro-stamp.cyan { color: var(--cyan); }

.site-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(5.8rem, 18vw, 18rem);
  line-height: .72;
  letter-spacing: -.085em;
  color: var(--ceramic);
  text-shadow: .05em .03em 0 rgba(155,76,50,.62), 0 0 2.4rem rgba(22,246,210,.14);
}

.site-title em {
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1px var(--sand);
  text-shadow: 0 0 1.1rem rgba(140,77,255,.35);
}

.title-note {
  max-width: 43rem;
  margin: 2rem 0 0;
  font-size: clamp(1rem, 2vw, 1.45rem);
  line-height: 1.55;
  color: rgba(216,199,163,.76);
}

.tide-bowl {
  grid-column: 2;
  width: min(62vw, 48rem);
  aspect-ratio: 1.62;
  align-self: end;
  justify-self: start;
  margin-top: clamp(2rem, 5vh, 5rem);
  position: relative;
  border-radius: 48% 52% 50% 45%;
  background:
    radial-gradient(ellipse at 45% 44%, rgba(22,246,210,.19), transparent 26%),
    radial-gradient(ellipse at 52% 52%, rgba(216,199,163,.22), rgba(42,29,22,.72) 53%, rgba(21,16,12,.96) 72%);
  border: 1px solid rgba(216,199,163,.23);
  box-shadow: inset 0 0 3rem rgba(168,139,103,.21), inset 0 -1rem 2rem rgba(0,0,0,.45), 0 1rem 4rem rgba(0,0,0,.34);
}

.crack-map { position: absolute; inset: 8%; width: 84%; height: 84%; }
.crack, .star-thread {
  fill: none;
  stroke: rgba(216,199,163,.4);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: drawCrack 2.4s ease forwards .3s;
}
.crack.main { stroke: var(--cyan); filter: drop-shadow(0 0 .55rem var(--cyan)); opacity: .78; }
.star-thread { stroke: var(--violet); stroke-width: 1; animation-delay: 1.2s; filter: drop-shadow(0 0 .4rem var(--violet)); }
.wake-stars circle, .chart-stars circle {
  fill: var(--cyan);
  filter: drop-shadow(0 0 .55rem var(--cyan));
  opacity: 0;
  animation: wakeStar 1.6s ease forwards;
}
.wake-stars circle:nth-child(2n), .chart-stars circle:nth-child(2n) { fill: var(--violet); filter: drop-shadow(0 0 .65rem var(--violet)); animation-delay: .55s; }

.bowl-reflection {
  position: absolute;
  left: 12%;
  bottom: 15%;
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 7rem);
  color: rgba(22,246,210,.18);
  transform: scaleY(-1) rotate(-3deg);
  filter: blur(.7px);
  letter-spacing: -.08em;
}

.shoal-copy {
  grid-column: 2;
  align-self: center;
  max-width: 47rem;
  transform: translateY(2rem);
  opacity: .2;
  transition: transform .9s ease, opacity .9s ease;
}

.tide-hour.in-view .shoal-copy { transform: translateY(0); opacity: 1; }
.wide-shoal { max-width: 56rem; margin-top: 8vh; }
.star-copy { margin-top: 16vh; }
.low-tide-copy { align-self: start; margin-top: 12vh; }

.shoal-copy h2 {
  margin: 0 0 1rem;
  font-family: var(--heading);
  font-size: clamp(2.5rem, 7vw, 7rem);
  line-height: .93;
  letter-spacing: -.055em;
  color: var(--ceramic);
}

.shoal-copy h2 em { color: var(--sand); text-shadow: 0 0 1.4rem rgba(140,77,255,.5); }
.shoal-copy p:not(.micro-stamp) { max-width: 35rem; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.7; color: rgba(216,199,163,.74); }

.shard-field { position: absolute; inset: 0; pointer-events: none; }
.shard {
  position: absolute;
  width: clamp(6rem, 13vw, 15rem);
  height: clamp(5rem, 10vw, 11rem);
  background: linear-gradient(135deg, rgba(216,199,163,.76), rgba(168,139,103,.34) 55%, rgba(42,29,22,.9));
  border: 1px solid rgba(216,199,163,.25);
  box-shadow: inset 0 0 1.6rem rgba(21,16,12,.42), 0 0 1.2rem rgba(22,246,210,.12);
  animation: driftShard 8s ease-in-out infinite alternate;
}
.shard i { position: absolute; inset: 22%; border-top: 1px solid var(--cyan); border-left: 1px solid rgba(140,77,255,.7); filter: drop-shadow(0 0 .35rem var(--cyan)); }
.shard-a { right: 18%; top: 20%; clip-path: polygon(12% 8%, 88% 18%, 72% 89%, 24% 73%); }
.shard-b { right: 7%; top: 52%; clip-path: polygon(26% 0, 100% 38%, 64% 100%, 0 70%); animation-delay: -2s; }
.shard-c { left: 43%; bottom: 10%; clip-path: polygon(0 18%, 72% 0, 100% 58%, 36% 100%); animation-delay: -4s; }
.shard-d { right: 36%; top: 66%; clip-path: polygon(22% 2%, 92% 33%, 80% 82%, 9% 100%, 0 26%); animation-delay: -1s; }

.constellation {
  position: absolute;
  right: 3vw;
  bottom: 6vh;
  width: min(72vw, 60rem);
  height: auto;
  opacity: .9;
}
.wave-line, .thread {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wave-line { stroke: rgba(168,139,103,.45); stroke-width: 2; stroke-dasharray: 8 14; }
.thread { stroke: var(--violet); stroke-width: 2; filter: drop-shadow(0 0 .55rem var(--violet)); transition: transform .25s ease; }
.thread-one.bent { transform: translate(var(--bend-x, 0), var(--bend-y, 0)); }
.thread-two.bent { transform: translate(calc(var(--bend-x, 0) * -1), calc(var(--bend-y, 0) * .7)); }

.inscription-field { position: absolute; inset: 0; pointer-events: none; }
.hidden-inscription {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--body);
  font-size: clamp(1.1rem, 2vw, 2.4rem);
  color: rgba(216,199,163,.08);
  transition: color .4s ease, text-shadow .4s ease, transform .4s ease;
}

.closing-seal {
  grid-column: 2;
  align-self: end;
  width: fit-content;
  padding: 1rem 1.3rem;
  border: 1px solid rgba(255,106,61,.42);
  color: var(--sand);
  background: rgba(42,29,22,.62);
  clip-path: polygon(4% 0, 100% 8%, 96% 100%, 0 91%);
}
.closing-seal span { display: block; font-family: var(--heading); font-style: italic; font-size: 2rem; color: var(--ceramic); }
.closing-seal small { font-family: var(--mono); color: var(--ember); letter-spacing: .08em; }

@keyframes drawCrack { to { stroke-dashoffset: 0; } }
@keyframes wakeStar { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; transform: scale(1.45); } 100% { opacity: .88; transform: scale(1); } }
@keyframes fadeSpark { to { opacity: 0; transform: translateY(-1rem) scale(.2); } }
@keyframes driftShard { to { transform: translate3d(-2rem, 1.5rem, 0) rotate(7deg); } }

@media (max-width: 760px) {
  .tide-hour { grid-template-columns: 1fr; gap: 1.3rem; }
  .left-ledger, .site-title-block, .tide-bowl, .shoal-copy, .closing-seal { grid-column: 1; }
  .left-ledger { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tall-ledger { min-height: auto; }
  .tide-bowl { width: 92vw; }
  .constellation { width: 100vw; right: -18vw; opacity: .5; }
}
