/* ============================================================
   sbom.day — surreal hexagonal-honeycomb · retro-futuristic
   Palette:
     #E8E0D4 warm gray   #0D9488 retro teal
     #D97706 amber       #F5F0E8 paper cream
     #2A2A28 charcoal    #4A7B8B vintage blue
     #E87040 atomic orange   #4A4440 deep warm gray
   ============================================================ */

:root {
  --warm-gray:   #E8E0D4;
  --paper:       #F5F0E8;
  --charcoal:    #2A2A28;
  --teal:        #0D9488;
  --amber:       #D97706;
  --vintage:     #4A7B8B;
  --atomic:      #E87040;
  --deep:        #4A4440;

  --serif: "Cormorant Garamond", Georgia, serif;
  --body:  "Source Serif 4", Georgia, serif;
  --mono:  "Fira Code", "Source Code Pro", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.8;
  color: var(--charcoal);
  background: var(--warm-gray);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Paper noise (vintage texture)
   ============================================================ */
.paper-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 17% 23%, rgba(74,68,64,0.05) 0 1px, transparent 2px),
    radial-gradient(circle at 73% 61%, rgba(74,68,64,0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 41% 87%, rgba(74,68,64,0.05) 0 1px, transparent 2px),
    radial-gradient(circle at 89% 11%, rgba(74,68,64,0.03) 0 1px, transparent 2px),
    radial-gradient(circle at 9% 71%, rgba(74,68,64,0.04) 0 1px, transparent 2px);
  background-size: 220px 220px, 180px 180px, 260px 260px, 200px 200px, 240px 240px;
  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* ============================================================
   THE MANIFEST — hero
   ============================================================ */
.manifest {
  position: relative;
  min-height: 100vh;
  padding: clamp(48px, 8vh, 112px) clamp(24px, 6vw, 96px);
  background: linear-gradient(180deg, #ECE5D8 0%, #E8E0D4 60%, #DFD7C8 100%);
  overflow: hidden;
}

.hex-float {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.manifest.is-ready .hex-float { opacity: 1; transform: translateY(0); }

.hex-float--a { top: 8%;  left: 6%;   width: 240px; height: 240px; transition-delay: 150ms; animation: float 18s ease-in-out infinite; }
.hex-float--b { top: 14%; right: 9%;  width: 180px; height: 180px; transition-delay: 300ms; animation: float 22s ease-in-out -4s infinite reverse; }
.hex-float--c { bottom: 12%; left: 14%; width: 130px; height: 130px; transition-delay: 450ms; animation: float 16s ease-in-out -2s infinite; }
.hex-float--d { bottom: 18%; right: 18%; width: 90px;  height: 90px;  transition-delay: 600ms; animation: float 20s ease-in-out -6s infinite reverse; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(8px, -14px) rotate(2deg); }
}

/* mixed-media collage */
.collage {
  position: absolute;
  background: var(--paper);
  border: 1px solid rgba(74,68,64,0.18);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    2px 2px 0 rgba(74,68,64,0.08),
    8px 10px 24px rgba(74,68,64,0.10);
  padding: 14px 16px;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 1s ease 600ms, transform 1s cubic-bezier(.2,.8,.2,1) 600ms;
}
.manifest.is-ready .collage { opacity: 1; transform: translateX(0); }

.collage--code {
  top: 22%;
  left: 4%;
  transform: translateX(-30px) rotate(-4deg);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--vintage);
  max-width: 220px;
}
.manifest.is-ready .collage--code { transform: translateX(0) rotate(-4deg); }
.collage--code pre { white-space: pre; line-height: 1.55; }

.collage--diagram {
  bottom: 16%;
  right: 6%;
  transform: translateX(30px) rotate(3deg);
  width: 140px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-delay: 800ms;
}
.manifest.is-ready .collage--diagram { transform: translateX(0) rotate(3deg); }
.collage--diagram svg { width: 100%; height: 100%; }

.manifest__inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 8vh auto 0;
  text-align: center;
}

.manifest__date {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vintage);
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease 300ms, transform 0.8s ease 300ms;
}
.manifest.is-ready .manifest__date { opacity: 1; transform: translateY(0); }

.manifest__wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(64px, 12vw, 168px);
  line-height: 0.96;
  color: var(--charcoal);
  letter-spacing: 0.02em;
  margin: 8px 0 18px;
}
.manifest__wordmark span {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(.2,.8,.2,1), transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.manifest.is-ready .manifest__wordmark span { opacity: 1; transform: translateY(0); }
.manifest__wordmark span:nth-child(1) { transition-delay: 600ms; }
.manifest__wordmark span:nth-child(2) { transition-delay: 660ms; }
.manifest__wordmark span:nth-child(3) { transition-delay: 720ms; }
.manifest__wordmark span:nth-child(4) { transition-delay: 780ms; }
.manifest__wordmark span:nth-child(5) { transition-delay: 840ms; color: var(--atomic); }
.manifest__wordmark span:nth-child(6) { transition-delay: 900ms; }
.manifest__wordmark span:nth-child(7) { transition-delay: 960ms; }
.manifest__wordmark span:nth-child(8) { transition-delay: 1020ms; }

.manifest__wordmark .dot { transform-origin: 50% 100%; }
.manifest.is-ready .manifest__wordmark .dot { animation: pulseDot 4s ease-in-out 1.4s infinite; }

@keyframes pulseDot {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-3px) scale(1.08); }
}

