/* ===================================================================
   kaguya.bar — grainy-textured · asymmetric · tech-mono · ocean-deep
   Palette:
     #03161f Trench Black   · base bg
     #0a2a3e Harbor Indigo  · ledger rails / footer
     #0d3b66 Princess Navy   · blob fill / dividers
     #1c5d7a Submerged Teal  · hairlines / icon strokes
     #3fb6c4 Bioluminescent Cyan · accent (sparingly)
     #7fb8a4 Tide Foam       · skyline wash / diacritic
     #e8e1cf Lantern Cream   · body type
     #a39880 Driftwood       · tertiary type
   =================================================================== */

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

:root {
  --trench:    #03161f;
  --harbor:    #0a2a3e;
  --navy:      #0d3b66;
  --teal:      #1c5d7a;
  --cyan:      #3fb6c4;
  --foam:      #7fb8a4;
  --cream:     #e8e1cf;
  --driftwood: #a39880;
  --gap: clamp(8px, 1.5vw, 24px);
}

html { scroll-behavior: smooth; }

body {
  background: var(--trench);
  color: var(--cream);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* ---------- persistent film-grain layer ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* localized per-section grain */
.hero::after, .ribbon::after, .ledger::after, .closing::after, .footer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- 12-column asymmetric grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gap);
}
.col-2-10  { grid-column: 2 / 11; }
.col-7-11  { grid-column: 7 / 12; }
.col-3-6   { grid-column: 3 / 7;  }

main { position: relative; z-index: 2; }

/* ===================================================================
   HERO
   =================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: clamp(2rem, 6vh, 5rem) 0 clamp(2rem, 6vh, 5rem);
  align-content: start;
  overflow: hidden;
}

.hero-blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.blob { position: absolute; will-change: transform; }
.blob path { stroke: none; }

.blob-navy {
  width: 70vw; height: 70vw;
  right: -22vw; bottom: -26vw;
  mix-blend-mode: screen;
}
.blob-navy path { fill: var(--navy); opacity: 0.6; }

.blob-cyan {
  width: 52vw; height: 52vw;
  right: -8vw; bottom: 6vh;
  mix-blend-mode: screen;
  animation-delay: -2.4s !important;
}
.blob-cyan path { fill: var(--cyan); opacity: 0.35; }

.blob-navy { animation: drift-a 9s ease-in-out infinite alternate; }
.blob-cyan { animation: drift-b 7s ease-in-out infinite alternate; }

.hero > * { position: relative; z-index: 2; }

.hero-caption {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--driftwood);
  margin-bottom: clamp(2rem, 10vh, 6rem);
}

.wordmark {
  font-family: "Major Mono Display", "JetBrains Mono", monospace;
  font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  margin-bottom: clamp(1.5rem, 4vh, 3rem);
}
.wordmark-l1 { display: block; color: var(--cream); }
.wordmark-l2 {
  display: block;
  margin-left: 22%;
  color: transparent;
  -webkit-text-stroke: 1px var(--cyan);
  text-stroke: 1px var(--cyan);
}

.hero-subhead {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  color: var(--cream);
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  margin-bottom: clamp(2rem, 8vh, 5rem);
}

.hero-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--driftwood);
  margin-bottom: clamp(2rem, 6vh, 4rem);
}

.hero-plaque {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ===================================================================
   MOON-PHASE DIVIDER
   =================================================================== */
.moon-divider {
  font-family: "Major Mono Display", monospace;
  font-size: 0.6rem;
  letter-spacing: 1.4em;
  color: var(--cyan);
  text-align: center;
  padding: clamp(2rem, 8vh, 5rem) 0;
  user-select: none;
}

/* ===================================================================
   RIBBON — off-axis pull-quote + bleeding skyline
   =================================================================== */
.ribbon {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(3rem, 10vh, 7rem) clamp(1rem, 5vw, 5rem);
  overflow: hidden;
}

.skyline-big {
  position: absolute;
  left: -18%;
  bottom: 0;
  width: 95%;
  height: auto;
  max-height: 60%;
  z-index: 0;
  opacity: 0.9;
}
.skyline-big rect, .skyline-big circle { fill: #000; }
.skyline-big .antenna { fill: var(--teal); }
.skyline-big .tank { fill: #000; }
.skyline-big::after { content: none; }
/* foam wash sits behind the skyline rects via a backdrop rect — emulate with a glow */
.ribbon::before {
  content: "";
  position: absolute;
  left: -18%;
  bottom: 0;
  width: 95%;
  max-height: 62%;
  height: 240px;
  background: linear-gradient(to top, rgba(127,184,164,0.10), transparent);
  z-index: 0;
  pointer-events: none;
}

.pull-quote {
  position: relative;
  z-index: 2;
  max-width: min(40ch, 60vw);
  text-align: right;
  font-family: "Fraunces", "Georgia", serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  line-height: 1.45;
  color: var(--cream);
}
.pq-line { display: block; }
.pq-diacritic { color: var(--foam); font-style: normal; }

/* ===================================================================
   LEDGER — two mismatched scroll rails
   =================================================================== */
.ledger {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.6fr);
  column-gap: clamp(1.5rem, 6vw, 6rem);
  padding: clamp(2rem, 8vh, 6rem) clamp(1rem, 5vw, 5rem);
  align-items: start;
  overflow: hidden;
}

.blob-deep {
  position: absolute;
  width: 48vw; height: 48vw;
  left: -20vw; top: 10vh;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: drift-c 11s ease-in-out infinite alternate;
  animation-delay: -3.7s;
}
.blob-deep path { fill: var(--navy); opacity: 0.45; }

.rail { position: relative; z-index: 2; will-change: transform; }

.rail-left {
  background: linear-gradient(to bottom, rgba(10,42,62,0.55), rgba(10,42,62,0.2));
  border-left: 1px solid var(--teal);
  padding: clamp(1rem, 3vh, 2rem) clamp(0.75rem, 2vw, 1.5rem);
}
.rail-right {
  padding-top: clamp(1.5rem, 5vh, 4rem);
}

.field-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--driftwood);
  line-height: 1.5;
  margin-bottom: clamp(1.4rem, 4vh, 2.6rem);
}
.field-note span { flex: 1; }

