@font-face {
  font-family: 'Njal';
  src: url('font/NjalBold.woff2') format('woff2'),
       url('font/NjalBold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  margin: 0;
  padding: 0;
}

body.noscroll {
  overflow: hidden;
  height: 100vh;
}

main {
  width: 100%;
}

#intro-slides {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#intro-grid {
  display: grid;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  justify-content: center;
  align-content: center;
}

.co2-dot {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background-color: #d9d9d9;
  transition: background-color 300ms, transform 300ms, box-shadow 300ms;
}

.co2-dot.trapped {
  background-color: #8ecae6;
}

.co2-dot.co2-single {
  background-color: #d00000;
  box-shadow: 0 0 0 2px white, 0 0 12px rgba(0,0,0,0.3);
  opacity: 1 !important;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  transition: opacity 0.6s ease;
  z-index: 20;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide h1 {
  font-size: 4.5rem;
  margin-bottom: 1rem;
}

.slide h2 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.slide h3 {
  font-size: 2rem;
}

.slide p {
  font-size: 2rem;
}

.arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 2rem;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #023047;
  color: white;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.arrow-btn:hover {
  opacity: 1;
}

#left-arrow {
  left: 2%;
}

#right-arrow {
  right: 2%;
}

#post-intro,
#write-up,
#post-chart,
#post-depth,
#post-modern {
  max-width: 900px;
  margin: 0 auto;
  padding: 12vh 2rem 20vh;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#post-intro h1,
#write-up h1,
#post-chart h1,
#post-depth h1,
#post-modern h1 {
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

#post-intro p,
#write-up p,
#post-chart p,
#post-depth p,
#post-modern p {
  font-size: 1.3rem;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

.wrapper {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #ffffff 5%, #cae9ff 50%, #ccdeff);
  position: absolute;
  z-index: -10;
}

.wrapper div {
  height: 30px;
  width: 30px;
  border: 2px solid #77c4fb;
  border-radius: 50px;
  position: absolute;
  animation: animate 4s linear infinite;
}

.bub {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #77c4fb;
  position: absolute;
  top: 20%;
  right: 20%;
}

.wrapper div:nth-child(1) {
  top: 5%;
  left: 20%;
  animation-duration: 8s;
}

.wrapper div:nth-child(2) {
  top: 15%;
  left: 30%;
  animation-duration: 4s;
}

.wrapper div:nth-child(3) {
  top: 60%;
  left: 4%;
  animation-duration: 5s;
}

.wrapper div:nth-child(4) {
  top: 32%;
  left: 24%;
  animation-duration: 6s;
}

.wrapper div:nth-child(5) {
  top: 37%;
  left: 5%;
  animation-duration: 7s;
}

.wrapper div:nth-child(6) {
  top: 84%;
  left: 30%;
  animation-duration: 3s;
}

.wrapper div:nth-child(7) {
  top: 46%;
  left: 32%;
  animation-duration: 5s;
}

.wrapper div:nth-child(8) {
  top: 55%;
  left: 8%;
  animation-duration: 4s;
}

.wrapper div:nth-child(9) {
  top: 24%;
  left: 2%;
  animation-duration: 3s;
}

.wrapper div:nth-child(10) {
  top: 82%;
  left: 2%;
  animation-duration: 7s;
}

.wrapper div:nth-child(11) {
  top: 76%;
  left: 22%;
  animation-duration: 6s;
}

.wrapper div:nth-child(12) {
  top: 96%;
  left: 25%;
  animation-duration: 5s;
}

@keyframes animate {
  0% {
    transform: scale(0) translateY(0) rotate(70deg);
  }
  100% {
    transform: scale(1.3) translateY(-100px) rotate(360deg);
  }
}

#scrolly {
  position: relative;
  display: flex;
  width: 100vw;
  margin: 10vh auto 0 auto;
}

#scrolly-text {
  flex: 0 0 40%;
  max-width: 40%;
  padding: 2rem;
  box-sizing: border-box;
}

#scrolly-text p,
#scrolly-text a {
  font-size: 1.4rem;
  line-height: 1.5;
}

.step {
  margin: 0 0 60vh 0;
  padding: 20px;
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.5);
}

.step.is-active {
  opacity: 1;
  border-left: 4px solid #444;
}

#scrolly-graphic {
  position: sticky;
  top: 0;
  flex: 0 0 60%;
  max-width: 60%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#chart {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
}

#floating-co2-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d00000;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: top 0.6s ease-out, left 0.6s ease-out, opacity 0.5s ease;
  top: var(--start-top);
  left: var(--start-left);
  transform: translate(-50%, -50%);
}

