@font-face {
  font-family: "Instrument Serif";
  src: url("/resume/assets/journey/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/resume/assets/journey/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

.journey,
.journey-controls,
.skip-resume {
  --journey-ink: #161a18;
  --journey-paper: #fff7e9;
  --journey-accent: #f6ca96;
}

.journey {
  color: var(--journey-paper);
  background: var(--journey-ink);
}

.skip-resume {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1100;
  padding: .65rem 1rem;
  background: var(--journey-accent);
  color: var(--journey-ink);
  transform: translateY(-200%);
}

.skip-resume:focus { transform: none; }

.journey.is-animated {
  height: 365svh;
}

.journey-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 440px;
  isolation: isolate;
  overflow: clip;
}

.journey-images,
.journey-shot,
.journey-stage::before,
.journey-stage::after {
  position: absolute;
  inset: 0;
}

.journey-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 56%) var(--focus-y, 50%);
  transform-origin: var(--focus-x, 56%) var(--focus-y, 50%);
  visibility: hidden;
  opacity: 0;
}

.journey-shot:first-child {
  visibility: visible;
  opacity: 1;
}

.journey-shot.is-current,
.journey-shot.is-entering {
  will-change: transform, opacity;
}

.journey-shot.is-entering {
  mask-image:
    linear-gradient(90deg, transparent, #000 var(--feather), #000 calc(100% - var(--feather)), transparent),
    linear-gradient(transparent, #000 var(--feather), #000 calc(100% - var(--feather)), transparent);
  mask-composite: intersect;
}

.journey-stage::before {
  content: "";
  z-index: 1;
  pointer-events: none;
  opacity: var(--finale-shade, 1);
  background: linear-gradient(to top, #161a18f0, #161a18b8 25%, #161a1800 58%);
}

.journey-stage::after {
  content: "";
  pointer-events: none;
  background:
    linear-gradient(to top, #161a18fa 0%, #161a1899 12%, #161a1800 36%),
    linear-gradient(to bottom, #161a1880, #161a1800 19%);
}

.journey-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  margin-inline: auto;
  max-width: 1520px;
  padding-inline: clamp(2rem, 6vw, 7rem);
  display: grid;
}

.journey-finale {
  align-self: end;
  justify-self: center;
  padding-bottom: clamp(2.5rem, 11svh, 7rem);
  text-align: center;
  text-shadow: 0 4px 30px #161a18bf;
}

.is-animated .journey-finale {
  opacity: 0;
}

.journey-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  color: var(--journey-accent);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.journey-role::before,
.journey-role::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
}

#journey-title {
  margin-bottom: .7rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3.3rem, 7.5vw, 8.5rem);
  font-weight: 400;
  letter-spacing: -.038em;
  line-height: .95;
}

#journey-title em {
  color: var(--journey-accent);
  font-weight: 400;
}

.journey-controls {
  position: relative;
  width: min(calc(100% - 4rem), 1100px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 2rem;
  padding-block: .85rem max(1.65rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.journey-resume,
.journey-player:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 44px;
  padding: .5rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: inherit;
  background: var(--surface);
  font-size: .9rem;
  font-weight: 600;
  transition: color .2s, background-color .2s;
}

.journey-resume {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  border-color: transparent;
  background: var(--journey-accent);
  color: var(--journey-ink);
}

.journey-player {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.journey-resume:is(:hover, :focus-visible),
.journey-player:is(:hover, :focus-visible) {
  background: var(--journey-paper);
  color: var(--journey-ink);
}

.journey-status {
  display: none;
  grid-column: 1;
  grid-row: 1;
  width: min(100%, 16rem);
}

body:has(.journey.is-animated) .journey-status { display: block; }

.journey-labels {
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.journey-labels {
  display: flex;
  font-variant-numeric: tabular-nums;
  margin-bottom: .55rem;
}

.journey-labels b {
  color: var(--primary);
}

.journey-track {
  height: 2px;
  background: var(--border);
}

.journey-track span {
  display: block;
  height: 100%;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
}

.player-icon {
  width: .9rem;
  font-size: .8rem;
  text-align: center;
}

#navbar {
  --primary: #f6ca96;
  --accent: #fff7e9;
  --text: #fff7e9;
  --text-2: #f2e7d5;
  --surface: #29302a;
  --border: #ffffff29;
  --border-light: #ffffff26;
  background: #161a18ed;
}

#navbar .nav-controls button:hover,
#navbar .mobile-menu a:hover {
  background: #f6ca96;
  color: #161a18;
}

#navbar .nav-hamburger:hover span {
  background: #161a18;
}

@media (max-width: 640px) {
  .journey.is-animated { height: 335svh; }
  .journey-stage { min-height: 390px; }

  .journey-inner {
    padding-inline: 1.2rem;
  }

  #journey-title {
    font-size: clamp(2.85rem, 13vw, 5rem);
  }

  .journey-controls {
    width: calc(100% - 2.4rem);
    grid-template-columns: 1fr auto;
    gap: .8rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .journey-resume {
    grid-column: 1;
    justify-self: start;
  }

  .journey-player { grid-column: 2; }

  .journey-status {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .journey-stage { min-height: 0; }
  #journey-title { font-size: clamp(2.65rem, 13svh, 5rem); }
  .journey-controls { padding-block: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-shot:first-child { visibility: hidden; opacity: 0; }
  .journey-shot:last-child { visibility: visible; opacity: 1; }

  .has-reveals .reveal,
  .has-reveals .reveal.active {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .avatar-ring::before,
  .heart { animation: none; }
}
