/* =====================================================================
   cherrypop.bar  —  the imaginary cherry archive
   sepia-nostalgic / hexagonal-honeycomb / mono / generative / watercolor
   ===================================================================== */

:root {
  --paper:    #f1e4cf;
  --paper-2:  #e9d9bf;
  --ink:      #4a3120;
  --ink-2:    #3a2418;
  --ink-3:    #3a2a22;
  --sepia:    #8a6a4a;
  --sepia-2:  #c9a56a;
  --sepia-3:  #d9b88a;
  --cherry:   #a8324a;
  --cherry-d: #7a3a3a;

  --cell-size:        clamp(160px, 14vw, 232px);
  --cell-w:           var(--cell-size);
  --cell-h:           calc(var(--cell-size) * 1.1547); /* hex height = w * 2/sqrt(3) */
  --cell-step-x:      calc(var(--cell-w) * 0.75);
  --cell-step-y:      calc(var(--cell-h) * 0.5);

  --hex-clip: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* sepia paper grain via SVG noise data-uri, multiplied at low opacity */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
}

main {
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 12vw rgba(74, 49, 32, 0.18);
  padding: 0 0 6rem;
}

#paper-wash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  mix-blend-mode: multiply;
}

#pit-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ----- HEX BASE ----- */

.hex {
  position: relative;
  width: var(--cell-w);
  height: var(--cell-h);
  clip-path: var(--hex-clip);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hex-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14% 16%;
  text-align: center;
  position: relative;
}

/* ----- THRESHOLD (HERO) ----- */

.threshold {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  position: relative;
}

.hex-hero {
  width: clamp(320px, 78vw, 880px);
  height: calc(clamp(320px, 78vw, 880px) * 1.1547);
  background:
    radial-gradient(ellipse at 50% 60%, rgba(217, 184, 138, 0.55), rgba(241, 228, 207, 0.0) 70%),
    var(--paper-2);
  border: none;
}

.hex-hero::before {
  /* edge stroke as inner outline that respects clip-path */
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: var(--hex-clip);
  background:
    linear-gradient(transparent, transparent),
    var(--ink);
  z-index: 0;
  filter: blur(0.4px);
  opacity: 0.0;
}

.domain {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.0rem, 7vw, 5.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  color: var(--ink);
  position: relative;
  text-shadow: 0 0 0.6px rgba(74, 49, 32, 0.4);
  display: inline-block;
}

/* letterpress mis-registration: red sister copy offset by 0.4px */
.domain::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  transform: translate(0.4px, 0.4px);
  color: var(--cherry);
  opacity: 0.25;
  pointer-events: none;
}

.subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  margin: 0 0 1.4rem;
  color: var(--sepia);
  letter-spacing: 0.02em;
}

.hero-cherry {
  width: clamp(96px, 14vw, 168px);
  height: auto;
  margin: 0.2rem 0 1rem;
  overflow: visible;
}

.cherry-stem,
.cherry-leaf,
.cherry-fruit {
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cherry-stem {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawPath 1.6s cubic-bezier(.65,0,.35,1) forwards;
}

.cherry-leaf {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: drawPath 1.6s cubic-bezier(.65,0,.35,1) 0.4s forwards;
}

.cherry-fruit {
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: drawPath 1.6s cubic-bezier(.65,0,.35,1) 0.8s forwards;
}

.cherry-bleed {
  fill: var(--cherry);
  opacity: 0;
  animation: bleed 2s ease-in 2.4s forwards;
  filter: blur(2px);
}

@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}

@keyframes bleed {
  0%   { opacity: 0; }
  60%  { opacity: 0.55; }
  100% { opacity: 0.7; }
}

.threshold-meta {
  margin: 0.6rem 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
}

/* ----- THE FIELD (HONEYCOMB CATALOG) ----- */

.field {
  position: relative;
  padding: 4rem 0;
}

