/* monopole.studio - Particle Physics Sketchbook */
/* Colors: #3B2D3D (Deep Plum), #2E2A33 (Darkest), #3B3640 (Dark), #4A3F50 (Muted Plum), #8B7B96 (Lavender), #6B8FAD (Steel Blue), #B89F65 (Gold), #C24B7A (Rose), #E8B4C8 (Light Pink), #F2EDE4 (Warm Parchment) */
/* Fonts: Cormorant Garamond 700, Caveat 400, Space Grotesk 400 */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Caveat', cursive;
  background-color: #F2EDE4;
  color: #3B2D3D;
  overflow-x: hidden;
}

/* Compass - fixed top right */
#compass {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#compass:hover {
  transform: scale(1.1);
}

#compass svg {
  filter: drop-shadow(0 2px 4px rgba(59, 45, 61, 0.2));
}

#compass-needle {
  transform-origin: 30px 30px;
  animation: compass-seek 8s ease-in-out infinite;
}

@keyframes compass-seek {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(8deg); }
  100% { transform: rotate(0deg); }
}

/* Table of Contents */
#toc {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 99;
  background: rgba(242, 237, 228, 0.95);
  border: 1.5px solid #8B7B96;
  border-radius: 4px;
  padding: 16px 24px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 2px 3px 12px rgba(59, 45, 61, 0.15);
}

#toc.toc-hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

#toc.toc-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

#toc ul {
  list-style: none;
}

#toc li {
  margin-bottom: 8px;
}

#toc a {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: #3B2D3D;
  text-decoration: none;
  transition: color 0.3s ease;
}

#toc a:hover {
  color: #C24B7A;
}

/* Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Notebook Page Sections */
.notebook-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.notebook-page[data-bg='light'] {
  background-color: #F2EDE4;
}

.notebook-page[data-bg='dark'] {
  background-color: #2E2A33;
}

/* Page Content */
.page-content {
  position: relative;
  flex: 1;
  display: flex;
  padding: 80px 60px 60px 100px;
  max-width: 1200px;
}

/* Red margin line */
.margin-line {
  position: absolute;
  left: 80px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #C24B7A;
  opacity: 0.3;
}

.margin-line-dark {
  background-color: #C24B7A;
  opacity: 0.2;
}

/* Text Area - left aligned like notebook */
.text-area {
  padding-left: 30px;
  max-width: 700px;
}

/* Section Numbers */
.section-number {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: #8B7B96;
  display: block;
  margin-bottom: 8px;
}

.section-number-light {
  color: #8B7B96;
}

/* Display Headings */
.display-heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: #3B2D3D;
  margin-bottom: 32px;
}

.heading-light {
  color: #F2EDE4;
}

/* Body Text - Caveat handwriting */
.body-text {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.65;
  color: #4A3F50;
  margin-bottom: 24px;
  max-width: 600px;
}

.body-text-light {
  color: #E8B4C8;
}

/* Annotation style */
.annotation {
  color: #B89F65;
  font-style: italic;
  padding-left: 20px;
  border-left: 2px solid #B89F65;
}

.annotation-light {
  color: #B89F65;
  border-left-color: #B89F65;
}

/* Page Edge - notebook torn edge effect */
.page-edge {
  height: 8px;
  background: linear-gradient(to right,
    #F2EDE4 0%, #D5CCC0 20%, #F2EDE4 40%, #D5CCC0 60%, #F2EDE4 80%, #e5daca 100%
  );
  box-shadow: 0 2px 8px rgba(59, 45, 61, 0.1);
}

.page-edge-dark {
  background: linear-gradient(to right,
    #2E2A33 0%, #3B3640 20%, #2E2A33 40%, #3B3640 60%, #2E2A33 80%, #3B3640 100%
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Sketches / SVG illustrations */
.sketch {
  margin: 32px 0;
  max-width: 500px;
}

.hand-drawn-svg {
  width: 100%;
  height: auto;
}

/* Wobbly line animation */
.wobbly {
  animation: wobble 4s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(0.5px, -0.5px); }
  50% { transform: translate(-0.5px, 0.5px); }
  75% { transform: translate(0.5px, 0.3px); }
}

/* Pulse circle for monopole */
.pulse-circle {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; stroke-width: 2.5; }
  50% { opacity: 0.7; stroke-width: 3.5; }
}