.manifest__tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--deep);
  margin-bottom: 28px;
  opacity: 0;
  transition: opacity 0.8s ease 1100ms;
}
.manifest.is-ready .manifest__tag { opacity: 1; }

.manifest__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease 1300ms;
}
.manifest.is-ready .manifest__meta { opacity: 1; }

.meta-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,0.04);
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.8s ease 1500ms;
}
.manifest.is-ready .scroll-cue { opacity: 0.7; }
.scroll-cue svg { width: 18px; height: 18px; animation: nudge 2.2s ease-in-out infinite; }

@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ============================================================
   SECTION HEAD
   ============================================================ */
.section-head {
  max-width: 920px;
  margin: 0 auto clamp(36px, 6vh, 72px);
  text-align: center;
  position: relative;
}
.section-head--alt { text-align: left; padding-left: clamp(24px, 4vw, 64px); }

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  color: var(--charcoal);
  margin-bottom: 18px;
  letter-spacing: -0.005em;
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.7vw, 21px);
  color: var(--deep);
  max-width: 640px;
  margin: 0 auto;
}

/* atomic border (decorative) */
.atomic-border {
  width: 200px;
  height: 14px;
  margin: 0 auto 22px;
  background:
    radial-gradient(circle at 10px 7px, var(--atomic) 0 3px, transparent 3.5px),
    linear-gradient(90deg, transparent 8px, var(--atomic) 8px 12px, transparent 12px) repeat-x;
  background-size: auto, 20px 100%;
  position: relative;
}
.atomic-border::before,
.atomic-border::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--atomic);
  transform: translateY(-50%) rotate(45deg);
}
.atomic-border::before { left: -16px; }
.atomic-border::after  { right: -16px; }

/* ============================================================
   COMPONENT HONEYCOMB
   ============================================================ */
.honeycomb {
  padding: clamp(72px, 12vh, 144px) clamp(24px, 6vw, 96px);
  background:
    linear-gradient(180deg, var(--warm-gray) 0%, #EFE8DA 100%);
  position: relative;
}

.honey-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 22px;
}

.hex-cell {
  position: relative;
  aspect-ratio: 1 / 1.06;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.hex-cell.is-in {
  opacity: 1;
  transform: translateY(0);
}

.hex-cell--offset { transform: translateY(18px) translateX(0); }
@media (min-width: 720px) {
  .hex-cell--offset[style*="--col:1"] { grid-column: 1 / span 1; margin-left: 16.6%; }
  .hex-cell--offset[style*="--col:2"] { grid-column: 2 / span 1; margin-left: 16.6%; }
  /* keep row 2 tighter — only two cells */
}

.hex-cell__shape {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--paper);
  border: 1px solid rgba(13,148,136,0.0);
  padding: clamp(20px, 3vw, 32px) clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  transition: background 0.4s ease, transform 0.4s cubic-bezier(.2,.8,.2,1);
  box-shadow: inset 0 0 0 1px rgba(13,148,136,0.35);
}

/* hexagon outline drawn before fill — progressive disclosure */
.hex-cell__shape::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,148,136,0.06), rgba(13,148,136,0));
  opacity: 0;
  transition: opacity 0.5s ease 0.2s;
}
.hex-cell.is-in .hex-cell__shape::before { opacity: 1; }

.hex-cell:hover .hex-cell__shape {
  background: #FAF5EB;
  transform: scale(1.025);
}

.hex-cell__id {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--atomic);
  margin-bottom: 8px;
}

.hex-cell h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(18px, 1.9vw, 24px);
  color: var(--charcoal);
  margin-bottom: 8px;
}

.hex-cell p {
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.55;
  color: var(--deep);
  margin-bottom: 10px;
}

.hex-cell code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--teal);
  background: rgba(13,148,136,0.08);
  padding: 3px 8px;
  border-radius: 0;
  display: inline-block;
}

/* selected (clicked) cell — amber highlight */
.hex-cell.is-active .hex-cell__shape {
  background: #FCEFD8;
  box-shadow: inset 0 0 0 2px var(--amber);
}
.hex-cell.is-active .hex-cell__id { color: var(--amber); }

/* ============================================================
   DEPENDENCY CHAIN — surreal recession
   ============================================================ */
