/* Full-screen story map: the wheel moves from one slide to the next. */

.story-page {
  --panel-w: 440px;
  --gutter: 24px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

#story-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #dfe8e2;
}

/* ---------- Panel ---------- */
.panel {
  position: fixed;
  z-index: 10;
  top: var(--gutter);
  bottom: var(--gutter);
  left: var(--gutter);
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(20, 40, 30, .28);
  overflow: hidden;
}
.slides { position: relative; flex: 1; min-height: 0; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity .55s ease, transform .55s ease, visibility 0s linear .55s;
}
.slide.is-before { transform: translateY(-40px); }
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .55s ease .1s, transform .55s ease .1s, visibility 0s;
}
.is-instant .slide { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.is-active { transition: none; transform: none; }
}

.slide-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2rem 2rem 1.5rem;
}
.slide h2 {
  margin: .25rem 0 .4rem;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--green-dark);
}
.slide h2 + h2, .slide .lang + h2, .slide .project + h2 { margin-top: 1.75rem; }
.slide h3 { margin: 1.1rem 0 .45rem; font: 700 .98rem var(--font-body); color: var(--green-dark); }

.eyebrow {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kind.work { color: var(--work); }
.kind.education { color: var(--education); }
.big-dates { margin: 0; font: 700 1.05rem var(--font-head); color: var(--amber); }
.slide .org { margin: 0 0 .5rem; font-weight: 700; color: var(--green); }
.slide .summary { margin: 0 0 .5rem; font-style: italic; color: var(--muted); }
.highlights { margin: .5rem 0 0; padding-left: 1.2rem; }
.highlights li { margin-bottom: .45rem; }
.highlights.compact { font-size: .93rem; }
.highlights.compact:empty { display: none; }

/* Intro */
.slide-intro { background: var(--green-dark); color: var(--side-ink); }
.slide-intro .slide-scroll { display: flex; flex-direction: column; }
.intro-head { display: flex; align-items: center; gap: 1.1rem; }
.intro-head .photo { width: 96px; height: 96px; margin: 0; border-width: 4px; flex: none; }
.slide-intro h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; color: #fff; }
.slide-intro .headline { margin: .35rem 0 0; font-size: 1.02rem; color: var(--green-light); }
.slide-intro .subheadline { margin: .1rem 0 0; color: var(--side-ink); opacity: .85; }
.summary-text { margin: 1.4rem 0 0; font-size: .97rem; }
.scroll-hint {
  display: flex; align-items: center; gap: .75rem;
  margin: auto 0 0; padding-top: 1.5rem;
  font-weight: 700; color: var(--green-light);
}
.mouse {
  position: relative; flex: none;
  width: 22px; height: 34px;
  border: 2px solid currentColor; border-radius: 12px;
}
.mouse::after {
  content: ""; position: absolute; left: 50%; top: 6px;
  width: 4px; height: 7px; margin-left: -2px;
  background: currentColor; border-radius: 2px;
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 1; transform: none; } 70% { opacity: 0; transform: translateY(10px); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mouse::after { animation: none; } }

/* Skills / languages / projects inside the light panel */
.panel .tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.panel .tag { padding: .1rem .55rem; font-size: .88rem; color: var(--green-dark); background: var(--green-pale); border: 1px solid var(--green-light); border-radius: 6px; }
.panel .bar { background: var(--green-pale); }
.panel .bar span { background: var(--green); }
.panel .soft strong { color: var(--green-dark); }
.panel .soft span { display: block; color: var(--muted); }
.panel .project { margin-bottom: .75rem; }

.contact-list { list-style: none; margin: 1rem 0; padding: 0; font-size: 1.05rem; }
.contact-list li { padding: .45rem 0; border-bottom: 1px solid var(--green-pale); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-ghost { color: var(--green); background: transparent; border: 1px solid var(--green-light); }
.btn-ghost:hover { color: #fff; }

/* Footer: prev / counter / progress / next */
.panel-footer {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem;
  border-top: 1px solid var(--green-pale);
  background: #fff;
}
.nav-btn {
  width: 34px; height: 34px; flex: none;
  font-size: 1rem; color: var(--green-dark);
  background: var(--green-pale); border: 0; border-radius: 50%;
  cursor: pointer;
}
.nav-btn:hover:not(:disabled) { color: #fff; background: var(--green); }
.nav-btn:disabled { opacity: .35; cursor: default; }
.counter { min-width: 3.2em; font-size: .85rem; font-weight: 700; color: var(--muted); }
.progress { flex: 1; height: 4px; background: var(--green-pale); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .5s ease; }

/* ---------- Dots (right side) ---------- */
.dots {
  position: fixed; z-index: 10;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px;
}
.dots button {
  position: relative;
  width: 14px; height: 14px; padding: 0;
  background: #fff; border: 2px solid var(--green); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.dots button.is-education { border-color: var(--education); }
.dots button.is-active { background: var(--amber); border-color: var(--amber); transform: scale(1.25); }
.dots button::after { /* tooltip */
  content: attr(data-label);
  position: absolute; right: 22px; top: 50%;
  transform: translateY(-50%);
  padding: .2rem .55rem;
  font: .8rem var(--font-body); white-space: nowrap;
  color: #fff; background: var(--green-dark); border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.dots button:hover::after, .dots button:focus-visible::after { opacity: 1; }

/* ---------- Top links & hint ---------- */
.top-links {
  position: fixed; z-index: 10; top: 16px; right: 16px;
  display: flex; gap: .4rem;
}
.top-links a {
  padding: .35rem .8rem;
  font-size: .85rem; font-weight: 700; text-decoration: none;
  color: var(--green-dark); background: rgba(255, 255, 255, .92);
  border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.top-links a:hover { background: #fff; }
.map-hint {
  position: fixed; z-index: 5; left: calc(var(--panel-w) + 2 * var(--gutter)); bottom: var(--gutter); margin: 0;
  padding: .3rem .7rem;
  font-size: .8rem; color: var(--muted);
  background: rgba(255, 255, 255, .85); border-radius: 6px;
}
kbd { font: inherit; font-weight: 700; }

/* ---------- Map markers ---------- */
.story-page .leaflet-control-zoom { margin-top: 64px !important; }
.story-page .leaflet-top.leaflet-left { left: calc(var(--panel-w) + var(--gutter)); }
.journey-marker { transition: opacity .3s, transform .3s; }
.journey-marker.is-dim { opacity: .7; }
.journey-marker.is-current { transform: scale(1.3); outline: 3px solid var(--amber); outline-offset: 2px; }
.journey-marker.is-current::before {
  content: ""; position: absolute; inset: -10px;
  border: 2px solid var(--amber); border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .journey-marker.is-current::before { animation: none; } }
.journey-marker { position: relative; }
.popup-steps button {
  padding: 0; font: 700 .95rem var(--font-body); text-align: left;
  color: var(--green-dark); background: none; border: 0; cursor: pointer; text-decoration: underline;
}

/* ---------- Small screens: panel becomes a bottom sheet ---------- */
@media (max-width: 760px) {
  .story-page { --gutter: 10px; }
  .panel {
    top: auto; left: var(--gutter); right: var(--gutter);
    width: auto; height: 52vh; height: 52dvh;
  }
  .slide-scroll { padding: 1.25rem 1.25rem 1rem; }
  .slide h2 { font-size: 1.2rem; }
  .intro-head .photo { width: 72px; height: 72px; }
  .slide-intro h1 { font-size: 1.35rem; }
  .dots, .map-hint { display: none; }
  .story-page .leaflet-top.leaflet-left { left: 0; }
  .story-page .leaflet-control-zoom { margin-top: 10px !important; }
}
