/*
 * Deep Water landing, the deepest stretch — the pinned researchers sequence
 * where the lamp turns back on the reader, then price, the FAQ and the ascent.
 *
 * The researchers section is 520vh tall with a sticky viewport inside it: the
 * page keeps scrolling while the panel holds still and six cards are hauled in
 * along a rope, one per fifth of the section's travel. `--flare` (0 → 1) lifts
 * the ground from near-black to near-white; `--flare-progress` drives the
 * cards. Both are set by landing.js.
 */

.dw-flare {
  --flare-bg: rgb(
    calc(10 + 238 * var(--flare, 0)) calc(14 + 233 * var(--flare, 0)) calc(16 + 228 * var(--flare, 0))
  );
  --flare-line: var(--line);

  background: var(--flare-bg);
  color: var(--ink);
  height: 520vh;
  padding: 0 var(--edge) 0 var(--gutter);
  position: relative;
  transition:
    background-color 200ms linear,
    color 200ms linear;
  z-index: 3;
}

.dw-flare.is-lit {
  --flare-line: rgb(20 26 28 / 20%);

  color: #141a1c;
}

.dw-flare-pin {
  align-content: center;
  display: grid;
  height: calc(100vh - 60px);
  overflow: hidden;
  position: sticky;
  top: 60px;
}

.dw-flare-glow {
  background: radial-gradient(closest-side, rgb(255 255 255 / calc(55% * var(--flare, 0))), transparent 68%);
  height: 130vh;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 130vw;
}

.dw-flare-label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.26em;
  margin: 0 0 26px;
  position: relative;
  text-transform: uppercase;
}

.dw-flare h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.6vw, 76px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.96;
  margin: 0 0 44px;
  max-width: 20em;
  position: relative;
}

.dw-flare.is-lit .dw-flare-label {
  color: rgb(20 26 28 / 60%);
}

.dw-flare-stage {
  align-items: start;
  display: grid;
  gap: 40px;
  grid-template-columns: 120px minmax(0, 1fr);
  position: relative;
}

/* The rope the cards are hauled in on. */
.dw-rope {
  height: 320px;
  position: relative;
}

.dw-rope svg {
  animation: dw-rope 13s ease-in-out infinite;
  inset: 0;
  overflow: visible;
  position: absolute;
  width: 100%;
}

.dw-rope path {
  stroke: var(--flare-line);
  stroke-width: 1.3;
}

@keyframes dw-rope {
  0%,
  100% {
    transform: translate3d(-5px, 0, 0) skewX(1.2deg);
  }

  50% {
    transform: translate3d(6px, 0, 0) skewX(-1.4deg);
  }
}

.dw-knot {
  background: rgb(160 180 190 / 28%);
  border-radius: 50%;
  height: 9px;
  left: -1px;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: background-color 300ms ease;
  width: 9px;
}

.dw-knot:nth-of-type(1) {
  top: 8%;
}

.dw-knot:nth-of-type(2) {
  top: 23%;
}

.dw-knot:nth-of-type(3) {
  top: 38%;
}

.dw-knot:nth-of-type(4) {
  top: 53%;
}

.dw-knot:nth-of-type(5) {
  top: 68%;
}

.dw-knot:nth-of-type(6) {
  top: 83%;
}

.dw-flare.is-lit .dw-knot {
  background: rgb(20 26 28 / 22%);
}

.dw-knot.is-live {
  background: var(--accent);
}

.dw-cards {
  min-height: 320px;
  position: relative;
}

.dw-card {
  align-content: start;
  background: var(--flare-bg);
  border: 1px solid var(--flare-line);
  box-shadow: 0 16px 38px rgb(4 10 14 / calc(38% * var(--shadow, 1)));
  display: grid;
  gap: 14px;
  left: 0;
  opacity: var(--op, 0);
  padding: 30px 34px 34px;
  position: absolute;
  top: 0;
  transform: translate3d(var(--tx, 0), var(--ty, 150px), 0) scale(var(--scale, 0.95));
  transition:
    opacity 200ms linear,
    transform 420ms var(--ease),
    box-shadow 300ms ease;
  width: min(52vw, 620px);
  z-index: var(--z, 10);
}