.chain {
  padding: clamp(80px, 14vh, 168px) clamp(24px, 6vw, 96px);
  background:
    linear-gradient(180deg, #EFE8DA 0%, #E5DCCC 100%);
  position: relative;
  overflow: hidden;
}

.chain__stage {
  max-width: 1100px;
  margin: 0 auto;
  perspective: 800px;
  perspective-origin: 50% 38%;
  position: relative;
  height: 460px;
}

.chain__hex {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 220px;
  margin: -110px 0 0 -100px;
  background: var(--paper);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1.5px var(--teal);
  transform:
    translate3d(0, 0, calc(var(--depth) * -120px))
    translateX(calc(var(--depth) * -60px))
    translateY(calc(var(--depth) * 18px));
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1), filter 0.4s ease;
  z-index: calc(10 - var(--depth));
  filter: saturate(calc(1 - var(--depth) * 0.12)) brightness(calc(1 - var(--depth) * 0.04));
  opacity: calc(1 - var(--depth) * 0.08);
}

.chain__hex::before {
  content: "";
  position: absolute;
  inset: 8px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  border: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(13,148,136,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.chain__hex .chain__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--charcoal);
}
.chain__hex .chain__ver {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--vintage);
  margin-top: 4px;
}

.chain__hex:hover {
  filter: saturate(1.2) brightness(1.05);
  z-index: 20;
  transform:
    translate3d(0, 0, calc(var(--depth) * -120px + 40px))
    translateX(calc(var(--depth) * -60px))
    translateY(calc(var(--depth) * 18px - 8px));
}

.chain__note {
  max-width: 520px;
  margin: 32px auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--deep);
  text-align: center;
  border-top: 1px solid rgba(74,68,64,0.18);
  padding-top: 18px;
}

/* ============================================================
   TUTORIAL
   ============================================================ */
.tutorial {
  padding: clamp(72px, 12vh, 144px) clamp(24px, 6vw, 96px);
  background: linear-gradient(180deg, #E5DCCC 0%, #E8E0D4 100%);
}

.tutorial__steps {
  list-style: none;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  counter-reset: tut;
}

.tutorial__steps li {
  position: relative;
  background: var(--paper);
  padding: 28px 32px 28px 76px;
  border-left: 3px solid var(--teal);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 8px 24px rgba(74,68,64,0.06);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.tutorial__steps li.is-in { opacity: 1; transform: translateY(0); }

.step-no {
  position: absolute;
  top: 22px;
  left: 24px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 28px;
  color: var(--atomic);
  letter-spacing: 0.02em;
}

.tutorial__steps h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.tutorial__steps p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--deep);
}
.tutorial__steps code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--teal);
  background: rgba(13,148,136,0.08);
  padding: 1px 6px;
}

/* ============================================================
   ARCHIVE FOOTER
   ============================================================ */
.archive {
  background: var(--deep);
  color: var(--paper);
  padding: clamp(64px, 10vh, 112px) clamp(24px, 6vw, 96px) 28px;
  position: relative;
  overflow: hidden;
}

.archive::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 18px;
  background:
    radial-gradient(circle at 10px 9px, var(--teal) 0 3px, transparent 3.5px) repeat-x;
  background-size: 20px 100%;
  opacity: 0.65;
}

.archive__row {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  padding-top: 24px;
}

.archive__kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.archive__col h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--paper);
  margin-bottom: 24px;
}

.archive__list { list-style: none; }
.archive__list li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(245,240,232,0.12);
  font-family: var(--serif);
  font-size: 17px;
}
.archive__list li:last-child { border-bottom: 0; }
.archive__list time {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(245,240,232,0.6);
}
.hexdot {
  width: 12px;
  height: 12px;
  background: var(--teal);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.archive__col--mono p {
  font-family: var(--serif);
  font-size: 16px;
  color: rgba(245,240,232,0.8);
  margin-bottom: 22px;
}
.archive__col--mono em {
  font-style: italic;
  color: var(--paper);
  border-bottom: 1px dotted rgba(245,240,232,0.4);
}

.archive__atoms {
  display: flex;
  gap: 18px;
  align-items: center;
}
.archive__atoms .atom {
  width: 44px;
  height: 44px;
  opacity: 0.85;
}
.archive__atoms .atom:nth-child(1) { animation: spin 28s linear infinite; }
.archive__atoms .atom:nth-child(2) { animation: spin 36s linear -10s infinite reverse; }
.archive__atoms .atom:nth-child(3) { animation: pulse 4s ease-in-out infinite; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 0.85; }
  50%      { transform: scale(1.1); opacity: 1; }
}

.archive__base {
  max-width: 1100px;
  margin: 56px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(245,240,232,0.14);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.55);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .honey-grid { grid-template-columns: repeat(2, 1fr); }
  .hex-cell--offset[style*="--col:1"],
  .hex-cell--offset[style*="--col:2"] { margin-left: 0; }
  .tutorial__steps { grid-template-columns: 1fr; }
  .archive__row { grid-template-columns: 1fr; gap: 36px; }
  .chain__stage { height: 360px; }
  .chain__hex { width: 150px; height: 165px; margin: -82px 0 0 -75px; }
  .chain__hex .chain__name { font-size: 17px; }
  .archive__base { flex-direction: column; gap: 8px; }
  .collage--code { display: none; }
}

@media (max-width: 540px) {
  .honey-grid { grid-template-columns: 1fr; }
  .manifest__wordmark { font-size: 56px; }
  .hex-float--a, .hex-float--b { display: none; }
}
