/* Design D · Atlas + Photo. A, with B's photograph hero in front of the map (landing) and a photo-led header on the
   day page. Everything else is a.css; only the additions live here. */

/* ---- landing: the photograph (from B: Mount Yōtei over Lake Toya, bone type on the lake) ------------------------- */
.d-hero { position: relative; height: calc(100svh - var(--topH, 64px)); min-height: 560px; overflow: hidden; background: #D9B9A6; }
.d-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 53% 50%;
  animation: d-settle 2.4s var(--ease-out) both; }
@keyframes d-settle { from { transform: scale(1.035); } to { transform: none; } }
.d-hero-shade { position: absolute; z-index: 1; pointer-events: none; background: rgba(31, 37, 49, .3); filter: blur(55px); border-radius: 40px; }
.d-hero-type { position: absolute; left: var(--gut); bottom: clamp(76px, 11svh, 120px); z-index: 2; color: var(--bone); }
.d-hero .title-stack { --t: clamp(56px, min(7.6vw, 11.2svh), 124px); }
.d-hero .title-stack h1 { letter-spacing: .015em; }
.d-hero .title-stack .byline { color: var(--bone); }
.d-hero-sub { margin-top: 26px; display: flex; gap: 28px; flex-wrap: wrap; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.d-hero-sub b { font-weight: 700; }
.d-hero-plane { display: inline-flex; align-items: center; gap: 14px; margin: 28px 0 0 calc(-1 * var(--gut)); padding: 16px 26px 15px var(--gut);
  background: var(--hot); color: var(--bone); text-decoration: none; font-size: 13px; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; transition: padding .3s var(--ease-out); }
.d-hero-plane .play { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.d-hero-plane small { font-weight: 500; letter-spacing: .2em; opacity: .9; font-size: 11px; }
.d-hero-plane:hover { padding-left: calc(var(--gut) + 10px); }
.d-hero-cap { position: absolute; right: var(--gut); bottom: clamp(76px, 11svh, 120px); z-index: 2; text-align: right; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--bone); line-height: 1.7; }
.d-hero-cap a { text-decoration: none; }
.d-hero-cap a:hover { text-decoration: underline; }
.d-scroll { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--bone); text-decoration: none; }
.d-scroll i { width: 1.5px; height: 30px; background: currentColor; transform-origin: top; animation: d-drip 1.8s var(--ease-out) infinite; }
@keyframes d-drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.d-up { animation: d-up .9s var(--ease-out) both; }
@keyframes d-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* pointer C: four corner brackets around the distant mountain (never a ring on a peak) */
.d-brk { position: absolute; z-index: 2; pointer-events: none; animation: d-brk .7s .9s var(--ease-back, cubic-bezier(.34,1.56,.64,1)) both; }
@keyframes d-brk { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
.d-brk .c { position: absolute; width: 16px; height: 16px; border: 0 solid var(--bone); }
.d-brk .tl { left: 0; top: 0; border-left-width: 2.5px; border-top-width: 2.5px; }
.d-brk .tr { right: 0; top: 0; border-right-width: 2.5px; border-top-width: 2.5px; }
.d-brk .bl { left: 0; bottom: 0; border-left-width: 2.5px; border-bottom-width: 2.5px; }
.d-brk .br { right: 0; bottom: 0; border-right-width: 2.5px; border-bottom-width: 2.5px; }
.d-brk .lab { position: absolute; bottom: calc(100% + 12px); left: 0; white-space: nowrap; font-weight: 700; font-size: clamp(22px, 3.8svh, 36px); line-height: 1; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); }

@media (max-width: 700px) {
  .d-hero > img { object-position: 52% 50%; }
  .d-hero-type { left: 16px; right: 16px; top: 18px; bottom: 104px; display: flex; flex-direction: column; justify-content: space-between; }
  .d-hero .title-stack { --t: clamp(46px, 15vw, 72px); }
  .d-hero-sub { gap: 4px 14px; font-size: 10px; margin-top: 0; }
  .d-hero-plane { margin-left: -16px; padding-left: 16px; margin-top: 16px; font-size: 12px; }
  .d-hero-cap { left: 16px; right: auto; text-align: left; bottom: 66px; font-size: 9.5px; }
  .d-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) { .d-up, .d-hero > img, .d-brk, .d-scroll i { animation: none !important; } }

/* ---- landing: the map, straight after the photograph (A's hero map, full screen; a smaller heading, not the title again) */
.d-mapsec { scroll-margin-top: var(--topH, 64px); border-top: 1px solid var(--rule); }
@media (min-width: 901px) { .a-hero.d-mapsec { height: calc(100svh - var(--topH, 64px)); } }
.d-maphead .a-kick .jp { margin-left: 10px; }
.d-maphead h2 { margin: 12px 0 0; white-space: nowrap; font-size: clamp(34px, min(3.3vw, 6.5vh), 62px); line-height: .98; letter-spacing: .06em; text-transform: uppercase; }
.d-maphead h2 .to { font-size: .42em; letter-spacing: .2em; color: var(--ink-3); vertical-align: middle; margin-right: .2em; }
.d-maphead + .a-count { margin-top: 30px; }

/* ---- day page: photo-led header (from B) ------------------------------------------------------------------------- */
.d-head.d-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: stretch; gap: clamp(24px, 3vw, 48px); }
.d-head.d-photo .d-hero-pic { position: relative; margin: 0; min-height: 340px; max-height: 62svh; aspect-ratio: 3 / 2; max-width: 100%; overflow: hidden; background: var(--bone-2); cursor: zoom-in; }
.d-head.d-photo .d-hero-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-head.d-photo .d-hero-pic figcaption { position: absolute; left: 0; bottom: 0; padding: 7px 12px 6px; background: var(--bone); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; border-top: 3px solid var(--c); }
.d-head.d-photo .d-side-loc { display: flex; gap: 16px; align-items: center; margin-top: 22px; }
.d-head.d-photo .d-side-loc .d-loc { width: 120px; height: 120px; flex: none; }
.d-head.d-photo .d-side-loc .t { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); line-height: 1.7; }
@media (max-width: 900px) {
  .d-head.d-photo { grid-template-columns: 1fr; }
  .d-head.d-photo .d-hero-pic { order: -1; min-height: 0; }
}

