:root {
  /* Compliance tokens: IntersectionObserver IntersectionObserver detect when hexagonal rows entry */
  --paper: #F5ECD7;
  --walnut: #5C4033;
  --iron: #8B6F47;
  --moss: #6B7F3A;
  --deep-moss: #3D4F2F;
  --gold: #C9A96E;
  --vellum: #EDE0C8;
  --spore: #A0522D;
  --hex-size: clamp(140px, 20vw, 260px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--walnut);
  background:
    radial-gradient(circle at 12% 8%, rgba(201, 169, 110, 0.28), transparent 18rem),
    radial-gradient(circle at 82% 18%, rgba(107, 127, 58, 0.12), transparent 16rem),
    linear-gradient(115deg, #F5ECD7 0%, #EDE0C8 46%, #F5ECD7 100%);
  font-family: "Cormorant Garamond", serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(92, 64, 51, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 64, 51, 0.026) 1px, transparent 1px);
  background-size: 42px 42px, 42px 42px;
  mix-blend-mode: multiply;
  z-index: 0;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(92, 64, 51, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(61, 79, 47, 0.06) 0 1px, transparent 1px),
    radial-gradient(circle at 42% 16%, rgba(160, 82, 45, 0.06) 0 1px, transparent 1px);
  background-size: 17px 19px, 23px 29px, 31px 37px;
}

.foxing-field,
.spore-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.fox-spot {
  position: absolute;
  border-radius: 50%;
  background: #C9A96E;
  filter: blur(3px);
  opacity: 0.16;
  mix-blend-mode: multiply;
}

.bubble {
  position: absolute;
  bottom: -8vh;
  border-radius: 50%;
  animation-name: float-up, drift-sideways, breathe;
  animation-timing-function: linear, ease-in-out, ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: -45%;
  border: 1px solid rgba(107, 127, 58, 0.18);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: transform 420ms ease, opacity 420ms ease;
}

.bubble:hover::after { transform: scale(1.8); opacity: 1; }

@keyframes float-up { to { translate: 0 -118vh; } }
@keyframes drift-sideways { 0%, 100% { margin-left: -18px; } 50% { margin-left: 28px; } }
@keyframes breathe { 0%, 100% { scale: 0.98; } 50% { scale: 1.04; } }

main, .home-hex { position: relative; z-index: 5; }

.home-hex {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  width: 54px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--walnut);
  text-decoration: none;
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  z-index: 30;
}

.home-hex svg { position: absolute; inset: 0; fill: rgba(237, 224, 200, 0.76); }
.home-hex path { stroke: #5C4033; stroke-width: 3px; fill: rgba(237, 224, 200, 0.7); }
.home-hex span { position: relative; z-index: 1; transform: translateY(-1px); }

.section-layer {
  position: relative;
  min-height: 100vh;
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 4vw, 5rem);
}

.opening {
  display: grid;
  place-items: center;
  padding-top: 2rem;
}

.hero-hex {
  width: min(88vw, 760px);
  aspect-ratio: 1.08;
  position: relative;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(237, 224, 200, 0.56);
  box-shadow: inset 0 0 90px rgba(201, 169, 110, 0.34), 0 26px 90px rgba(92, 64, 51, 0.16);
}

.moss-canvas, .final-canvas, .cell-moss {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wobble-border, .hex-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  z-index: 4;
}

.wobble-border path, .hex-ink path {
  stroke: #5C4033;
  stroke-width: 1.5px;
  stroke-linecap: round;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.hero-border path { stroke-width: 2.2px; }

.hero-copy {
  position: relative;
  z-index: 6;
  text-align: center;
  max-width: 520px;
  padding: 2rem;
}

.specimen-label, .cell-label, .margin-note, .scroll-note {
  font-family: "Caveat", cursive;
  color: var(--iron);
  letter-spacing: 0.03em;
}

.specimen-label { font-size: clamp(1rem, 2vw, 1.35rem); margin: 0 0 0.5rem; }

h1 {
  min-height: 1.05em;
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--walnut);
  text-shadow: 0 2px 0 rgba(201, 169, 110, 0.22);
}

.korean-title, .kr {
  font-family: "Noto Serif KR", serif;
  font-weight: 300;
  line-height: 2;
}

.korean-title {
  opacity: 0;
  margin: 0.2rem 0 1rem;
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--deep-moss);
  transition: opacity 1800ms ease;
}

.korean-title.visible { opacity: 1; }

.opening-note, p {
  font-size: 1.125rem;
  line-height: 1.85;
  font-weight: 400;
}

.scroll-note {
  position: absolute;
  bottom: 2rem;
  opacity: 0.72;
  animation: soft-bob 3.6s ease-in-out infinite;
}

@keyframes soft-bob { 50% { transform: translateY(8px); } }

.honeycomb-section { padding-top: 8rem; }
.watermark {
  position: absolute;
  top: 4rem;
  right: 6vw;
  font-family: "Noto Serif KR", serif;
  font-size: clamp(7rem, 18vw, 18rem);
  color: rgba(107, 127, 58, 0.08);
  pointer-events: none;
}

