/* Abisso — field note pages. A horizontal logbook: you scroll down, the page travels sideways.
   On phones it falls back to a normal vertical article. */

.nnav { position: fixed; inset: 0 0 auto 0; z-index: 20; isolation: isolate; display: flex; align-items: center; justify-content: space-between; padding: 28px var(--pad); font-size: 14px; color: #fff; }
.nnav .logo { font-size: 17px; }
.nnav__close { display: inline-flex; align-items: center; gap: 10px; opacity: .8; transition: opacity .3s; }
.nnav__close:hover { opacity: 1; }

/* the track */
.log { height: var(--track, 400vh); }
.log__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.log__track { display: flex; height: 100%; will-change: transform; }
.panel { flex: none; height: 100%; position: relative; display: flex; align-items: center; }

/* 1 cover */
.panel--cover { width: 100vw; }
.cover__img { position: absolute; left: 0; top: 0; bottom: 0; width: 62vw; margin: 0; }
.cover__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover__text { position: absolute; left: calc(62vw + 4vw); right: var(--pad); bottom: 14vh; }
.cover__meta { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.6; }
.cover__title { margin-top: 18px; font-weight: 400; font-size: clamp(36px, 3.6vw, 60px); line-height: 1.02; letter-spacing: -0.025em; }
.cover__hint { margin-top: 36px; font-size: 13px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 12px; }
.cover__hint i { width: 40px; height: 1px; background: currentColor; display: block; animation: hint 2.4s var(--expo) infinite; transform-origin: 0 50%; }
@keyframes hint { 0% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); opacity: 0; } }

/* 2 text in columns, like a logbook page */
.panel--text { padding: 0 6vw; }
.cols { columns: 300px; column-gap: 48px; column-fill: auto; height: 46vh; width: max-content; max-width: none; font-weight: 300; font-size: 17px; line-height: 1.6; color: rgba(255,255,255,.86); }
.cols p + p { margin-top: 1em; }
.cols p:first-child::first-line { color: #fff; }
.panel--text .cols { width: calc(300px * var(--n, 2) + 48px * (var(--n, 2) - 1)); }

/* 3 quote */
.panel--quote { width: 70vw; padding: 0 6vw; }
.quote { font-weight: 300; font-size: clamp(36px, 4.4vw, 76px); line-height: 1.08; letter-spacing: -0.02em; }
.quote cite { display: block; margin-top: 24px; font-style: normal; font-size: 14px; color: rgba(255,255,255,.55); letter-spacing: 0; }

/* 4 image */
.panel--img { padding: 0 4vw; }
.panel--img figure { margin: 0; position: relative; height: 72vh; aspect-ratio: 2000 / 1493; }
.panel--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel--img canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.panel--img .is-gl img { visibility: hidden; }
.panel--img figcaption { position: absolute; top: calc(100% + 14px); left: 0; font-size: 13px; color: rgba(255,255,255,.6); }

/* 5 data strip */
.panel--facts { padding: 0 6vw; }
.facts { display: grid; grid-template-rows: repeat(3, auto); gap: 28px; border-left: 1px solid rgba(255,255,255,.18); padding-left: 32px; }
.facts b { display: block; font-weight: 300; font-size: clamp(40px, 4vw, 64px); letter-spacing: -0.02em; line-height: 1; }
.facts span { font-size: 13px; color: rgba(255,255,255,.55); }

/* 6 next */
.panel--next { width: 100vw; }
.next { position: absolute; inset: 0; display: block; color: #fff; }
.next__img { position: absolute; right: 0; top: 0; bottom: 0; width: 56vw; margin: 0; overflow: hidden; }
.next__img img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.001); transition: transform 1.6s var(--expo), filter 1.6s var(--expo); filter: brightness(.7); }
.next:hover .next__img img { filter: brightness(.95); }
.next__text { position: absolute; left: 6vw; bottom: 14vh; max-width: 30vw; }
.next__kicker { font-size: 13px; color: rgba(255,255,255,.55); }
.next__title { margin-top: 14px; font-weight: 400; font-size: clamp(32px, 3.2vw, 54px); line-height: 1.04; letter-spacing: -0.02em; }
.next__pull { margin-top: 30px; display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgba(255,255,255,.7); }
.next__pull canvas { width: 120px; height: 14px; display: block; }
.next__go { margin-top: 28px; font-size: 14px; display: inline-block; padding-bottom: 6px; position: relative; }
.next__go::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3 Q4 0.5 8 3 T16 3' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") 0 50% / 16px 6px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3 Q4 0.5 8 3 T16 3' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") 0 50% / 16px 6px repeat-x;
  animation: nav-wave 1.6s linear infinite; }

/* progress: the same wave, drawn as far as you have read */
.progress { position: fixed; left: var(--pad); right: var(--pad); bottom: 22px; height: 14px; z-index: 20; pointer-events: none; }
.progress canvas { width: 100%; height: 100%; display: block; }

/* phones: a normal vertical article */
@media (max-width: 760px) {
  .log { height: auto !important; }
  .log__stage { position: static; height: auto; overflow: visible; }
  .log__track { display: block; transform: none !important; }
  .panel { width: auto !important; height: auto; display: block; padding: 0 var(--pad) 10vh; }
  .panel--cover { padding: 0; }
  .cover__img { position: relative; width: 100%; height: 62vh; }
  .cover__text { position: static; padding: 28px var(--pad) 8vh; }
  .cols, .panel--text .cols { columns: auto; height: auto; width: auto; }
  .panel--quote { width: auto; }
  .panel--img figure { height: auto; width: 100%; }
  .panel--img figcaption { position: static; margin-top: 12px; }
  .panel--next { height: 90vh; padding: 0; }
  .next__img { width: 100%; }
  .next__text { left: var(--pad); right: var(--pad); max-width: none; z-index: 1; }
  .progress { display: none; }
  .cover__hint { display: none; }
}

/* living water edge drawn over images on the side facing the text */
/* a few px of overscan so no sliver of the image peeks out at the edge while the track moves */
.edge { position: absolute; left: -3px; top: -2px; width: calc(100% + 6px); height: calc(100% + 4px); display: block; pointer-events: none; z-index: 2; }
.panel--img figure { position: relative; }

/* the next note leans in as you pull */
.next__img img { transform: scale(calc(1.001 + var(--pull, 0) * .06)); transition: filter 1.6s var(--expo); filter: brightness(calc(.7 + var(--pull, 0) * .3)); }
.next__text { transform: translateX(calc(var(--pull, 0) * -24px)); }

/* close: the word and a thin X */
.nnav__close { gap: 12px; }
.x { position: relative; width: 14px; height: 14px; display: block; transition: transform .6s var(--expo); }
.x::before, .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 1.2px; background: currentColor; }
.x::before { transform: translate(-50%, -50%) rotate(45deg); }
.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.nnav__close:hover .x { transform: rotate(90deg); }
