/* ═══════════════════════════════════════════════════
   Journey — SVG Path + Scrolling Content
   Portfolio v3 · 2026
   SVG path draws via JS scroll progress
   ═══════════════════════════════════════════════════ */

/* ═══ Section shell ═══ */
.journey {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  isolation: isolate;
  background: var(--surface-experience);
}

/* SVG and content overlap via grid */
.journey__path-wrap,
.journey__content {
  grid-row: 1 / -1;
  grid-column: 1 / -1;
}

/* ── SVG path — sticky background ── */
.journey__path-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 85% 80% at 50% 50%, black 40%, transparent 95%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.journey__path-svg {
  width: 90%;
  max-width: 500px;
  height: 80vh;
  max-height: 600px;
  overflow: visible;
}

/* ── Guide path: always visible, shows the full route ── */
.journey__path-guide {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 6 10;
  opacity: 0.3;
}

/* ── Main drawn line: bold, the visual event ── */
.journey__path-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
}

/* ── Glow behind the drawn line ── */
.journey__path-glow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  opacity: 0.12;
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
}

/* ── Career node markers ── */
.journey__path-node {
  fill: var(--accent);
  opacity: 0.2;
  r: 6;
  transition: opacity 0.6s ease, r 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.journey__path-node--active {
  opacity: 1;
  r: 8;
  filter: drop-shadow(0 0 8px oklch(62% 0.18 35 / 0.5));
}

/* ── Country-code stamps at each node — quiet typography ── */
.journey__path-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--text-muted);
  opacity: 0.65;
}

/* ── Traveler: bright dot that leads the draw ── */
.journey__path-traveler {
  fill: var(--palette-cream);
  opacity: 0.95;
}

.journey__path-traveler-glow {
  fill: var(--accent);
  opacity: 0.4;
  animation: traveler-pulse 2.5s ease-in-out infinite;
}

@keyframes traveler-pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.55; }
}

/* ── Scrolling content ── */
.journey__content {
  position: relative;
  z-index: 1;
  padding: clamp(6rem, 12vh, 10rem) 0 0;
}

/* ═══ Header ═══ */
.journey__header {
  max-width: 1100px;
  margin: 0 auto clamp(5rem, 10vh, 8rem);
  padding: 0 clamp(1.5rem, 5vw, 5rem);
}

.journey__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-faint);
}

.journey__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 6rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0;
}

.journey__title em {
  font-style: italic;
  color: var(--accent);
}

/* ═══ Chapter — one career stop ═══ */
.journey__chapter {
  max-width: 720px;
  margin: 0 auto clamp(4rem, 8vh, 7rem);
  padding: clamp(2.5rem, 4vw, 3.5rem);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid oklch(100% 0 0 / 0.04);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 4px 20px var(--glass-shadow);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.journey__chapter:hover {
  border-color: oklch(62% 0.18 35 / 0.08);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 12px 40px var(--glass-shadow-lg),
    0 0 50px oklch(62% 0.18 35 / 0.05);
  transform: translateY(-3px);
}

/* Alternate alignment */
.journey__chapter:nth-child(odd of .journey__chapter) {
  margin-left: clamp(1.5rem, 5vw, 5rem);
  margin-right: auto;
}
.journey__chapter:nth-child(even of .journey__chapter) {
  margin-left: auto;
  margin-right: clamp(1.5rem, 5vw, 5rem);
}

/* Bloom inside chapter */
.journey__chapter::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 50% at 80% 20%, oklch(62% 0.18 35 / 0.06), transparent 60%);
  pointer-events: none;
}

/* ── Chapter meta ── */
.journey__chapter-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.journey__chapter-year {
  color: var(--accent);
  font-weight: 600;
}

.journey__chapter-code {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid oklch(62% 0.18 35 / 0.3);
  border-radius: 3px;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-subtle);
}

.journey__chapter-sep { color: var(--text-faint); }

/* ── Company name ── */
.journey__chapter-company {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

/* ── Role ── */
.journey__chapter-role {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  color: var(--text-secondary);
  margin: 0 0 1.2rem;
}

.journey__chapter-role strong {
  color: var(--accent);
  font-weight: 500;
  font-style: italic;
}

/* ── Description ── */
.journey__chapter-desc {
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  max-width: 55ch;
}

/* ═══ Phases — timeline within a chapter ═══ */
.journey__phases {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.journey__phase {
  display: grid;
  grid-template-columns: clamp(5rem, 10vw, 7rem) 1fr;
  gap: 1rem;
  align-items: baseline;
}

.journey__phase-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 0.2em;
}

.journey__phase-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.journey__phase-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.journey__phase--now .journey__phase-title {
  color: var(--accent);
  font-style: italic;
}

.journey__phase--now .journey__phase-year {
  color: var(--accent);
}

.journey__phase-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.85rem, 1.1vw, 0.95rem);
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* ═══ Coda ═══ */
.journey__coda {
  padding: clamp(6rem, 12vh, 10rem) clamp(2rem, 8vw, 8rem);
  text-align: center;
  position: relative;
}

.journey__coda::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(60px, 10vw, 100px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.journey__coda-text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.journey__coda-text span {
  color: oklch(62% 0.12 35);  /* muted rust — warm but not loud */
  font-style: normal;
  font-weight: 400;
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  .journey__path-wrap {
    display: none;
  }
  .journey__chapter:nth-child(odd of .journey__chapter),
  .journey__chapter:nth-child(even of .journey__chapter) {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  .journey__chapter {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--glass-bg);
  }
  .journey__phase {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .journey__coda {
    padding: 5rem 1.5rem 6rem;
  }
}

@media (max-width: 480px) {
  .journey__content {
    padding-top: 4rem;
  }
  .journey__header {
    margin-bottom: 3rem;
    padding: 0 1.25rem;
  }
  .journey__chapter {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
    margin-left: 0.75rem !important;
    margin-right: 0.75rem !important;
  }
  .journey__chapter-company {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }
  .journey__coda {
    padding: 3.5rem 1.25rem 4rem;
  }
  .journey__coda-text {
    font-size: clamp(1.3rem, 5vw, 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey__path-wrap { display: none; }
}