@keyframes co2Bounce {
  0% {
    transform: translate(-50%, -50%) translateY(0);
  }
  30% {
    transform: translate(-50%, -50%) translateY(-14px);
  }
  60% {
    transform: translate(-50%, -50%) translateY(0);
  }
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
}

.bounce-3 {
  animation: co2Bounce 0.5s ease-in-out 3;
}

.bounce-3b {
  animation: co2Bounce 0.6s ease-in-out 3;
}

#scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 1.2rem;
  color: #555;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  z-index: 40;
}

#scroll-hint.visible {
  opacity: 0.9;
  transform: translateX(-50%) translateY(0);
}

.scroll-hint-arrow {
  font-size: 1.5rem;
  animation: scrollArrowBounce 1.4s ease-in-out infinite;
}

@keyframes scrollArrowBounce {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(4px);
  }
  80% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

#depth-explorer {
  position: relative;
  width: 100%;
  padding: 8rem 0 6rem;
  background: radial-gradient(circle at top, #f7fbff 0%, #e8f1ff 40%, #dde9ff 100%);
  overflow: hidden;
}

.depth-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.depth-bubbles span {
  position: absolute;
  display: block;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  bottom: -100px;
  animation: bubbleRise 18s infinite ease-in;
}

.depth-bubbles span:nth-child(1) {
  left: 12%;
  animation-duration: 16s;
  width: 18px;
  height: 18px;
}

.depth-bubbles span:nth-child(2) {
  left: 25%;
  animation-duration: 22s;
  width: 26px;
  height: 26px;
}

.depth-bubbles span:nth-child(3) {
  left: 40%;
  animation-duration: 19s;
}

.depth-bubbles span:nth-child(4) {
  left: 55%;
  animation-duration: 24s;
  width: 30px;
  height: 30px;
}

.depth-bubbles span:nth-child(5) {
  left: 70%;
  animation-duration: 21s;
}

.depth-bubbles span:nth-child(6) {
  left: 82%;
  animation-duration: 17s;
  width: 16px;
  height: 16px;
}

.depth-bubbles span:nth-child(7) {
  left: 90%;
  animation-duration: 25s;
  width: 28px;
  height: 28px;
}

.depth-bubbles span:nth-child(8) {
  left: 33%;
  animation-duration: 20s;
  width: 20px;
  height: 20px;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.45;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-900px) scale(1.4);
    opacity: 0;
  }
}

#depth-explorer-container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

#depth-explorer-header h2 {
  font-size: 2.3rem;
  margin-bottom: 0.5rem;
}

#depth-explorer-header p {
  font-size: 1.2rem;
  color: #444;
  max-width: 700px;
  margin: 0.5rem auto 2rem auto;
  line-height: 1.6;
}

#depth-explorer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
  flex-wrap: nowrap;
}

#depth-explorer-controls label {
  font-size: 1.1rem;
  font-weight: 600;
}

#depth-slider {
  width: 340px;
  cursor: pointer;
}

#depth-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: #023047;
  border-radius: 3px;
}

#depth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 3px solid #023047;
  border-radius: 50%;
  margin-top: -6px;
  cursor: pointer;
}

#depth-slider::-moz-range-track {
  height: 6px;
  background: #023047;
  border-radius: 3px;
}

#depth-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 3px solid #023047;
  border-radius: 50%;
  cursor: pointer;
}

#core-select {
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #aaa;
  cursor: pointer;
  background: white;
}

#depth-chart-wrapper {
  position: relative;
  overflow: visible;   
  display: flex;
  justify-content: center;
  width: 100%;
  height: 420px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

#depth-svg {
  width: 95%;
  height: 100%;
}

.depth-line {
  fill: none;
  stroke: #1f77b4;
  stroke-width: 2.2px;
}

.depth-dot {
  fill: #d00000;
  stroke: white;
  stroke-width: 2px;
}

#selection-rect {
  pointer-events: none;
  z-index: 3;
}

#depth-readout {
  margin-top: 20px;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #333;
}

#depth-readout p {
  margin: 4px 0;
}

#selection-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0px;
  margin-bottom: 0px;
  gap: 0px;
}

#selection-stats {
  font-size: 1.05rem;
  line-height: 1.5;
  text-align: left;
  flex: 1;
  margin-top: 0;
  margin-bottom: 0;
}

#clear-selection {
  display: none;
  margin: 14px auto 0 auto;
  padding: 7px 14px;
  border-radius: 6px;
  background: #e63946;
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-top: 4px;
}

#clear-selection:hover {
  background: #c71f2d;
}