/* ---- landing variant: the flyby hero (video.html). Two layers crossfade clip to clip; the type sits on a soft wash -- */
.d-fly { background: var(--ink); }
.d-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s linear; }
.d-vid.on { opacity: 1; }
.d-vid-wash { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(31, 37, 49, .5), rgba(31, 37, 49, 0) 55%), linear-gradient(to right, rgba(31, 37, 49, .25), rgba(31, 37, 49, 0) 45%); }
.d-fly-cap { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.d-fly-cap .jp { margin-left: 8px; }
.d-fly-ticks { display: flex; gap: 5px; }
.d-fly-ticks i { width: 26px; height: 2px; background: rgba(242, 237, 227, .35); position: relative; overflow: hidden; }
.d-fly-ticks i.on::after { content: ""; position: absolute; inset: 0; background: var(--bone); transform-origin: left; animation: d-tick var(--d) linear both; }
.d-fly.paused .d-fly-ticks i.on::after { animation-play-state: paused; }
@keyframes d-tick { from { transform: scaleX(0); } to { transform: none; } }
.d-fly-pause { width: 30px; height: 30px; border: 1.5px solid rgba(242, 237, 227, .7); border-radius: 50%; background: none; color: var(--bone); cursor: pointer; display: grid; place-items: center; padding: 0; }
.d-fly-pause i { width: 8px; height: 10px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; }
.d-fly-pause.paused i { width: 0; height: 0; border-right: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.d-fly-pause:hover { background: rgba(242, 237, 227, .15); }
@media (max-width: 700px) {
  .d-fly-cap { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .d-vid { transition: none; } .d-fly-ticks i.on::after { animation: none; transform: none; } }

/* ---- day page (Nov 5): zoom on the map, the stay beside the notes, the photos the full width ----------------------- */
.d-map-box { position: relative; min-width: 0; }
.d-zoom, .a-map-ui.d-zoom { position: absolute; right: 14px; top: 14px; padding: 0; }
.d-body { align-items: start; }
.d-body .d-stay { margin-top: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px; }
.d-body .d-stay .l, .d-body .d-stay .v { grid-column: 1; }
.d-stay-go { grid-column: 2; grid-row: 1 / 3; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--c); padding-bottom: 2px; }
.d-stay-go:hover { color: var(--hot); }
.d-photos { padding: 0 0 60px; }

/* ---- landing map on phones (Nov 5): the map fills the screen under a small heading; tap a day for its card ---------- */
.d-sheet { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: 12px; max-width: 420px; }
.d-sheet > a { display: block; text-decoration: none; color: inherit; background: var(--card); box-shadow: 0 10px 30px rgba(31, 37, 49, .22); }
.d-sheet .sr-card { box-shadow: none; max-width: none; }
.d-sheet .go { display: block; background: var(--hot); color: var(--bone); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; padding: 12px 16px 11px; }
.d-sheet .x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; }
@media (max-width: 900px) {
  .a-hero.d-mapsec { display: block; height: calc(100svh - var(--topH, 64px)); min-height: 540px; max-height: none; }
  .d-mapsec .a-hero-map { position: absolute; inset: 0; height: auto; }
  .d-mapsec .a-hero-text { position: absolute; left: 0; right: 0; top: 0; width: auto; padding: 18px 16px 0; pointer-events: none; }
  .d-mapsec .d-maphead h2 { font-size: clamp(26px, 8vw, 40px); margin-top: 8px; }
  .d-maphead + .a-count { margin-top: 12px; }
  .d-mapsec .a-count b { font-size: 40px; }
  .d-mapsec .a-count span { font-size: 18px; }
  .d-mapsec .a-count-sub { font-size: 11px; margin-top: 4px; }
  .d-mapsec .a-isl-bar, .d-mapsec .a-isl-bar-l, .d-mapsec .a-cta { display: none; }
  .d-mapsec .a-map-ui { position: absolute; right: 12px; top: auto; bottom: 62px; padding: 0; }
  .d-mapsec .a-map-ui .grp:not(.zoom) { display: none; }
  .d-mapsec .a-islnav { position: absolute; left: 12px; right: 12px; bottom: 14px; padding: 0; flex-wrap: nowrap; }
  .d-mapsec .a-islnav button { flex: 1; padding: 9px 4px 8px; font-size: 10px; letter-spacing: .1em; }
}

/* ---- Day 0: getting to the start (the bullet train down) ------------------------------------------------------------ */
.d-there { margin-top: 30px; }
.d-there h2 { margin: 8px 0 0; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: .04em; text-transform: uppercase; }
.d-there-map { height: 440px; margin-top: 18px; border: 1px solid var(--rule); background: var(--bone); position: relative; }
.d-there-key { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.d-there-key span { display: flex; align-items: center; gap: 8px; }
.d-there-key i { display: inline-block; width: 30px; height: 5px; }
.d-there-key .rail { background: repeating-linear-gradient(90deg, var(--ink) 0 7px, var(--bone) 7px 14px); box-shadow: 0 0 0 1.4px var(--ink); height: 3px; }
.d-there-key .ride { background: var(--hot); height: 3px; }
@media (max-width: 700px) { .d-there-map { height: 300px; } }