.dw-card-head {
  color: var(--accent);
  display: flex;
  font-size: 9px;
  gap: 14px;
  justify-content: space-between;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.dw-card-head span {
  color: var(--faint);
}

.dw-flare.is-lit .dw-card-head span {
  color: rgb(20 26 28 / 60%);
}

.dw-card-body {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.01em;
  line-height: 1.12;
}

@media (width <= 900px) {
  .dw-flare {
    height: auto;
    padding-block: 120px;
  }

  .dw-flare-pin {
    height: auto;
    overflow: visible;
    position: static;
  }

  .dw-flare-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .dw-rope {
    display: none;
  }

  .dw-cards {
    display: grid;
    gap: 12px;
    min-height: 0;
  }

  /* No pinned scroll on a phone: the cards simply stack, all of them visible. */
  .dw-card {
    opacity: 1;
    position: static;
    transform: none;
    width: auto;
  }
}

/* ========================= what one report costs ========================= */

.dw-price-table {
  border-top: 1px solid var(--line);
  display: grid;
  max-width: 1100px;
}

.dw-price-row {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(100px, 150px) minmax(0, 1fr) minmax(90px, 130px) minmax(110px, 165px) 100px;
  padding: 22px 0;
}

.dw-price-name {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 26px;
}

.dw-price-note {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.dw-price-fig {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.dw-price-sum {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 26px;
  text-align: right;
}

.dw-price-foot {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.8;
  margin: 26px 0 0;
  max-width: 34em;
}

@media (width <= 900px) {
  .dw-price-row {
    gap: 6px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dw-price-note,
  .dw-price-fig {
    grid-column: 1 / -1;
  }
}

/* ========================= faq ========================= */

.dw-faq {
  max-width: 1100px;
}

.dw-faq-item {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 80px minmax(0, 1fr);
  padding: 28px 0;
}

.dw-faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.dw-faq-no {
  color: var(--faint-2);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.dw-faq-item h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  margin: 0 0 12px;
}

.dw-faq-item p {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.85;
  margin: 0;
  max-width: 660px;
}

@media (width <= 900px) {
  .dw-faq-item {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========================= back up ========================= */

.dw-ascent {
  overflow: hidden;
  padding: 150px var(--edge) 120px var(--gutter);
  position: relative;
  z-index: 2;
}

.dw-ascent-plate,
.dw-ascent-warm {
  inset: 0;
  position: absolute;
}

.dw-ascent-plate {
  background: linear-gradient(0deg, #17262b 0%, #0f1a1e 46%, var(--ground) 100%);
}

.dw-ascent-warm {
  background: radial-gradient(70% 60% at 40% 110%, rgb(var(--accent-rgb) / 16%), transparent 70%);
}

.dw-ascent-body {
  max-width: 1100px;
  position: relative;
}

.dw-ascent h2 {
  font-size: clamp(46px, 8vw, 144px);
  letter-spacing: -0.02em;
  line-height: 0.9;
  margin: 0 0 26px;
}

.dw-ascent-lead {
  color: var(--body);
  margin: 0 0 40px;
  max-width: 26em;
}

.dw-ascent-close {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.dw-footer {
  align-items: baseline;
  border-top: 1px solid rgb(160 180 190 / 14%);
  color: var(--faint-2);
  display: flex;
  flex-wrap: wrap;
  font-size: 9px;
  gap: 12px 20px;
  justify-content: space-between;
  letter-spacing: 0.18em;
  padding: 22px var(--edge) 22px var(--gutter);
  position: relative;
  text-transform: uppercase;
  z-index: 2;
}

.dw-footer a {
  color: var(--faint-2);
}

.dw-footer a:hover {
  color: #c6ced2;
}

.dw-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