#depth-play-btn {
  padding: 6px 14px;
  background: #023047;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#depth-play-btn:hover {
  background: #03557a;
}

#depth-tooltip {
  position: absolute;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease-in-out;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  z-index: 10;
}

#slide-progress {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  z-index: 50;
}

#slide-progress-fill {
  width: 0%;
  height: 100%;
  background: #023047;
  transition: width 0.4s ease;
}

#slide-progress {
  opacity: 1;
  transition: opacity 0.5s ease;
}

#slide-progress.hidden {
  opacity: 0;
  pointer-events: none;
}

#drag-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  padding: 6px 10px;
  font-size: 0.85rem;
  color: white;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 10;
}

#modern-co2 {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 10vh 0 14vh;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #eaf4ff 45%,
    #e0efff 75%,
    #ffffff 100%
  );
}

#modern-co2 h1 {
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

#modern-co2 p {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 720px;
  margin: 0.5rem auto 0;
}

#modern-co2-layout {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
}

#modern-co2-viz {
  flex: 0 0 60%;
  min-width: 320px;
}

#modern-co2-readout {
  flex: 0 0 30%;
  min-width: 260px;
  text-align: left;
}

#modern-co2-main {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

#modern-co2-sub {
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
}

#modern-co2-play {
  margin-top: 1rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #7b1e4b;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#modern-co2-play:hover {
  background: #a22664;
}

.modern-axis path,
.modern-axis line {
  stroke: #444;
}

.modern-axis text {
  font-size: 0.8rem;
  fill: #444;
}

.modern-baseline {
  stroke: #59748f;
  stroke-dasharray: 4 4;
}

.modern-baseline-label {
  fill: #59748f;
  font-size: 0.8rem;
}

.modern-line {
  fill: none;
  stroke: #b01c3b;
  stroke-width: 2.4px;
}

.modern-highlight-dot {
  fill: #b01c3b;
  stroke: white;
  stroke-width: 2px;
}

#modern-co2 {
  position: relative;
  padding: 10vh 0 20vh;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #cae9ff 50%,
    #ccdeff 100%
  );
}

.modern-co2-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  z-index: 1;
}

#modern-co2 h1 {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
}

#modern-co2 > .modern-co2-inner > p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.6;
}

#modern-co2-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

#modern-co2-viz {
  flex: 0 1 700px;
}

#modern-co2-readout {
  flex: 0 1 350px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
}

#modern-co2-viz svg {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.modern-baseline {
  stroke: #7fb3ff;
  stroke-width: 1.5px;
  stroke-dasharray: 4 4;
}

.modern-baseline-label {
  fill: #24507a;
  font-size: 0.75rem;
}

#modern-co2-play {
  margin-top: 1.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: none;
  background: #8b1e4f;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s;
  box-shadow: 0 6px 14px rgba(139, 30, 79, 0.35);
}

#modern-co2-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(139, 30, 79, 0.4);
  background: #a3245e;
}

#modern-co2-play:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.modern-co2-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.modern-co2-bubbles span {
  height: 30px;
  width: 30px;
  border: 2px solid #77c4fb;
  border-radius: 50px;
  position: absolute;
  animation: animate 4s linear infinite;
}

.modern-co2-bubbles span:nth-child(1) {
  top: 5%;
  left: 20%;
  animation-duration: 8s;
}

.modern-co2-bubbles span:nth-child(2) {
  top: 15%;
  left: 30%;
  animation-duration: 4s;
}

.modern-co2-bubbles span:nth-child(3) {
  top: 60%;
  left: 4%;
  animation-duration: 5s;
}

.modern-co2-bubbles span:nth-child(4) {
  top: 32%;
  left: 24%;
  animation-duration: 6s;
}

.modern-co2-bubbles span:nth-child(5) {
  top: 37%;
  left: 5%;
  animation-duration: 7s;
}

.modern-co2-bubbles span:nth-child(6) {
  top: 84%;
  left: 30%;
  animation-duration: 3s;
}

.modern-co2-bubbles span:nth-child(7) {
  top: 46%;
  left: 32%;
  animation-duration: 5s;
}

.modern-co2-bubbles span:nth-child(8) {
  top: 55%;
  left: 8%;
  animation-duration: 4s;
}

@keyframes modernBubbleFloat {
  0% {
    transform: translateY(0) translateX(0) scale(0.9);
  }
  50% {
    transform: translateY(-45vh) translateX(10px) scale(1.05);
  }
  100% {
    transform: translateY(-90vh) translateX(-10px) scale(0.9);
  }
}

#modern-co2.playing .modern-co2-bubbles span {
  opacity: 0.7;
  animation-duration: 13s;
}
