/* Design terms: (Google Interaction* Interaction:** IntersectionObserver-based fade-reveal pattern. hexagonal starts `opacity: */
:root {
  --deep-earth: #2B1D12;
  --warm-ground: #3B2A1A;
  --amber-core: #D4854A;
  --soft-glow: #F5E6D3;
  --blush-highlight: #E8A87C;
  --deep-molasses: #1A1008;
  --dried-herb: #8B9A6B;
  --critical-red: #C25D3A;
  --burnt-copper: #C87941;
  --font-display: "Nunito Sans", Inter, sans-serif;
  --font-body: "Source Sans 3", "IBM Plex Sans", sans-serif;
  --font-code: "IBM Plex Mono", monospace;
  --hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--soft-glow);
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  line-height: 1.65;
  background:
    radial-gradient(circle at 12% 8%, rgba(232, 168, 124, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 28%, rgba(212, 133, 74, 0.11), transparent 24rem),
    linear-gradient(135deg, var(--deep-earth), var(--warm-ground));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(245, 230, 211, 0.09) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(212, 133, 74, 0.07) 0 1px, transparent 1.6px);
  background-size: 46px 52px, 73px 61px;
  mix-blend-mode: screen;
}

button { font: inherit; }

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: 2px;
  height: 0;
  background: var(--amber-core);
  box-shadow: 0 0 14px rgba(212, 133, 74, 0.35);
}

.honeycomb-story { position: relative; }

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 4rem);
  background: linear-gradient(135deg, var(--deep-earth), var(--warm-ground));
}

.hero-shell {
  position: relative;
  width: min(92vw, 860px);
  min-height: min(90vh, 760px);
  display: grid;
  place-items: center;
}

.hex-cell {
  position: relative;
  display: grid;
  place-items: center;
  clip-path: var(--hex);
  border: 1px solid rgba(212, 133, 74, 0.4);
  background: rgba(245, 230, 211, 0.95);
  color: #5C4A3A;
  transition: transform 300ms ease-out, filter 300ms ease-out, box-shadow 300ms ease-out, border-color 300ms ease-out, background-color 300ms ease-out;
  overflow: hidden;
}

.hex-cell::before {
  content: "";
  position: absolute;
  inset: 6px;
  clip-path: var(--hex);
  border: 1px solid rgba(212, 133, 74, 0.25);
  pointer-events: none;
}

.hex-cell:hover,
.hex-cell.is-expanded {
  border-color: rgba(212, 133, 74, 0.8);
  box-shadow: inset 0 0 20px rgba(212, 133, 74, 0.15);
  filter: saturate(1.08);
}

.dark-cell {
  background: rgba(43, 29, 18, 0.9);
  color: #E8D5C4;
}

.cell-inner {
  position: relative;
  z-index: 1;
  width: 78%;
  text-align: center;
}

.hero-cell {
  width: min(60vw, 600px);
  min-width: 320px;
  aspect-ratio: 1;
  opacity: 0;
  animation: heroFade 500ms ease-out 200ms forwards;
}

.cell-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burnt-copper);
}

h1, h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--soft-glow);
  text-shadow: 0 2px 20px var(--deep-molasses);
}

h2 { font-size: clamp(1.05rem, 2vw, 1.45rem); color: var(--warm-ground); }
.dark-cell h2 { color: var(--soft-glow); }

p { margin: 0.75rem 0 0; }

.tagline {
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--blush-highlight);
}

.satellite-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.satellite-cell {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(108px, 11vw, 140px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(212, 133, 74, 0.4);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(0.3);
  animation: satelliteBloom 720ms ease-out forwards;
}

.satellite-cell span {
  width: 74%;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--warm-ground);
}

.satellite-cell:nth-child(1) { --x: 0px; --y: -285px; animation-delay: 720ms; }
.satellite-cell:nth-child(2) { --x: 248px; --y: -142px; animation-delay: 840ms; }
.satellite-cell:nth-child(3) { --x: 248px; --y: 142px; animation-delay: 960ms; }
.satellite-cell:nth-child(4) { --x: 0px; --y: 285px; animation-delay: 1080ms; }
.satellite-cell:nth-child(5) { --x: -248px; --y: 142px; animation-delay: 1200ms; }
.satellite-cell:nth-child(6) { --x: -248px; --y: -142px; animation-delay: 1320ms; }

@keyframes heroFade { to { opacity: 1; } }
@keyframes satelliteBloom { to { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1); } }

.wave-divider {
  display: block;
  width: 100%;
  height: 40px;
  margin: 1rem 0 2rem;
  overflow: visible;
}

.wave-divider path {
  fill: none;
  stroke: var(--amber-core);
  stroke-width: 1.5px;
  stroke-linecap: round;
  opacity: 0.78;
  animation: waveDrift 8s linear infinite;
}

.medium-wave path { animation-duration: 7s; }
.tight-wave path { animation-duration: 5s; }
@keyframes waveDrift { 50% { transform: translateX(-28px); } }