.comb {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.cell {
  position: absolute;
  width: var(--cell-w);
  height: var(--cell-h);
  clip-path: var(--hex-clip);
  background: var(--paper-2);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.5s ease;
  --bloomX: 50%;
  --bloomY: 50%;
}

.cell:hover {
  z-index: 5;
}

.cell::before {
  /* edge ring — inset slightly so we get a thin sepia line */
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--hex-clip);
  background:
    radial-gradient(circle at 50% 50%, transparent 0%, transparent 92%, rgba(74,49,32,0.55) 93%, rgba(74,49,32,0.0) 100%);
  pointer-events: none;
  z-index: 1;
}

.cell-bloom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.8s ease;
  background: radial-gradient(circle at var(--bloomX) var(--bloomY),
              rgba(168, 50, 74, 0.55) 0%,
              rgba(168, 50, 74, 0.28) 30%,
              rgba(168, 50, 74, 0) 65%);
  filter: blur(2px);
}

.cell:hover .cell-bloom {
  opacity: 1;
}

.cell-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18% 14%;
  pointer-events: none;
  text-align: center;
}

.cell-id {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
  margin: 0;
}

.cell-cherry {
  width: 36%;
  height: auto;
  margin: 0.2rem 0;
  overflow: visible;
}

.cell-cherry path {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawPath 1.6s cubic-bezier(.65,0,.35,1) forwards;
  animation-delay: calc(var(--i) * 22ms);
}

.cell-cherry .cherry-fill {
  fill: var(--cherry);
  opacity: 0;
  stroke: none;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: cellBleed 1.4s ease-in forwards;
  animation-delay: calc(var(--i) * 22ms + 1.6s);
  filter: blur(0.6px);
}

@keyframes cellBleed {
  to { opacity: 0.62; }
}

.cell-note {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  max-width: 90%;
}

.cell-date {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.66rem;
  color: var(--sepia);
  margin: 0;
  letter-spacing: 0.06em;
}

/* ----- MARGINALIA STRIPS ----- */

.strip {
  position: relative;
  width: 100%;
  padding: 4.5rem 6vw;
  background:
    linear-gradient(transparent, rgba(217, 184, 138, 0.18), transparent),
    var(--paper);
  border-top: 1px solid rgba(74, 49, 32, 0.18);
  border-bottom: 1px solid rgba(74, 49, 32, 0.18);
  text-align: center;
  margin: 1.5rem 0;
}

.strip-quote {
  font-family: 'Caveat', cursive;
  font-weight: 400;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.25;
  color: var(--cherry-d);
  margin: 0 auto;
  max-width: 64ch;
  letter-spacing: 0.01em;
  position: relative;
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.6s ease-out, transform 1.6s ease-out;
}

.strip.inked .strip-quote {
  opacity: 1;
  transform: translateY(0);
}

.strip-attribution {
  display: block;
  margin-top: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
}

/* underline drawn-with-ink effect */
.strip-quote::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: var(--cherry-d);
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 3.4s ease-out 0.6s;
}

.strip.inked .strip-quote::after {
  transform: scaleX(1);
}

/* ----- THE PRESS (FOOTER HEX) ----- */

.press {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw 0;
  margin-top: 4rem;
}

.hex-press {
  width: clamp(280px, 60vw, 640px);
  height: calc(clamp(280px, 60vw, 640px) * 1.1547);
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}

.hex-press::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--hex-clip);
  background: radial-gradient(circle at 50% 60%, rgba(58, 36, 24, 0.12), transparent 60%);
  pointer-events: none;
}

#pit-drift {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.press-line {
  position: relative;
  z-index: 2;
  margin: auto 0 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.press-meta {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
}

/* ----- responsive tightening ----- */

@media (max-width: 720px) {
  :root {
    --cell-size: clamp(120px, 26vw, 180px);
  }
  .domain { letter-spacing: -0.015em; }
}

/* ----- reduced motion ----- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cherry-stem,
  .cherry-leaf,
  .cherry-fruit,
  .cell-cherry path { stroke-dashoffset: 0 !important; }
  .cherry-bleed { opacity: 0.55 !important; }
  .cell-cherry .cherry-fill { opacity: 0.55 !important; }
  .strip-quote { opacity: 1 !important; transform: none !important; }
  .strip-quote::after { transform: scaleX(1) !important; }
}
