/* pnw.ad home: the painted first screen, the clock, the journey west to east, onward links. */

/* ---------- the first screen ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  max-height: 1180px;
  overflow: hidden;
  background: #1b2a44;
  color: var(--snow);
  isolation: isolate;
}
.art,
.art .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.art .layer {
  display: block;
}
.art .ghost {
  opacity: 0;
  pointer-events: none;
}
.art .ghost.fading {
  transition: opacity 1.6s ease;
}
html:not(.js) .art {
  background: #1b2a44 url("../img/hero-still.webp") center 40% / cover no-repeat;
}

/* the words sit in the sky, in an ink that follows the light: snow on dark skies, fir on pale */
.hero-words {
  --hero-ink: var(--snow);
  --hero-em: #ffe0cc;
  position: absolute;
  z-index: 2;
  top: 70px;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--hero-ink);
  transition: color 1.2s ease;
}
.hero.ink-dark .hero-words {
  --hero-ink: var(--fir);
  --hero-em: #8a3a1e;
}
.hero h1 {
  font-size: clamp(42px, 12vw, 60px);
  font-weight: 520;
  line-height: 0.96;
  letter-spacing: -0.02em;
}
.hero h1 .h-a,
.hero h1 .h-b {
  display: block;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--hero-em);
  letter-spacing: -0.015em;
  transition: color 1.2s ease;
}
.hero .sub {
  font-size: 16px;
  line-height: 1.45;
  max-width: 34ch;
}
.live {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 650 12.5px/1.2 var(--sans);
  letter-spacing: 0.06em;
}
.hero-controls {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.bar-ink-dark .bar.on-art {
  color: var(--fir);
}
body.bar-ink-dark .bar.on-art .wordmark {
  text-shadow: none;
}
body.bar-ink-dark .bar.on-art .wordmark .dot {
  color: #c0532c;
}
body.bar-ink-dark .bar.on-art .theme-switch {
  background: rgba(251, 247, 239, 0.5);
  border-color: rgba(16, 38, 42, 0.18);
}
body.bar-ink-dark .bar.on-art .theme-switch button[aria-checked="true"] {
  background: var(--fir);
  color: var(--snow);
}
.live-time {
  font-variant-numeric: tabular-nums;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--salmon);
  box-shadow: 0 0 0 4px rgba(240, 138, 93, 0.22);
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: breathe 3.2s ease-in-out infinite;
  }
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 8px rgba(240, 138, 93, 0);
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips button {
  appearance: none;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(251, 247, 239, 0.42);
  background: rgba(8, 20, 26, 0.34);
  color: var(--snow);
  font: 600 14.5px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.chips button:hover {
  border-color: var(--snow);
}
.chips button[aria-checked="true"] {
  background: var(--snow);
  color: var(--fir);
  border-color: var(--snow);
}
.actions {
  display: flex;
  gap: 10px;
}
.actions .button {
  flex: 1 1 0;
  padding-inline: 12px;
  white-space: nowrap;
  font-size: 15px;
}

/* ---------- the clock under the scene ---------- */
.clock {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 16px;
  padding: 16px var(--gutter) 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.clock-label {
  color: var(--ink-2);
}
.clock-out {
  font: 600 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  justify-self: end;
}
.clock-range {
  grid-column: 1 / -1;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
.clock-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: var(--day-gradient, linear-gradient(90deg, #0c1730, #f4b3a2, #7fb0dc, #f3cf98, #f08a5d, #0c1730));
  box-shadow: inset 0 0 0 1px rgba(16, 38, 42, 0.12);
}
.clock-range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: var(--day-gradient, linear-gradient(90deg, #0c1730, #f4b3a2, #7fb0dc, #f3cf98, #f08a5d, #0c1730));
}
.clock-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--snow);
  border: 2px solid var(--fir);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.clock-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--snow);
  border: 2px solid var(--fir);
}
.clock-now {
  grid-column: 1 / -1;
  justify-self: start;
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: 650 14px/1 var(--sans);
  padding: 8px 0;
  min-height: 32px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.clock-now:disabled {
  color: var(--ink-2);
  text-decoration: none;
  cursor: default;
  opacity: 0.7;
}

/* ---------- the journey ---------- */
.journey-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 84px var(--gutter) 56px;
  text-align: center;
}
.journey-head h2,
.onward h2 {
  font-size: clamp(36px, 9.4vw, 72px);
  font-weight: 500;
  margin: 12px 0 18px;
}
.journey-head h2 em,
.onward h2 em {
  display: block;
  font-weight: 380;
  color: var(--accent);
}
.journey-head p:not(.label) {
  color: var(--ink-2);
  font-size: 18px;
  max-width: 44ch;
  margin: 0 auto;
}
.journey-head .label,
.onward .label {
  color: var(--accent);
}

.scene {
  --ink-scene: var(--sound);
  position: relative;
  display: grid;
}
.scene[data-scene="rainforest"] {
  --ink-scene: var(--evergreen);
}
.scene[data-scene="sound"] {
  --ink-scene: #a5482a;
}
.scene[data-scene="cascades"] {
  --ink-scene: #2f5f86;
}
.scene[data-scene="east"] {
  --ink-scene: #8a6413;
}
:root[data-theme="dark"] .scene {
  --ink-scene: #9cc3e4;
}
:root[data-theme="dark"] .scene[data-scene="rainforest"] {
  --ink-scene: #8fd0b0;
}
:root[data-theme="dark"] .scene[data-scene="sound"] {
  --ink-scene: #f4a27c;
}
:root[data-theme="dark"] .scene[data-scene="east"] {
  --ink-scene: #e6c06a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .scene {
    --ink-scene: #9cc3e4;
  }
  :root:not([data-theme="light"]) .scene[data-scene="rainforest"] {
    --ink-scene: #8fd0b0;
  }
  :root:not([data-theme="light"]) .scene[data-scene="sound"] {
    --ink-scene: #f4a27c;
  }
  :root:not([data-theme="light"]) .scene[data-scene="east"] {
    --ink-scene: #e6c06a;
  }
}
.scene > * {
  grid-area: 1 / 1;
}
.scene-art {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  align-self: start;
  background: var(--scene-bg, #1b2a44);
}
.scene-art canvas {
  position: absolute;
  left: 0;
  width: 100%;
  will-change: transform;
}
.scene[data-scene="coast"] {
  --scene-bg: #b9c6cf;
}
.scene[data-scene="rainforest"] {
  --scene-bg: #2c4a35;
}
.scene[data-scene="sound"] {
  --scene-bg: #2a3058;
}
.scene[data-scene="cascades"] {
  --scene-bg: #0d1630;
}
.scene[data-scene="east"] {
  --scene-bg: #e9c48a;
}
.scene-body {
  position: relative;
  z-index: 2;
  padding: 62svh var(--gutter) 26svh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  pointer-events: none;
}
.scene-body > * {
  pointer-events: auto;
}
.scene-words {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--ink);
  border-radius: 22px;
  padding: 26px 24px 24px;
  box-shadow: 0 30px 60px -30px rgba(4, 12, 16, 0.55), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  max-width: 560px;
}
.scene-words .step {
  color: var(--ink-2);
}
.big {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(76px, 24vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  color: var(--ink-scene);
  margin: 14px 0 6px;
  font-variant-numeric: lining-nums;
}
.big .unit {
  font-size: 0.34em;
  font-weight: 450;
  font-style: italic;
  letter-spacing: -0.01em;
}
.big-cap {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 34ch;
}
.scene-words h3 {
  font-size: clamp(27px, 7vw, 36px);
  font-weight: 500;
  margin: 22px 0 12px;
}
.scene-words p:not(.big):not(.big-cap):not(.step) + p {
  margin-top: 12px;
}
.scene-words p:where(:not(.big, .big-cap)) {
  font-size: 16.5px;
}
.places {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 16px !important;
  font-weight: 600;
  font-size: 15px !important;
}
.places a {
  color: var(--ink-scene);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.scene-photo {
  margin: 0;
  max-width: 440px;
  align-self: flex-end;
  width: 86%;
}
.scene-photo img {
  width: 100%;
  border-radius: 16px;
  height: auto;
  box-shadow: 0 34px 60px -28px rgba(4, 12, 16, 0.7);
  background: var(--bg-2);
}
/* until home.js gives it a src as the scene nears, the photo is an empty frame of the right size */
.scene-photo img:not([src]) {
  color: transparent;
  aspect-ratio: 4 / 5;
}
.scene-photo figcaption {
  margin-top: 10px;
  display: inline-block;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  padding: 6px 10px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.scene-photo figcaption a {
  color: var(--ink-2);
}

/* the city lights on the Sound */
.cities {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  align-self: start;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 1;
  pointer-events: none;
}
.city {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--snow);
  font: 600 13px/1.1 var(--sans);
  text-shadow: 0 1px 8px rgba(4, 10, 20, 0.9), 0 0 2px rgba(4, 10, 20, 0.9);
  pointer-events: auto;
  white-space: nowrap;
}
.city-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffe2a6;
  box-shadow: 0 0 10px 3px rgba(255, 196, 120, 0.9), 0 0 34px 12px rgba(255, 160, 90, 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  .city-light {
    animation: glow 4s ease-in-out infinite;
  }
  .city:nth-child(2) .city-light {
    animation-delay: -1.3s;
  }
  .city:nth-child(3) .city-light {
    animation-delay: -2.6s;
  }
  .city:nth-child(4) .city-light {
    animation-delay: -0.6s;
  }
}
@keyframes glow {
  50% {
    box-shadow: 0 0 14px 5px rgba(255, 196, 120, 1), 0 0 48px 18px rgba(255, 160, 90, 0.5);
  }
}
.city-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 560;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

/* ---------- onward ---------- */
.onward {
  padding: 96px var(--gutter) 104px;
}
.onward-inner {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}
.onward-cards {
  display: grid;
  gap: 16px;
  margin-top: 36px;
  text-align: left;
}
.onward-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  justify-content: flex-end;
  padding: 26px 24px;
  border-radius: 22px;
  color: var(--snow);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.onward-card:hover {
  transform: translateY(-3px);
}
.onward-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
}
/* the pictures load once the cards are near (home.js adds .near; without scripts they load at once) */
.play-card::before {
  background-image: linear-gradient(180deg, rgba(8, 18, 40, 0.1) 30%, rgba(6, 14, 30, 0.86));
  background-color: #1c2a55;
}
.play-card.near::before,
:root:not(.js) .play-card::before {
  background-image: linear-gradient(180deg, rgba(8, 18, 40, 0.1) 30%, rgba(6, 14, 30, 0.86)), url("../img/card-play.webp");
}
.history-card::before {
  background-image: linear-gradient(180deg, rgba(16, 38, 42, 0.05) 30%, rgba(12, 28, 30, 0.88));
  background-color: #2b4a4a;
}
.history-card.near::before,
:root:not(.js) .history-card::before {
  background-image: linear-gradient(180deg, rgba(16, 38, 42, 0.05) 30%, rgba(12, 28, 30, 0.88)), url("../img/card-history.webp");
}
.onward-card strong {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 520;
  line-height: 1.05;
}
.onward-card span:not(.label) {
  font-size: 16px;
  color: rgba(251, 247, 239, 0.92);
  max-width: 38ch;
}
.onward-card .label {
  color: #ffd7c2;
}
.foot-note {
  flex-basis: 100%;
  font-size: 13.5px;
}

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .hero-words {
    top: 17vh;
    right: auto;
    max-width: 600px;
    gap: 14px;
  }
  .hero h1 {
    font-size: clamp(64px, 6vw, 100px);
  }
  .hero .sub {
    font-size: 19px;
  }
  .hero-controls {
    right: auto;
    bottom: 40px;
    flex-direction: row;
    align-items: center;
    gap: 22px;
  }
  .actions .button {
    flex: 0 0 auto;
    padding-inline: 20px;
  }
  .clock {
    grid-template-columns: auto 1fr auto auto;
    padding: 14px var(--gutter);
  }
  .clock-range {
    grid-column: auto;
  }
  .clock-now {
    grid-column: auto;
  }
  .scene-body {
    display: grid;
    grid-template-columns: minmax(380px, 520px) minmax(300px, 440px);
    justify-content: space-between;
    align-items: start;
    padding: 70vh var(--gutter) 30vh;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
  }
  .scene-photo {
    width: 100%;
    margin-top: 28vh;
  }
  .scene-words {
    padding: 36px 34px 30px;
  }
  .scene:nth-of-type(even) .scene-body {
    grid-template-columns: minmax(300px, 440px) minmax(380px, 520px);
  }
  .scene:nth-of-type(even) .scene-words {
    grid-column: 2;
    grid-row: 1;
  }
  .scene:nth-of-type(even) .scene-photo {
    grid-column: 1;
    grid-row: 1;
  }
  .onward-cards {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  .onward-card {
    min-height: 340px;
    padding: 34px;
  }
  .onward-card strong {
    font-size: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art .ghost.fading {
    transition: opacity 0.6s linear;
  }
}
