* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #e8f4f8; /* the "sky" behind the water */
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #0b3954;
}

/* The chart fills the whole screen, behind the header */
#chart {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

header {
  position: relative; /* sits above the SVG */
  z-index: 1;
  text-align: center;
  padding-top: 24px;
}

h1 {
  margin: 0;
  font-size: 2.5rem;
  letter-spacing: 0.05em;
}

header p {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

#time {
  font-size: 1.6rem;
  font-weight: bold;
}

/* ---------- Arrow buttons ---------- */

.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2; /* above the header and chart */
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: #0b3954;
  font-size: 2.2rem;
  line-height: 1;
  padding: 0 0 4px; /* nudges the arrow glyph to the visual center */
  cursor: pointer;
}

#prev {
  left: 16px;
}

#next {
  right: 16px;
}

/* ---------- Today button ---------- */

.today-btn {
  margin-top: 10px;
  padding: 6px 18px;
  border: 2px solid #0b3954;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #0b3954;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  visibility: hidden; /* hidden (but still taking up space) while viewing today */
}

.today-btn.visible {
  visibility: visible;
}

/* ---------- Water ---------- */

/* Starts below the screen, so the water rises into place on page load.
   JS sets the real level; this transition makes it glide there. */
#water {
  transform: translateY(100vh);
  transition: transform 1.5s ease-in-out;
}

.wave {
  animation: wave-drift linear infinite;
}

.wave-back {
  fill: rgba(30, 136, 229, 0.35);
  animation-duration: 11s;
  animation-direction: reverse; /* drifts the opposite way from the front wave */
}

.wave-front {
  fill: rgba(30, 136, 229, 0.5);
  animation-duration: 7s;
}

/* Each wave slides left by exactly one wavelength, then repeats seamlessly.
   --wave-length is set per wave in script.js. */
@keyframes wave-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(var(--wave-length) * -1));
  }
}

/* Respect people who've turned off motion in their system settings */
@media (prefers-reduced-motion: reduce) {
  .wave {
    animation: none;
  }
  #water {
    transition: none;
  }
}