/* graphers.net - Dark Academia Data Visualization */
/* Colors: #0d0b08, #1e1812, #2d2720, #5a524a, #b8b0a4, #e8e0d4, #00ffa8, #00c9ff, #ffb800 */
/* Fonts: Bodoni Moda (display), Space Mono (body), Inter (labels) */

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

:root{
  --dark-void:#0d0b08;
  --dark-mahogany:#1e1812;
  --mahogany:#2d2720;
  --warm-gray:#5a524a;
  --muted-parchment:#b8b0a4;
  --aged-vellum:#e8e0d4;
  --neon-green:#00ffa8;
  --neon-cyan:#00c9ff;
  --neon-amber:#ffb800;
  --dark-panel:#1a1510;
  --deep-mahogany:#3d3527;
}

html{scroll-behavior:smooth}

body{
  background:var(--dark-void);
  color:var(--muted-parchment);
  font-family:'Space Mono',monospace;
  font-size:16px;
  line-height:1.6;
  overflow-x:hidden;
}

/* ===== CHAPTER HERO ===== */
.chapter-hero{
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:var(--dark-void);
}

.chapter-bg-curves{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.hero-curve{
  position:absolute;
  width:100%;
  height:60%;
  top:20%;
  left:0;
}

.hero-curve path{
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-dasharray:2000;
  stroke-dashoffset:2000;
}

.hero-curve-1 path{
  stroke:var(--neon-green);
  filter:drop-shadow(0 0 6px rgba(0,255,168,0.6));
  animation:drawCurve 3s ease-out 0.3s forwards;
}
.hero-curve-2 path{
  stroke:var(--neon-cyan);
  filter:drop-shadow(0 0 6px rgba(0,201,255,0.4));
  stroke-width:1.5;
  animation:drawCurve 3.5s ease-out 0.8s forwards;
}
.hero-curve-3 path{
  stroke:var(--neon-amber);
  filter:drop-shadow(0 0 4px rgba(255,184,0,0.3));
  stroke-width:1;
  opacity:0.5;
  animation:drawCurve 4s ease-out 1.2s forwards;
}

@keyframes drawCurve{
  to{stroke-dashoffset:0}
}

.chapter-content{
  position:relative;
  z-index:2;
  text-align:center;
  padding:2rem;
}

.chapter-number{
  display:block;
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(80px,20vw,200px);
  color:var(--aged-vellum);
  line-height:0.9;
  letter-spacing:-0.04em;
  opacity:0;
  animation:fadeInUp 1s ease-out 0.5s forwards;
  text-shadow:0 0 40px rgba(232,224,212,0.1);
}

.chapter-title{
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(36px,6vw,96px);
  color:var(--aged-vellum);
  line-height:0.95;
  letter-spacing:-0.04em;
  margin-top:0.2em;
  opacity:0;
  animation:fadeInUp 1s ease-out 0.8s forwards;
}

.chapter-subtitle{
  font-family:'Space Mono',monospace;
  font-size:clamp(13px,1.4vw,18px);
  color:var(--muted-parchment);
  margin-top:1.5em;
  line-height:1.8;
  opacity:0;
  animation:fadeInUp 1s ease-out 1.2s forwards;
}

@keyframes fadeInUp{
  from{opacity:0;transform:translateY(30px)}
  to{opacity:1;transform:translateY(0)}
}

.scroll-indicator{
  position:absolute;
  bottom:3rem;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0.8rem;
  opacity:0;
  animation:fadeInUp 1s ease-out 2s forwards;
}

.scroll-text{
  font-family:'Inter',sans-serif;
  font-size:11px;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.2em;
  color:var(--warm-gray);
}

.scroll-line{
  width:1px;
  height:40px;
  background:linear-gradient(to bottom,var(--neon-green),transparent);
  animation:scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse{
  0%,100%{opacity:0.3;transform:scaleY(0.6)}
  50%{opacity:1;transform:scaleY(1)}
}

/* ===== CHAPTER HEADERS ===== */
.chapter-header{
  max-width:900px;
  margin:0 auto 4rem;
  text-align:center;
  padding:0 2rem;
}

.chapter-number-small{
  display:block;
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(48px,10vw,120px);
  color:var(--aged-vellum);
  line-height:0.9;
  letter-spacing:-0.04em;
  opacity:0.15;
  margin-bottom:0.2em;
}

.section-title{
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(28px,4vw,56px);
  color:var(--aged-vellum);
  line-height:1;
  letter-spacing:-0.03em;
  margin-bottom:0.5em;
}

.section-desc{
  font-family:'Space Mono',monospace;
  font-size:clamp(12px,1.2vw,15px);
  color:var(--warm-gray);
  line-height:1.8;
  max-width:600px;
  margin:0 auto;
}

/* ===== MASONRY GRID ===== */
.chapter-masonry-section,
.chapter-specimens{
  padding:8rem 2rem;
  background:var(--dark-void);
}

.masonry-grid{
  columns:3;
  column-gap:1.5rem;
  max-width:1200px;
  margin:0 auto;
}

.masonry-card{
  break-inside:avoid;
  background:var(--dark-mahogany);
  border-radius:8px;
  padding:2rem;
  margin-bottom:1.5rem;
  position:relative;
  overflow:hidden;
  border:1px solid rgba(90,82,74,0.2);
  box-shadow:inset 0 1px 0 rgba(232,224,212,0.03),0 4px 20px rgba(0,0,0,0.3);
  transition:transform 0.4s ease,box-shadow 0.4s ease,border-color 0.4s ease;
  opacity:0;
  transform:translateY(20px);
}

.masonry-card.revealed{
  opacity:1;
  transform:translateY(0);
  transition:opacity 0.6s ease,transform 0.6s ease;
}

.masonry-card:hover{
  transform:translateY(-4px);
  box-shadow:inset 0 1px 0 rgba(232,224,212,0.05),0 8px 30px rgba(0,0,0,0.4),0 0 20px rgba(0,255,168,0.05);
  border-color:rgba(0,255,168,0.15);
}

.card-label{
  display:inline-block;
  font-family:'Inter',sans-serif;
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.15em;
  color:var(--neon-green);
  margin-bottom:0.5rem;
  padding:3px 8px;
  background:rgba(0,255,168,0.08);
  border-radius:3px;
}

.card-heading{
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(20px,2.5vw,28px);
  color:var(--aged-vellum);
  line-height:1.1;
  letter-spacing:-0.02em;
  margin-bottom:0.6em;
}

.card-text{
  font-family:'Space Mono',monospace;
  font-size:13px;
  color:var(--muted-parchment);
  line-height:1.7;
  opacity:0.85;
}

/* Card curves */
.card-curve{
  width:100%;
  height:auto;
  margin-bottom:1.5rem;
}

.card-curve path{
  fill:none;
  stroke:var(--neon-green);
  stroke-width:2;
  stroke-linecap:round;
  filter:drop-shadow(0 0 6px rgba(0,255,168,0.6));
  stroke-dasharray:800;
  stroke-dashoffset:800;
  transition:stroke-dashoffset 2s ease-out;
}

.masonry-card.revealed .card-curve path{
  stroke-dashoffset:0;
}

/* Multi-curve card */
.card-curve-multi .curve-line-1{
  fill:none;stroke:var(--neon-green);stroke-width:2;
  filter:drop-shadow(0 0 6px rgba(0,255,168,0.6));
  stroke-dasharray:800;stroke-dashoffset:800;
  transition:stroke-dashoffset 2s ease-out;
}
.card-curve-multi .curve-line-2{
  fill:none;stroke:var(--neon-cyan);stroke-width:1.5;
  filter:drop-shadow(0 0 4px rgba(0,201,255,0.4));
  stroke-dasharray:800;stroke-dashoffset:800;
  transition:stroke-dashoffset 2.5s ease-out;
}
.card-curve-multi .curve-line-3{
  fill:none;stroke:var(--neon-amber);stroke-width:1;opacity:0.7;
  filter:drop-shadow(0 0 4px rgba(255,184,0,0.3));
  stroke-dasharray:800;stroke-dashoffset:800;
  transition:stroke-dashoffset 3s ease-out;
}

.masonry-card.revealed .card-curve-multi .curve-line-1,
.masonry-card.revealed .card-curve-multi .curve-line-2,
.masonry-card.revealed .card-curve-multi .curve-line-3{
  stroke-dashoffset:0;
}

/* Bar chart */
.card-data-viz{
  margin-bottom:1.5rem;
}

.bar-group{
  display:flex;
  align-items:flex-end;
  gap:6px;
  height:120px;
}

.bar{
  flex:1;
  height:var(--bar-height);
  background:linear-gradient(to top,var(--neon-green),var(--neon-cyan));
  border-radius:3px 3px 0 0;
  opacity:0.8;
  transform:scaleY(0);
  transform-origin:bottom;
  transition:transform 0.8s cubic-bezier(0.34,1.56,0.64,1);
}

.masonry-card.revealed .bar{
  transform:scaleY(1);
}
.masonry-card.revealed .bar:nth-child(1){transition-delay:0.1s}
.masonry-card.revealed .bar:nth-child(2){transition-delay:0.2s}
.masonry-card.revealed .bar:nth-child(3){transition-delay:0.3s}
.masonry-card.revealed .bar:nth-child(4){transition-delay:0.4s}
.masonry-card.revealed .bar:nth-child(5){transition-delay:0.5s}
.masonry-card.revealed .bar:nth-child(6){transition-delay:0.6s}
.masonry-card.revealed .bar:nth-child(7){transition-delay:0.7s}

/* Number card */
.card-number-display{
  text-align:center;
  margin-bottom:1rem;
}

.big-number{
  display:block;
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:clamp(48px,8vw,72px);
  color:var(--neon-green);
  line-height:1;
  letter-spacing:-0.04em;
  text-shadow:0 0 30px rgba(0,255,168,0.3);
}

.number-unit{
  display:block;
  font-family:'Inter',sans-serif;
  font-size:11px;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.15em;
  color:var(--warm-gray);
  margin-top:0.3em;
}

/* Quote card */
.card-quote{
  background:#3d3527;
  border-left:3px solid var(--neon-amber);
}

.card-blockquote{
  font-family:'Bodoni Moda',serif;
  font-weight:400;
  font-style:italic;
  font-size:clamp(18px,2.2vw,24px);
  color:var(--aged-vellum);
  line-height:1.4;
  margin-bottom:1rem;
}

.card-cite{
  font-family:'Space Mono',monospace;
  font-size:12px;
  color:var(--warm-gray);
  font-style:normal;
}

/* ===== METHODOLOGY SECTION ===== */
.chapter-methodology{
  padding:8rem 2rem;
  background:linear-gradient(180deg,var(--dark-void) 0%,var(--dark-mahogany) 50%,var(--dark-void) 100%);
}

.methodology-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:2rem;
  max-width:1100px;
  margin:0 auto;
}

.method-card{
  background:rgba(29,24,18,0.6);
  border:1px solid rgba(90,82,74,0.15);
  border-radius:8px;
  padding:2.5rem 2rem;
  text-align:center;
  transition:transform 0.4s ease,border-color 0.4s ease;
  opacity:0;
  transform:translateY(20px);
}

.method-card.revealed{
  opacity:1;
  transform:translateY(0);
  transition:opacity 0.6s ease,transform 0.6s ease;
}

.method-card:hover{
  transform:translateY(-6px);
  border-color:rgba(0,255,168,0.2);
}

.method-icon{
  width:64px;
  height:64px;
  margin:0 auto 1.5rem;
}

.method-icon svg{
  width:100%;
  height:100%;
}

.method-title{
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:22px;
  color:var(--aged-vellum);
  letter-spacing:-0.02em;
  margin-bottom:0.6em;
}

.method-desc{
  font-family:'Space Mono',monospace;
  font-size:12px;
  color:var(--muted-parchment);
  line-height:1.7;
  opacity:0.8;
}

/* ===== SPECIMENS SECTION (Chapter IV) ===== */
.masonry-grid-2{
  columns:3;
  column-gap:1.5rem;
  max-width:1200px;
  margin:0 auto;
}

.card-wide{
  column-span:all;
  margin-bottom:1.5rem;
}

.specimen-graph{
  width:100%;
  height:auto;
  margin-bottom:1rem;
}

.specimen-line{
  stroke-dasharray:1500;
  stroke-dashoffset:1500;
  transition:stroke-dashoffset 3s ease-out;
}

.masonry-card.revealed .specimen-line{
  stroke-dashoffset:0;
}

.specimen-info{
  padding-top:0.5rem;
}

/* Scatter plot */
.scatter-plot{
  position:relative;
  height:180px;
  margin-bottom:1.5rem;
  background:
    repeating-linear-gradient(90deg,rgba(90,82,74,0.1) 0px,rgba(90,82,74,0.1) 1px,transparent 1px,transparent 20%),
    repeating-linear-gradient(0deg,rgba(90,82,74,0.1) 0px,rgba(90,82,74,0.1) 1px,transparent 1px,transparent 20%);
}

.scatter-dot{
  position:absolute;
  left:var(--x);
  top:var(--y);
  width:8px;
  height:8px;
  background:var(--neon-cyan);
  border-radius:50%;
  filter:drop-shadow(0 0 4px rgba(0,201,255,0.6));
  opacity:0;
  transform:scale(0);
  transition:opacity 0.4s ease,transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.masonry-card.revealed .scatter-dot{opacity:1;transform:scale(1)}
.masonry-card.revealed .scatter-dot:nth-child(1){transition-delay:0.1s}
.masonry-card.revealed .scatter-dot:nth-child(2){transition-delay:0.15s}
.masonry-card.revealed .scatter-dot:nth-child(3){transition-delay:0.2s}
.masonry-card.revealed .scatter-dot:nth-child(4){transition-delay:0.25s}
.masonry-card.revealed .scatter-dot:nth-child(5){transition-delay:0.3s}
.masonry-card.revealed .scatter-dot:nth-child(6){transition-delay:0.35s}
.masonry-card.revealed .scatter-dot:nth-child(7){transition-delay:0.4s}
.masonry-card.revealed .scatter-dot:nth-child(8){transition-delay:0.45s}
.masonry-card.revealed .scatter-dot:nth-child(9){transition-delay:0.5s}
.masonry-card.revealed .scatter-dot:nth-child(10){transition-delay:0.55s}
.masonry-card.revealed .scatter-dot:nth-child(11){transition-delay:0.6s}
.masonry-card.revealed .scatter-dot:nth-child(12){transition-delay:0.65s}
.masonry-card.revealed .scatter-dot:nth-child(13){transition-delay:0.7s}
.masonry-card.revealed .scatter-dot:nth-child(14){transition-delay:0.75s}

/* Pie chart */
.pie-chart{
  width:140px;
  height:140px;
  margin:0 auto 1.5rem;
}

.pie-chart svg{
  width:100%;
  height:100%;
}

.pie-legend{
  margin-top:1rem;
}

.legend-item{
  display:flex;
  align-items:center;
  gap:8px;
  font-family:'Inter',sans-serif;
  font-size:11px;
  color:var(--muted-parchment);
  margin-bottom:0.4em;
}

.legend-swatch{
  width:10px;
  height:10px;
  border-radius:2px;
  flex-shrink:0;
}

/* ===== FINAL CHAPTER ===== */
.chapter-final{
  position:relative;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:var(--dark-void);
  padding:4rem 2rem;
}

.final-curves{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0.3;
}

.final-curve{
  position:absolute;
  width:100%;
  height:50%;
  top:25%;
}

.final-curve path{
  fill:none;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-dasharray:2000;
  stroke-dashoffset:2000;
  transition:stroke-dashoffset 4s ease-out;
}

.final-curve-1 path{
  stroke:var(--neon-green);
  filter:drop-shadow(0 0 8px rgba(0,255,168,0.4));
}

.final-curve-2 path{
  stroke:var(--neon-cyan);
  filter:drop-shadow(0 0 6px rgba(0,201,255,0.3));
}

.chapter-final.in-view .final-curve path{
  stroke-dashoffset:0;
}

.final-content{
  text-align:center;
  position:relative;
  z-index:2;
}

.final-title{
  margin-bottom:1em;
}

.final-oath{
  font-family:'Space Mono',monospace;
  font-size:clamp(13px,1.4vw,17px);
  color:var(--muted-parchment);
  line-height:2;
  max-width:700px;
  margin:0 auto 3rem;
}

.final-mark{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0.5rem;
  margin-top:3rem;
}

.guild-symbol{
  font-size:48px;
  color:var(--neon-green);
  filter:drop-shadow(0 0 12px rgba(0,255,168,0.4));
}

.guild-name{
  font-family:'Bodoni Moda',serif;
  font-weight:900;
  font-size:24px;
  color:var(--aged-vellum);
  letter-spacing:0.1em;
}

.guild-year{
  font-family:'Inter',sans-serif;
  font-size:11px;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:0.2em;
  color:var(--warm-gray);
}

/* ===== RESPONSIVE ===== */
@media(max-width:1024px){
  .masonry-grid,.masonry-grid-2{columns:2}
  .methodology-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:640px){
  .masonry-grid,.masonry-grid-2{columns:1}
  .methodology-grid{grid-template-columns:1fr}
  .card-wide{column-span:none}
}