/* Field lines animation */
.field-line {
  animation: field-glow 2s ease-in-out infinite;
}

@keyframes field-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Equation Block */
.equation-block {
  margin: 32px 0;
  padding: 20px 24px;
  background: rgba(184, 159, 101, 0.1);
  border: 1px dashed #B89F65;
  border-radius: 4px;
  max-width: 400px;
}

.equation {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  color: #C24B7A;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.equation-note {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: #8B7B96;
}

/* Timeline */
.timeline {
  margin: 32px 0;
  padding-left: 20px;
  border-left: 2px solid #8B7B96;
}

.timeline-entry {
  margin-bottom: 20px;
  padding-left: 20px;
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-entry.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C24B7A;
  border: 2px solid #F2EDE4;
}

.timeline-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: #B89F65;
  display: block;
  margin-bottom: 4px;
}

.timeline-text {
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: #4A3F50;
  line-height: 1.5;
}

/* Evidence Grid */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin: 32px 0;
  max-width: 650px;
}

.evidence-card {
  padding: 20px;
  border: 1px solid #4A3F50;
  border-radius: 6px;
  background: rgba(74, 63, 80, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.evidence-card:hover {
  transform: translateY(-4px);
  border-color: #C24B7A;
}

.card-icon {
  margin-bottom: 12px;
}

.card-text {
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #E8B4C8;
}

/* Monopole passing animation */
.monopole-passing {
  animation: monopole-fall 4s ease-in-out infinite;
}

@keyframes monopole-fall {
  0% { transform: translateY(-80px); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(120px); opacity: 0; }
}

/* Studio Footer */
.studio-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #8B7B96;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 300px;
}

.footer-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #3B2D3D;
}

.footer-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: #8B7B96;
}

/* Section reveal animations */
.notebook-page .text-area > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.notebook-page.in-view .text-area > * {
  opacity: 1;
  transform: translateY(0);
}

.notebook-page.in-view .text-area > *:nth-child(1) { transition-delay: 0.1s; }
.notebook-page.in-view .text-area > *:nth-child(2) { transition-delay: 0.2s; }
.notebook-page.in-view .text-area > *:nth-child(3) { transition-delay: 0.3s; }
.notebook-page.in-view .text-area > *:nth-child(4) { transition-delay: 0.4s; }
.notebook-page.in-view .text-area > *:nth-child(5) { transition-delay: 0.5s; }
.notebook-page.in-view .text-area > *:nth-child(6) { transition-delay: 0.6s; }
.notebook-page.in-view .text-area > *:nth-child(7) { transition-delay: 0.7s; }
.notebook-page.in-view .text-area > *:nth-child(8) { transition-delay: 0.8s; }

/* Notebook ruled lines background */
.notebook-page[data-bg='light']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 38px,
    rgba(139, 123, 150, 0.08) 38px,
    rgba(139, 123, 150, 0.08) 39px
  );
  pointer-events: none;
  z-index: 0;
}

.notebook-page[data-bg='dark']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 38px,
    rgba(139, 123, 150, 0.05) 38px,
    rgba(139, 123, 150, 0.05) 39px
  );
  pointer-events: none;
  z-index: 0;
}

.page-content {
  position: relative;
  z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .page-content {
    padding: 60px 20px 40px 60px;
  }

  .margin-line {
    left: 40px;
  }

  .text-area {
    padding-left: 15px;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .sketch {
    max-width: 100%;
  }

  #compass {
    top: 16px;
    right: 16px;
  }

  #toc {
    top: 80px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: 48px 16px 32px 48px;
  }

  .margin-line {
    left: 30px;
  }
}