.comb-section {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.section-label {
  width: 132px;
  aspect-ratio: 1;
  margin: 0 auto 1.5rem;
  background: transparent;
  color: var(--amber-core);
}

.outline-cell { border-color: rgba(212, 133, 74, 0.55); }
.outline-cell span { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; }

.comb-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  grid-auto-rows: 92px;
  gap: 6px;
  padding: 6px;
  background-image:
    linear-gradient(90deg, rgba(212, 133, 74, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(212, 133, 74, 0.12) 1px, transparent 1px);
  background-size: calc(16.66% + 1px) 98px, 100% 98px;
}

.comb-grid > .hex-cell {
  min-height: 270px;
  padding: 1.1rem;
  grid-column: span 2;
  grid-row: span 3;
}

.comb-grid > .hex-cell:nth-of-type(even) { transform: translateY(48px); }
.comb-grid > .hex-cell:nth-of-type(3n) { background: rgba(245, 230, 211, 0.9); }
.comb-grid > .dark-cell:nth-of-type(3n) { background: rgba(43, 29, 18, 0.9); }

.span-large { grid-column: span 3 !important; grid-row: span 4 !important; min-height: 360px !important; }
.span-wide { grid-column: span 3 !important; }

.hex-cell[data-status="verified"] { border-color: rgba(139, 154, 107, 0.9); }
.hex-cell[data-status="warning"] { border-color: rgba(212, 133, 74, 0.9); }
.hex-cell[data-status="critical"] { border-color: rgba(194, 93, 58, 0.95); }

.cell-inner p:not(.cell-kicker) {
  font-size: clamp(0.85rem, 1.35vw, 1rem);
  font-weight: 400;
  color: #5C4A3A;
}

.dark-cell .cell-inner p:not(.cell-kicker) { color: #E8D5C4; }

code {
  font-family: var(--font-code);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(59, 42, 26, 0.08);
  color: var(--burnt-copper);
}

.dark-cell code { background: rgba(245, 230, 211, 0.08); }

.extra-detail {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: inherit;
  opacity: 0;
  transition: max-height 300ms ease-out, opacity 300ms ease-out, margin-top 300ms ease-out;
}

.hex-cell.is-expanded {
  z-index: 4;
  transform: scale(1.04) translateY(0) !important;
}

.hex-cell.is-expanded .extra-detail {
  max-height: 220px;
  opacity: 1;
  margin-top: 0.75rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition-property: opacity, transform, filter, box-shadow, border-color;
  transition-duration: 600ms, 600ms, 300ms, 300ms, 300ms;
  transition-timing-function: ease-out;
  transition-delay: var(--stagger-delay, 0ms), var(--stagger-delay, 0ms), 0ms, 0ms, 0ms;
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

.breathing-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 10px;
}

.breathing-row i {
  display: block;
  width: 72px;
  aspect-ratio: 1;
  clip-path: var(--hex);
  border: 1px solid rgba(212, 133, 74, 0.45);
  background: rgba(245, 230, 211, 0.03);
}

.thread-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.thread-map path {
  fill: none;
  stroke: var(--amber-core);
  stroke-width: 1px;
  opacity: 0.3;
  transition: opacity 400ms ease-out, stroke-width 400ms ease-out;
}

.thread-map path.is-active { opacity: 1; stroke-width: 1.8px; }

.compact-grid > .hex-cell,
.final-grid > .hex-cell { min-height: 250px; }
.final-section { padding-bottom: 8rem; }

@media (max-width: 768px) {
  .hero { align-items: start; padding-top: 4vh; }
  .hero-shell { min-height: auto; display: block; }
  .hero-cell { width: min(88vw, 420px); min-width: 0; margin: 0 auto 1rem; }
  .satellite-ring {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(116px, 1fr));
    gap: 8px;
    width: min(94vw, 380px);
    margin: 0 auto;
  }
  .satellite-cell {
    position: relative;
    inset: auto;
    left: auto;
    top: auto;
    width: 100%;
    transform: scale(0.3);
  }
  @keyframes satelliteBloom { to { opacity: 1; transform: scale(1); } }
  .comb-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: none;
  }
  .comb-grid > .hex-cell,
  .span-large,
  .span-wide {
    width: min(92vw, 420px);
    min-height: 300px !important;
    aspect-ratio: 1;
    margin: 0 auto;
    transform: none !important;
  }
  .thread-map { display: none; }
  .wave-divider { height: 24px; }
  .scroll-progress { top: auto; bottom: 0; left: 0; width: 0; height: 2px; }
  .breathing-row { padding: 4px 0; }
  .breathing-row i { width: 52px; }
}

@media (max-width: 430px) {
  .cell-inner { width: 72%; }
  .comb-grid > .hex-cell,
  .span-large,
  .span-wide { min-height: 276px !important; }
  .cell-inner p:not(.cell-kicker) { font-size: 0.86rem; line-height: 1.35; }
}
