/* ============================================
   monopole.one — Honeycomb Lattice Design
   Palette: Honeyed Neutral (1970s European Science Textbook)
   ============================================ */

:root {
  --parchment: #F5ECD7;
  --linen: #EDE3CB;
  --umber: #3B2F20;
  --tawny: #8B7355;
  --amber: #C4A56C;
  --sienna: #A0522D;
  --honey: #E8D5A3;
  --dark-amber: #8B6914;

  --hex-w: 280px;
  --hex-h: calc(var(--hex-w) * 1.1547);
  --hex-clip: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.25rem);
  line-height: 1.65;
  background: var(--parchment);
  color: var(--umber);
  overflow-x: hidden;
}

h1 {
  font-family: 'Zilla Slab', 'Rockwell', serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 5rem);
  letter-spacing: 0.02em;
  color: var(--umber);
}

h2 {
  font-family: 'Zilla Slab', 'Rockwell', serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.02em;
  color: var(--umber);
  margin-bottom: 1.5rem;
}

p {
  max-width: 38em;
}

.mono-label {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  letter-spacing: 0.04em;
  color: var(--tawny);
  text-transform: uppercase;
}

/* ============================================
   Paper Grain Texture
   ============================================ */
.paper-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ============================================
   Hex Grid Background
   ============================================ */
.hex-grid-bg {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.15;
  transition: transform 0.1s linear;
}

/* ============================================
   Hex Navigation
   ============================================ */
.hex-nav-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
  animation: hexPulse 2.5s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.hex-nav-trigger:hover {
  transform: scale(1.15);
}

.hex-nav-trigger svg polygon {
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.hex-nav-trigger:hover svg polygon {
  fill: rgba(196, 165, 108, 0.15);
  stroke: var(--sienna);
}

@keyframes hexPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.hex-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  background: rgba(59, 47, 32, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hex-nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.hex-nav-ring {
  position: relative;
  width: 320px;
  height: 320px;
}

.hex-nav-item {
  position: absolute;
  width: 80px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.hex-nav-item:hover {
  transform: scale(1.12);
}

.hex-nav-item svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hex-nav-item svg polygon {
  transition: fill 0.2s ease;
}

.hex-nav-item:hover svg polygon {
  fill: var(--honey);
}

.hex-nav-item span {
  position: relative;
  z-index: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--umber);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Position nav items in a hex ring */
.hex-nav-item[data-field="1"] { top: 0; left: 50%; transform: translateX(-50%); }
.hex-nav-item[data-field="2"] { top: 60px; right: 0; }
.hex-nav-item[data-field="3"] { top: 180px; right: 10px; }
.hex-nav-item[data-field="4"] { top: 180px; left: 10px; }
.hex-nav-item[data-field="5"] { top: 60px; left: 0; }

/* ============================================
   Main Layout
   ============================================ */
main {
  position: relative;
  z-index: 1;
}

.hex-field {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.field-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ============================================
   Hex Shape (Clip-path hexagon)
   ============================================ */
.hex-shape {
  clip-path: var(--hex-clip);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* ============================================
   FIELD 1: Hero
   ============================================ */
.field-hero {
  position: relative;
}

.hero-hex-cluster {
  position: relative;
  width: 700px;
  height: 700px;
  max-width: 95vw;
  max-height: 95vh;
}

.hero-hex-main {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--hex-w);
  height: var(--hex-h);
  opacity: 0;
}

.hero-hex-main .hex-shape {
  width: 100%;
  height: 100%;
  background: var(--linen);
  border: none;
  position: relative;
}

.hero-hex-main .hex-shape::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  clip-path: var(--hex-clip);
  background: var(--amber);
  z-index: -1;
}

.hero-hex-main h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  word-break: break-word;
}

.hero-satellite {
  position: absolute;
  width: calc(var(--hex-w) * 0.6);
  height: calc(var(--hex-h) * 0.6);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-satellite .hex-shape {
  width: 100%;
  height: 100%;
  background: var(--linen);
  position: relative;
}

.hero-satellite .hex-shape::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  clip-path: var(--hex-clip);
  background: rgba(196, 165, 108, 0.5);
  z-index: -1;
}

.hero-satellite span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  letter-spacing: 0.04em;
  color: var(--tawny);
  text-transform: lowercase;
}

.hero-satellite.visible {
  opacity: 1;
  transform: scale(1);
}

/* Satellite positions (hexagonal ring around center) */
.satellite-0 { top: 2%; left: 50%; transform: translate(-50%, 0) scale(0.7); }
.satellite-0.visible { transform: translate(-50%, 0) scale(1); }
.satellite-1 { top: 18%; right: 8%; transform: scale(0.7); }
.satellite-1.visible { transform: scale(1); }
.satellite-2 { bottom: 18%; right: 8%; transform: scale(0.7); }
.satellite-2.visible { transform: scale(1); }
.satellite-3 { bottom: 2%; left: 50%; transform: translate(-50%, 0) scale(0.7); }
.satellite-3.visible { transform: translate(-50%, 0) scale(1); }
.satellite-4 { bottom: 18%; left: 8%; transform: scale(0.7); }
.satellite-4.visible { transform: scale(1); }
.satellite-5 { top: 18%; left: 8%; transform: scale(0.7); }
.satellite-5.visible { transform: scale(1); }

/* ============================================
   FIELD 2: Concept Rosette
   ============================================ */
.field-concept {
  min-height: 100vh;
}

.concept-rosette {
  position: relative;
  width: 750px;
  height: 750px;
  max-width: 95vw;
  max-height: 90vh;
}

.concept-hex {
  position: absolute;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.concept-hex.visible {
  opacity: 1;
  transform: scale(1);
}

.concept-center {
  width: 260px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 2;
}

.concept-center.visible {
  transform: translate(-50%, -50%) scale(1);
}

.concept-center .hex-shape {
  width: 100%;
  height: 100%;
  background: var(--linen);
  position: relative;
}

.concept-center .hex-shape::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  clip-path: var(--hex-clip);
  background: var(--amber);
  z-index: -1;
}

.concept-ring {
  width: 200px;
  height: 230px;
}

.concept-ring .hex-shape {
  width: 100%;
  height: 100%;
  background: rgba(237, 227, 203, 0.9);
  position: relative;
}

.concept-ring .hex-shape::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  clip-path: var(--hex-clip);
  background: rgba(196, 165, 108, 0.4);
  z-index: -1;
}

