/*
 * Maldives dive trip · "The Descent"
 * Scrolling the page is a dive: surface (hero) → clocks → photos → the bottom at 30 m.
 * The atmosphere (rays, bubbles, creatures, depth gauge) lives in ocean.css.
 */

:root {
  --lagoon: #3fd1cf;
  --shallow: #1597a8;
  --mid: #0b5f86;
  --deep: #06335a;
  --abyss: #021426;
  --foam: #effcfb;
  --foam-dim: rgb(239 252 251 / 0.72);
  --glow: #7ef9ee;
  --xdc-red: #ec1e24;

  --glass: linear-gradient(155deg, rgb(8 52 86 / 0.62), rgb(2 20 38 / 0.55));
  --glass-edge: rgb(126 249 238 / 0.16);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", Roboto, Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 5vw, 56px);
  --wrap: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--abyss);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--abyss);
  color: var(--foam);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 6px; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ---------- 0 m · Surface ---------- */

.surface {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.surface__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 40%;
}

.surface__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(110% 60% at 50% 45%, rgb(2 20 38 / 0.4), transparent 72%),
    linear-gradient(180deg,
      rgb(2 20 38 / 0.6) 0%,
      rgb(2 20 38 / 0.12) 30%,
      rgb(2 20 38 / 0.08) 58%,
      rgb(21 151 168 / 0.55) 86%,
      var(--shallow) 100%);
}

/* The waterline where the photo meets the water column. */
.surface::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lagoon) 30%, var(--lagoon) 70%, transparent);
  opacity: 0.55;
}

.surface__content {
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 60rem;
  padding: calc(48px + env(safe-area-inset-top)) var(--gutter) 128px;
  text-align: center;
}

.surface__badge {
  width: clamp(96px, 12vw, 120px);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgb(239 252 251 / 0.14), 0 14px 44px rgb(2 20 38 / 0.6);
}

.eyebrow {
  font: 600 0.74rem/1.5 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 14px rgb(2 20 38 / 0.9);
  text-wrap: balance;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, min(13vw, 17vh), 8.5rem);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-shadow: 0 6px 40px rgb(2 20 38 / 0.55);
  text-wrap: balance;
}

.headline em {
  display: block;
  font-weight: 400;
  color: var(--glow);
}

.subline {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 500;
  text-shadow: 0 1px 14px rgb(2 20 38 / 0.9);
}

.scroll-hint {
  position: absolute;
  inset: auto 0 calc(24px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-inline: auto;
  padding: 10px 18px;
  border: 1px solid rgb(239 252 251 / 0.24);
  border-radius: 999px;
  background: rgb(2 20 38 / 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 600 0.7rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.scroll-hint__arrow {
  display: inline-block;
  animation: hint-bob 2.2s ease-in-out infinite;
}

.reveal {
  animation: rise-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- The water column ---------- */

.ocean {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background: linear-gradient(180deg, var(--shallow) 0%, var(--mid) 10%, var(--deep) 38%, var(--abyss) 80%);
}

.section-title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 4rem);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title em {
  font-weight: 400;
  color: var(--glow);
}

/* ---------- 5 m · The two clocks ---------- */

.clocks {
  position: relative;
  padding: clamp(80px, 12vw, 140px) 0 clamp(64px, 10vw, 120px);
}

.lede {
  max-width: 34ch;
  margin-top: 14px;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  text-shadow: 0 1px 14px rgb(2 20 38 / 0.5);
}

.clocks__grid {
  display: grid;
  gap: clamp(14px, 2.5vw, 24px);
  margin-top: clamp(28px, 5vw, 48px);
}

@media (min-width: 768px) {
  .clocks__grid { grid-template-columns: 1fr 1fr; }
}

.clock {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(18px, 3.5vw, 30px);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: 0 30px 60px -32px rgb(0 0 0 / 0.7), inset 0 1px 0 rgb(239 252 251 / 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.clock__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.clock__title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.6vw, 1.85rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}

.clock__place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 0.72rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--foam-dim);
}

.clock__led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--xdc-red);
  box-shadow: 0 0 8px var(--xdc-red);
  animation: led 2s ease-in-out infinite;
}

@keyframes led {
  50% { opacity: 0.35; }
}

