/* Add font-face declaration for Big Caslon */
@font-face {
  font-family: "Big Caslon";
  src: url("../assets/fonts/big-caslon-regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --color-base: #f2efe9;
  --color-base-darker: #e1d6c2;
  --color-purple: #6822ff;
  --color-orange: #c37500;
  --color-teal: #1ec6c0;
  --color-yellow: #bfbf1d;
  --color-pink: #be00d7;
}

.andale {
  font-family: "Andale Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* HERO STYLES ////////////////////////////////////////////// */
.hero-ladder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3em;
  z-index: 1;
}

.ladder-step {
  font-family: "Big Caslon";
  font-size: 50px;
  font-style: normal;
  font-weight: 100;
  line-height: 30px;
  margin-left: 0;
  color: #000;
  text-align: center;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease-out;
}

/* Step-ladder effect: each step indented more */
.ladder-step:nth-child(1) {
  margin-left: 0em;
}
.ladder-step:nth-child(2) {
  margin-left: 1em;
}
.ladder-step:nth-child(3) {
  margin-left: 4.5em;
}
.ladder-step:nth-child(4) {
  margin-left: 6em;
}
.ladder-step:nth-child(5) {
  margin-left: 8.5em;
}

.body.bottom-left {
  bottom: 2rem;
  left: 2rem;
  z-index: 1001;
}

/* Cursor Trail Effect Styles */
.cursor-parent {
  height: 100vh;
  width: 100vw;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999;
}

.fake-cursor {
  background-size: cover;
  background-position: center;
  position: fixed;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.05s ease-out;
}

/* ///////////////////////////////////////////////////////// */

/* New text classes */
.title {
  font-family: "Libre Caslon Display", serif;
  font-size: 50px;
  font-weight: 100;
  color: #000;
  position: absolute;
}

.body {
  font-family: "Andale Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-weight: 400;
  font-size: 14px;
  color: #000;
  position: absolute;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Hero Section */
#hero {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--color-base);
  background-image: url("../assets/textures/paper-texture.jpg");
  background-blend-mode: overlay;
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

#background-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#physics-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.top-left {
  top: 2rem;
  left: 2rem;
}

.top-right {
  top: 2rem;
  right: 2rem;
  max-width: 300px;
  text-align: right;
  line-height: 1.4;
}

.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.body a {
  color: #000;
  text-decoration: underline;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.body a:hover {
  color: var(--color-purple);
}

.tooltip {
  position: absolute;
  border-radius: 5px;
  padding: 10px 15px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
  max-width: 250px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);

  background: url(../assets/textures/paper-texture.jpg) lightgray 50% / cover
      no-repeat,
    radial-gradient(
      151.92% 127.02% at 15.32% 21.04%,
      rgba(225, 214, 194, 0.1) 0%,
      rgba(225, 214, 194, 0.02) 77.08%,
      rgba(225, 214, 194, 0) 100%
    );
  backdrop-filter: blur(40px);
}

.tooltip strong {
  display: block;

  font-family: "Big Caslon";
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 22px;
}

.tooltip span {
  font-family: "Andale Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.annotation {
  color: #000;
  font-family: "Andale Mono";
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 27px; /* 168.75% */
  text-transform: uppercase;
  opacity: 0.9;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f3f1ed;
}

#intro {
  max-width: 40rem;
  /* margin: 2rem auto; */
  padding: 0 1rem;
}

.intro__hed {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.intro__dek {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

#scrolly {
  position: relative;
  display: flex;

  padding: 0rem;
  min-height: 100vh;
  margin-left: 0rem;
}

#scrolly > * {
  flex: 1;
}

article {
  position: relative;
  padding: 1rem 1rem 0 1rem;
  max-width: 20rem;
  z-index: 1001;
  min-height: 200vh;
}

figure {
  position: sticky;
  width: 100%;
  height: calc(100vh - 2rem);
  top: 1rem;
  margin: 0;
  transform: translate3d(0, 0, 0);
  z-index: 0;
  /* pointer-events: none; */
}

figure.fullwidth {
  position: fixed;
  width: 100vw;
  left: 0;
  right: 0;
  z-index: 0;
  /* pointer-events: none; */
}

figure p {
  text-align: center;
  padding: 1rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  font-weight: 900;
  color: #fff;
}