.concept-text {
  font-size: clamp(0.72rem, 0.9vw, 0.9rem);
  line-height: 1.5;
  color: var(--umber);
}

.concept-center .concept-text {
  font-weight: 600;
  font-size: clamp(0.82rem, 1vw, 1rem);
}

/* Concept ring positions */
.ring-0 { top: 2%; left: 50%; transform: translateX(-50%) scale(0.8); }
.ring-0.visible { transform: translateX(-50%) scale(1); }
.ring-1 { top: 17%; right: 3%; }
.ring-2 { bottom: 17%; right: 3%; }
.ring-3 { bottom: 2%; left: 50%; transform: translateX(-50%) scale(0.8); }
.ring-3.visible { transform: translateX(-50%) scale(1); }
.ring-4 { bottom: 17%; left: 3%; }
.ring-5 { top: 17%; left: 3%; }

/* ============================================
   FIELD 3: Data Landscape / Hex Heatmap
   ============================================ */
.field-data {
  min-height: 100vh;
  position: relative;
}

.field-label {
  text-align: center;
  margin-bottom: 2rem;
}

.field-label .mono-label {
  display: block;
  margin-bottom: 0.25rem;
}

.hex-heatmap {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 500px;
}

.heatmap-cell {
  position: absolute;
  clip-path: var(--hex-clip);
  transition: background-color 0.08s ease;
  cursor: pointer;
}

.heatmap-cell:hover {
  filter: brightness(0.92);
}

/* ============================================
   FIELD 4: Archive
   ============================================ */
.field-archive {
  min-height: 100vh;
}

.archive-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
  max-width: 1100px;
}

.archive-hex {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.archive-hex.visible {
  opacity: 1;
  transform: translateY(0);
}

.archive-1x {
  width: 200px;
  height: 230px;
}

.archive-1-5x {
  width: 280px;
  height: 323px;
}

.archive-2x {
  width: 340px;
  height: 392px;
}

.archive-card {
  width: 100%;
  height: 100%;
  background: var(--linen);
  position: relative;
  overflow: hidden;
  flex-direction: column;
  box-shadow: 4px 4px 16px rgba(139, 115, 85, 0.15);
}

.archive-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.pattern-crosshatch {
  background:
    repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(196, 165, 108, 0.08) 8px, rgba(196, 165, 108, 0.08) 9px),
    repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(196, 165, 108, 0.08) 8px, rgba(196, 165, 108, 0.08) 9px);
}