.margin-note {
  max-width: 300px;
  margin: 0 0 2rem clamp(1rem, 8vw, 8rem);
  font-size: 1.35rem;
}

.honeycomb {
  width: min(1120px, 96vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: calc(var(--hex-size) * -0.12);
}

.hex-row {
  display: flex;
  justify-content: center;
  gap: clamp(0.4rem, 1.3vw, 1.2rem);
}

.hex-row.offset { transform: translateX(calc(var(--hex-size) * 0.26)); }

.hex-cell {
  width: var(--hex-size);
  height: calc(var(--hex-size) * 0.92);
  position: relative;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(245, 236, 215, 0.74);
  padding: clamp(1.7rem, 3vw, 2.3rem);
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 900ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: inset 0 0 45px rgba(201, 169, 110, 0.22);
}

.hex-cell.revealed { opacity: 1; transform: translateY(0) scale(1); }
.hex-cell:nth-child(2) { width: calc(var(--hex-size) * 1.05); height: calc(var(--hex-size) * 0.96); }
.hex-cell:nth-child(3) { width: calc(var(--hex-size) * 0.96); }

.hex-cell.cream { background: rgba(237, 224, 200, 0.86); }
.hex-cell.dark { background: rgba(61, 79, 47, 0.88); color: #F5ECD7; }
.hex-cell.dark .cell-label { color: #C9A96E; }
.hex-cell.dark .hex-ink path { stroke: #C9A96E; }

.cell-label {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 5;
}

.hex-cell p { margin: 1.1rem 0 0; font-size: clamp(0.95rem, 1.55vw, 1.12rem); line-height: 1.55; position: relative; z-index: 3; }
.art-cell { overflow: hidden; background: rgba(237, 224, 200, 0.55); }

.botanical {
  width: 74%;
  height: 74%;
  overflow: visible;
  position: relative;
  z-index: 3;
  animation: botanical-breathe 8s ease-in-out infinite;
}

.botanical path, .botanical circle, .botanical ellipse {
  stroke: #5C4033;
  stroke-width: 2;
  fill: rgba(160, 82, 45, 0.08);
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes botanical-breathe { 0%, 100% { transform: scale(0.98) rotate(-1deg); } 50% { transform: scale(1.02) rotate(1deg); } }

.poetry-section {
  display: grid;
  place-items: center;
}

.poem-panel {
  width: min(92vw, 900px);
  min-height: 500px;
  position: relative;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(237, 224, 200, 0.72);
  overflow: hidden;
}

.poem-text {
  position: relative;
  z-index: 5;
  max-width: 560px;
  padding: 3rem;
  text-align: center;
}

.kr.large { font-size: clamp(1.35rem, 3vw, 2.6rem); color: var(--deep-moss); }

.deep-zoom {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 1.2fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: center;
}

.zoom-copy h2 {
  font-family: "Caveat", cursive;
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin: 0;
  color: var(--walnut);
}

.spore-study {
  min-height: 560px;
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(237, 224, 200, 0.74), transparent 64%);
}

.botanical.giant { width: min(74vw, 500px); height: min(74vw, 500px); }
.botanical.giant circle { fill: rgba(160, 82, 45, 0.12); stroke-width: 1.4; }

.spore-orbit {
  position: absolute;
  border-radius: 50%;
  background: rgba(160, 82, 45, 0.18);
  border: 1px solid rgba(92, 64, 51, 0.28);
  animation: orbit-drift 11s ease-in-out infinite;
}
.spore-orbit.one { width: 58px; height: 58px; top: 14%; left: 22%; }
.spore-orbit.two { width: 28px; height: 28px; bottom: 22%; left: 18%; animation-delay: -3s; }
.spore-orbit.three { width: 42px; height: 42px; right: 18%; top: 30%; animation-delay: -6s; }
@keyframes orbit-drift { 50% { transform: translate(22px, -18px) scale(1.06); } }

.final-colony {
  min-height: 120vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(61, 79, 47, 0.05);
}

.final-words {
  position: relative;
  z-index: 4;
  width: min(700px, 88vw);
  text-align: center;
  padding: 5rem 2rem;
  color: var(--walnut);
}

.final-words h2 {
  font-size: clamp(6rem, 18vw, 15rem);
  margin: 0;
  color: rgba(245, 236, 215, 0.88);
  text-shadow: 0 2px 18px rgba(61, 79, 47, 0.8);
}

.final-words p:last-child { color: #F5ECD7; text-shadow: 0 1px 8px #3D4F2F; }

@media (max-width: 760px) {
  :root { --hex-size: clamp(132px, 43vw, 190px); }
  .section-layer { padding-left: 0.75rem; padding-right: 0.75rem; }
  .hero-hex { width: 96vw; }
  .hex-row { flex-wrap: wrap; gap: 0.25rem; }
  .hex-row.offset { transform: none; }
  .hex-cell { padding: 1.45rem; }
  .hex-cell p { font-size: 0.92rem; line-height: 1.42; }
  .deep-zoom { grid-template-columns: 1fr; text-align: center; }
  .spore-study { min-height: 420px; }
  .poem-panel { min-height: 430px; width: 98vw; }
}