.step {
  margin: 0 auto;
  display: inline-flex;
  padding: 32px;
  justify-content: flex-start;
  align-items: center;
  border-radius: 2px;
  border: 1px solid #0000006a;
  width: 24rem; /* Added width to make step slightly wider */
  background: url(../assets/paper.eps) lightgray 0% 0% / 154.22531366348267px
      154.22531366348267px repeat,
    radial-gradient(
      151.92% 127.02% at 15.32% 21.04%,
      rgba(246, 244, 238, 0.75) 0%,
      rgba(246, 244, 238, 0.75) 77.08%,
      rgba(245, 243, 237, 0.75) 100%
    );
  background-blend-mode: overlay, normal;
  backdrop-filter: blur(40px);
  color: #333;
  /* Remove vertical positioning that pushed steps down */
  /* position: relative; */
  /* top: 50%; */
  opacity: 0.5;
}

.step:last-child {
  margin-bottom: 0;
}

.step.fade {
  opacity: 0;
}

.step p {
  text-align: left;
  color: #000;
  font-family: "Libre Caslon Display", serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: 25px;
}

/* Common styling for statement and header steps */
.step.statement,
.step.header {
  border: none;
  width: 100vw;
  height: 100vh;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Big Caslon", serif;
  font-weight: 800;
  box-sizing: border-box;
  margin-left: -1rem;
  background: url(../assets/textures/paper-texture.jpg) rgb(164, 28, 28) 0% 0% /
      154.22531366348267px 154.22531366348267px repeat,
    radial-gradient(
      151.92% 127.02% at 15.32% 21.04%,
      rgba(246, 244, 238, 0.95) 0%,
      rgba(246, 244, 238, 0.95) 77.08%,
      rgba(245, 243, 237, 0.95) 100%
    );
  background-blend-mode: overlay, normal;
  backdrop-filter: blur(20px);
  opacity: 0.95;
}

/* Common styling for statement and header paragraphs */
.step.statement p,
.step.header p {
  line-height: 1.2;
  text-align: center;
  max-width: 80%;
  margin: 0 auto;
  padding: 0 6rem;
  font-family: "Big Caslon", serif;
  color: #000;
}

.step.statement p {
  font-size: 50px;
}

/* Specific styling for header paragraphs */
.step.header p {
  font-size: 50px;
}

.step.emphasis-step {
  opacity: 0.9;
  background-color: var(--color-base);
  background-image: radial-gradient(
      circle at 30% 30%,
      var(--color-teal),
      transparent 70%
    ),
    radial-gradient(circle at 70% 70%, var(--color-orange), transparent 80%),
    radial-gradient(circle at 20% 60%, var(--color-teal), transparent 60%),
    radial-gradient(circle at 80% 20%, var(--color-base), transparent 50%);
  background-size: 200% 200%;
  position: relative;
  animation: moveGradient 15s ease infinite;
}

.step.emphasis-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
  opacity: 1;
  pointer-events: none;
}

.step.emphasis-step p {
  color: #000;
  position: relative;
  z-index: 2;
}

@keyframes moveGradient {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 50% 25%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 75%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Shuffle effect animation */
@keyframes shufflePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.shuffle-effect {
  animation: shufflePulse 0.5s ease-in-out;
}

.hover-line-group {
  pointer-events: none;
}

.hover-capture-rect {
  pointer-events: all;
  fill: transparent;
}

.hover-image {
  pointer-events: none;
}

/* Ensure hotspots don't interfere with hover except in specific steps */
.hotspot {
  pointer-events: none;
}

/* Allow pointer events on pulsing hotspots */
.hotspot-pulse {
  pointer-events: all !important;
}

/* More specific selector for images to not interfere with hover area */
#chapter-2 image:not(.hover-image):not(#smiles-image) {
  pointer-events: none;
}

/* Ensure smiles-image and its connector maintain interaction */
#smiles-image,
#smiles-connector {
  pointer-events: all;
}

/* Specific step-related images should maintain pointer events */
[id$="-image"][id^="smiles"] {
  pointer-events: all !important;
}

.year-label-group {
  pointer-events: none;
  z-index: 1000;
  background: black;
}

.year-label-group text {
  fill: black;
  dominant-baseline: middle;
  z-index: 1001;
  text-shadow: 2px 2px 10px rgba(242, 239, 233, 0.9);
}

.year-label-group text:first-child {
  font-family: "Big Caslon";
  font-size: 22px;
  font-style: normal;
  font-weight: 500;
  line-height: 22px;
  margin-bottom: 8px; /* Add space below first text */
}

.year-label-group text:last-child {
  font-family: "Andale Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.2;
}

.hover-image-group {
  z-index: 900;
}

/* .chapter-1 {
  background-image: url("../assets/textures/paper-texture.jpg");
  background-blend-mode: overlay;
  opacity: 0.9;
} */