.clock__digits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 4px 12px;
  border: 1px solid rgb(126 249 238 / 0.08);
  border-radius: 14px;
  background: rgb(2 20 38 / 0.45);
}

.unit__num {
  font-family: var(--font-mono);
  font-size: clamp(1.9rem, 9vw, 3.3rem);
  font-size: clamp(1.8rem, 13cqi, 4rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--glow);
  text-shadow: 0 0 22px rgb(126 249 238 / 0.35);
}

.unit__label {
  font: 600 0.66rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--foam-dim);
}

.clock__done {
  padding: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-size: clamp(1.7rem, 9cqi, 2.6rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  color: var(--glow);
  text-shadow: 0 0 24px rgb(126 249 238 / 0.3);
}

.clock__moment {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
}

.clock__yours {
  margin-top: -8px;
  font-size: 0.88rem;
  color: var(--foam-dim);
}

/* Flight line: BEY ----✈---- MLE */

.flight { margin-top: clamp(28px, 5vw, 44px); }

.flight__route {
  display: flex;
  align-items: center;
  gap: 14px;
}

.flight__code {
  font: 600 0.9rem/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.flight__track {
  position: relative;
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgb(239 252 251 / 0.4) 0 6px, transparent 6px 12px);
}

.flight__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--glow);
  box-shadow: 0 0 12px rgb(126 249 238 / 0.6);
}

.flight__plane {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  fill: var(--xdc-red);
  filter: drop-shadow(0 0 8px rgb(236 30 36 / 0.6));
  transform: translate(-50%, -50%);
}

.flight__caption {
  margin-top: 12px;
  text-align: center;
  font: 500 0.76rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--foam-dim);
}

/* ---------- 15 m · What's waiting down there ---------- */

.waiting {
  position: relative;
  padding: clamp(56px, 9vw, 110px) 0 clamp(96px, 14vw, 170px);
}

.cards {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  margin: clamp(28px, 5vw, 48px) 0 -32px;
  padding: 0 var(--gutter) 32px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.cards::-webkit-scrollbar { display: none; }

/* Keeps the right-hand gutter when the row is scrolled to the end. */
.cards::after {
  content: "";
  flex: 0 0 1px;
}

.card {
  position: relative;
  flex: 0 0 min(78%, 320px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--deep);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);
  scroll-snap-align: start;
  isolation: isolate;
}

.card__img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card__text {
  position: absolute;
  inset: auto 0 0;
  padding: 56px 18px 18px;
  background: linear-gradient(180deg, transparent, rgb(2 20 38 / 0.9) 55%);
}

.card__index {
  display: block;
  margin-bottom: 8px;
  font: 600 0.7rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--glow);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.1;
}

.card__caption {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--foam-dim);
}

@media (min-width: 900px) {
  .cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(100% - 2 * var(--gutter), var(--wrap));
    margin-inline: auto;
    padding: 0 0 32px;
    overflow: visible;
  }
  .cards::after { content: none; }
  .card:nth-child(even) { margin-top: 56px; }
  .card:hover .card__img { transform: scale(1.05); }
}

/* ---------- 30 m · The bottom ---------- */

.bottom {
  position: relative;
  padding: clamp(170px, 24vw, 280px) 0 calc(56px + env(safe-area-inset-bottom));
  text-align: center;
}

.bottom__line {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 5rem);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bottom__line em {
  font-weight: 400;
  color: var(--glow);
}

.bottom__badge {
  display: inline-block;
  margin-top: 28px;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.bottom__badge img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(239 252 251 / 0.08), 0 10px 30px rgb(0 0 0 / 0.5);
}

.bottom__badge:hover { transform: rotate(-8deg) scale(1.06); }

.credits {
  max-width: 62ch;
  margin: 28px auto 0;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--foam-dim);
}

.credits a {
  text-decoration-color: rgb(239 252 251 / 0.35);
  text-underline-offset: 2px;
}

.credits a:hover { color: var(--foam); }

.made {
  margin-top: 14px;
  font: 600 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(239 252 251 / 0.5);
}

/* ---------- Preview banner (?now=) ---------- */

.preview-banner {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: #c81a1f; /* XDC red, darkened so white text passes contrast */
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  color: #fff;
  font: 600 0.72rem/1.35 var(--font-mono);
  text-align: center;
  transform: translateX(-50%);
}

.preview-banner a {
  color: inherit;
  text-underline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