.pattern-stipple {
  background: radial-gradient(circle, rgba(139, 115, 85, 0.06) 1px, transparent 1px);
  background-size: 6px 6px;
}

.pattern-contour {
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(196, 165, 108, 0.06) 21%, transparent 22%),
    radial-gradient(ellipse at center, transparent 40%, rgba(196, 165, 108, 0.05) 41%, transparent 42%),
    radial-gradient(ellipse at center, transparent 60%, rgba(196, 165, 108, 0.04) 61%, transparent 62%),
    radial-gradient(ellipse at center, transparent 80%, rgba(196, 165, 108, 0.03) 81%, transparent 82%);
}

.archive-text {
  position: relative;
  z-index: 1;
  font-size: clamp(0.72rem, 0.9vw, 0.88rem);
  line-height: 1.5;
  color: var(--umber);
  padding: 0 0.5rem;
}

.archive-label {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.5rem;
  font-size: 0.65rem;
}

/* ============================================
   FIELD 5: Convergence
   ============================================ */
.field-convergence {
  min-height: 100vh;
  position: relative;
}

.convergence-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.convergence-hex {
  position: absolute;
  clip-path: var(--hex-clip);
  border: 1px solid rgba(196, 165, 108, 0.3);
  background: rgba(237, 227, 203, 0.3);
  transition: none;
}

.convergence-singularity {
  position: relative;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.convergence-singularity.visible {
  opacity: 1;
}

.singularity-hex {
  width: 280px;
  height: 323px;
  background: var(--linen);
  position: relative;
  animation: singularityPulse 2s ease-in-out infinite;
}

.singularity-hex::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  clip-path: var(--hex-clip);
  background: var(--amber);
  z-index: -1;
}

.singularity-hex h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

@keyframes singularityPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(196, 165, 108, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(196, 165, 108, 0.6);
  }
}

/* ============================================
   Ripple Effect
   ============================================ */
.ripple-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.ripple-ring {
  position: absolute;
  border: 2px solid var(--amber);
  clip-path: var(--hex-clip);
  opacity: 0;
  pointer-events: none;
  animation: rippleExpand 0.6s ease-out forwards;
}

@keyframes rippleExpand {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ============================================
   Decorative Rules
   ============================================ */
.hex-field + .hex-field::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 400px;
  height: 1px;
  background: var(--amber);
  opacity: 0.3;
}

.hex-field + .hex-field::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 14px;
  clip-path: var(--hex-clip);
  background: var(--amber);
  opacity: 0.5;
}

/* ============================================
   Graph Paper Underlay (Field 3)
   ============================================ */
#field3 {
  background:
    linear-gradient(rgba(196, 165, 108, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 165, 108, 0.04) 1px, transparent 1px),
    var(--parchment);
  background-size: 20px 20px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --hex-w: 180px;
    --hex-h: calc(var(--hex-w) * 1.1547);
  }

  .hero-hex-cluster {
    width: 400px;
    height: 500px;
  }

  .concept-rosette {
    width: 380px;
    height: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-height: none;
  }

  .concept-hex {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  .concept-center {
    width: 220px;
    height: 254px;
  }

  .concept-center.visible {
    transform: none !important;
  }

  .concept-ring {
    width: 170px;
    height: 196px;
  }

  .concept-ring.visible {
    transform: none !important;
  }

  .archive-1x { width: 160px; height: 184px; }
  .archive-1-5x { width: 200px; height: 230px; }
  .archive-2x { width: 260px; height: 300px; }

  .hex-heatmap {
    height: 400px;
  }

  .field-content {
    padding: 1.5rem 1rem;
  }

  .hex-nav-ring {
    width: 260px;
    height: 260px;
  }

  .singularity-hex {
    width: 200px;
    height: 230px;
  }
}

@media (max-width: 480px) {
  .hero-hex-cluster {
    width: 300px;
    height: 420px;
  }

  .hero-satellite {
    width: calc(var(--hex-w) * 0.5);
    height: calc(var(--hex-h) * 0.5);
  }

  .archive-grid {
    flex-direction: column;
    align-items: center;
  }
}