.hl-icon {
  width: 12px; height: 12px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1;
}
.hl-icon .dot { fill: var(--teal); stroke: none; }
.hl-icon .tank { fill: none; }

.prose-block {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--cream);
  margin-bottom: clamp(1.8rem, 6vh, 3.5rem);
  max-width: 62ch;
}
.prose-block:nth-child(2) { margin-left: clamp(0px, 6vw, 5rem); }
.prose-block:nth-child(3) { margin-left: clamp(0px, 2vw, 2rem); }

/* ===================================================================
   CLOSING ROOM — largest type, strange word-spacing
   =================================================================== */
.closing {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: clamp(3rem, 12vh, 9rem) clamp(1rem, 4vw, 4rem);
  overflow: hidden;
}
.blob-closing {
  position: absolute;
  width: 60vw; height: 60vw;
  right: -28vw; top: -10vh;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: drift-a 12s ease-in-out infinite alternate;
  animation-delay: -1.2s;
}
.blob-closing path { fill: var(--navy); opacity: 0.4; }

.closing-line {
  position: relative;
  z-index: 2;
  font-family: "Major Mono Display", monospace;
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 5.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--cream);
  width: 100%;
}

/* ===================================================================
   FOOTER MATCHBOOK
   =================================================================== */
.footer {
  position: relative;
  padding: clamp(3rem, 10vh, 7rem) clamp(1rem, 5vw, 5rem) clamp(4rem, 14vh, 9rem);
  display: flex;
  justify-content: flex-start;
  overflow: hidden;
}

.matchbook {
  position: relative;
  width: min(420px, 88vw);
  margin-left: clamp(0px, 8vw, 7rem);
  background: linear-gradient(to bottom, var(--harbor), #082230);
  border: 1px solid var(--teal);
  border-radius: 2px 2px 14px 14px;
  transform: rotate(-1.4deg);
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.2rem, 3vw, 1.8rem) clamp(2.2rem, 4vw, 2.8rem);
  overflow: hidden;
}

.mb-caption {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--driftwood);
  margin-bottom: 1rem;
}

.skyline-small {
  width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem 0 1.2rem;
}
.skyline-small rect { fill: var(--harbor); stroke: var(--teal); stroke-width: 0.5; }
.skyline-small .antenna { fill: var(--cyan); stroke: none; }

.mb-name {
  font-family: "Major Mono Display", monospace;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--cream);
  margin-bottom: 0.8rem;
}

.mb-address {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--driftwood);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.mb-divider {
  padding: 0.8rem 0;
  letter-spacing: 0.9em;
  text-align: left;
}

.mb-tel {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.mb-hours {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--driftwood);
  margin-bottom: 0.5rem;
}

.mb-disclaimer {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--driftwood);
  opacity: 0.7;
  line-height: 1.5;
}

.mb-strike {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--cyan) 12%, var(--cyan) 88%, transparent);
}

/* ===================================================================
   SKELETON-LOADING RITUAL
   =================================================================== */
[data-skeleton] { transition: clip-path 0.5s ease; }

.is-skeleton {
  position: relative;
  color: transparent !important;
  -webkit-text-stroke-color: transparent !important;
  border-radius: 6px;
  background-image: linear-gradient(90deg, #0a2a3e 0%, #1c5d7a 50%, #0a2a3e 100%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.6s linear infinite;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}
.is-skeleton > *,
.is-skeleton svg,
.is-skeleton .hl-icon { visibility: hidden; }
.is-skeleton::before,
.is-skeleton::after { display: none !important; }

/* cyan breathing pulse marker on skeletons */
.is-skeleton {
  box-shadow: inset 0 0 0 1px rgba(63,182,196,0.18);
}

.skeleton-revealed {
  animation: uncurtain 0.55s ease forwards;
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes uncurtain {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(14px, -18px, 0) scale(1.04) rotate(2.4deg); }
  100% { transform: translate3d(-16px, 12px, 0) scale(0.96) rotate(-3deg); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(-18px, 16px, 0) scale(1.05) rotate(-2.8deg); }
  100% { transform: translate3d(15px, -14px, 0) scale(0.95) rotate(3.6deg); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(20px, 14px, 0) scale(1.03) rotate(3deg); }
  100% { transform: translate3d(-12px, -16px, 0) scale(0.97) rotate(-2.2deg); }
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 760px) {
  .col-2-10 { grid-column: 1 / 13; }
  .col-7-11 { grid-column: 4 / 13; }
  .col-3-6  { grid-column: 1 / 13; }
  .wordmark-l2 { margin-left: 14%; }
  .ledger {
    grid-template-columns: 1fr;
    row-gap: clamp(2rem, 8vh, 4rem);
  }
  .rail-left { order: 2; }
  .rail-right { order: 1; }
  .prose-block:nth-child(2),
  .prose-block:nth-child(3) { margin-left: 0; }
  .moon-divider { letter-spacing: 0.8em; }
  .matchbook { margin-left: 0; }
  .pull-quote { max-width: 80vw; }
}

@media (max-width: 420px) {
  .wordmark-l2 { margin-left: 8%; }
  .moon-divider { letter-spacing: 0.5em; font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .blob-deep, .blob-closing { animation: none !important; }
}
