:root {
  --bg-deep: #0f1219;
  --bg-mid: #161c2c;
  --surface: rgba(36, 43, 61, 0.65);
  --surface-solid: #1e2638;
  --text: #f0f3fa;
  --muted: #8b95ab;
  --muted2: #5c667d;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.15);
  --line: rgba(255, 255, 255, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

.cursor-trail-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ambient background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 20% -20%, rgba(124, 58, 237, 0.22), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 30%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(167, 139, 250, 0.08), transparent 45%),
    var(--bg-deep);
}

.page-bg::before {
  content: "";
  position: absolute;
  width: 90vmax;
  height: 90vmax;
  top: -35%;
  left: -25%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.14) 0%, transparent 68%);
  animation: orb-drift 24s ease-in-out infinite alternate;
  pointer-events: none;
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, black 20%, transparent 75%);
  pointer-events: none;
  animation: grid-breathe 14s ease-in-out infinite alternate;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #c4b5fd;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 18, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  animation: header-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem clamp(1.4rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__trailing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-me-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #dce3f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-me-link:hover {
  color: var(--text);
}

.nav-cn-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #eaeaf2;
  margin-left: 0.15rem;
  white-space: nowrap;
}

.nav-cn-label:hover {
  color: var(--accent, #c4b5fd);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #c8d0e4;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.42rem 0.95rem 0.42rem 0.85rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 4px 20px rgba(124, 58, 237, 0.12);
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.nav-back:hover {
  color: var(--text);
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(196, 181, 253, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 6px 28px rgba(124, 58, 237, 0.22);
  transform: translateX(-2px);
}

.nav-back:focus-visible {
  outline: none;
  color: var(--text);
  border-color: rgba(196, 181, 253, 0.65);
  box-shadow:
    0 0 0 2px rgba(15, 18, 25, 0.9),
    0 0 0 4px rgba(167, 139, 250, 0.45);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem clamp(1.75rem, 5vw, 3.5rem) 7.5rem;
}

/* Divider between hero and content */
.section-divider {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 clamp(1.75rem, 5vw, 3.5rem);
  box-sizing: border-box;
}

.section-divider__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0 1.85rem;
}

.section-divider__line {
  flex: 1;
  min-width: 1.5rem;
  height: 1px;
}

.section-divider__line--left {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(129, 140, 248, 0.2) 35%,
    rgba(196, 181, 253, 0.65) 100%
  );
}

.section-divider__line--right {
  background: linear-gradient(
    90deg,
    rgba(196, 181, 253, 0.65) 0%,
    rgba(129, 140, 248, 0.2) 65%,
    transparent 100%
  );
}

.section-divider__gem {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(145deg, #f5f0ff 0%, #a78bfa 42%, #6366f1 100%);
  box-shadow:
    0 0 18px rgba(167, 139, 250, 0.5),
    0 0 36px rgba(99, 102, 241, 0.18);
  animation: divider-gem-pulse 5.5s ease-in-out infinite;
}

.section-divider__glow {
  max-width: min(480px, 60vw);
  height: 44px;
  margin: -1.85rem auto 0;
  background: radial-gradient(
    ellipse 100% 100% at 50% 0%,
    rgba(167, 139, 250, 0.16) 0%,
    transparent 68%
  );
  pointer-events: none;
}

/* Pillars → timeline: same gem/lines as hero→main, tighter vertical rhythm */
.section-divider--compact {
  padding-left: 0;
  padding-right: 0;
  margin-top: clamp(2.35rem, 5vw, 3.65rem);
}

.section-divider--compact .section-divider__inner {
  padding: 1.8rem 0 1.1rem;
}

.section-divider--compact .section-divider__glow {
  max-width: min(420px, 72vw);
  height: 34px;
  margin: -1.55rem auto 0;
}

main > .section-divider--compact + .timeline-wrap {
  margin-top: 0;
  padding-top: 0.75rem;
}

@media (max-width: 768px) {
  .section-divider--compact .section-divider__inner {
    padding: 1.45rem 0 0.85rem;
  }

  .section-divider--compact .section-divider__glow {
    height: 28px;
    margin: -1.3rem auto 0;
  }

  main > .section-divider--compact + .timeline-wrap {
    padding-top: 0.55rem;
  }
}

@keyframes divider-gem-pulse {
  0%,
  100% {
    box-shadow:
      0 0 16px rgba(167, 139, 250, 0.42),
      0 0 32px rgba(99, 102, 241, 0.14);
  }
  50% {
    box-shadow:
      0 0 24px rgba(167, 139, 250, 0.6),
      0 0 48px rgba(99, 102, 241, 0.22);
  }
}

/* Hero — full width, text / image columns */
.hero {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(2.9rem, 6.5vw, 4.5rem) clamp(1.75rem, 5vw, 3.5rem) 4.25rem;
  box-sizing: border-box;
}

.hero-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2.25rem, 5.75vw, 4.75rem);
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-media {
  min-width: 0;
  max-width: 289px;
  width: 100%;
  justify-self: end;
}

.hero-figure {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(167, 139, 250, 0.1) inset,
    0 32px 80px rgba(124, 58, 237, 0.15);
  animation: fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4 / 5;
  max-width: 289px;
  max-height: min(289px, 39vh);
  vertical-align: middle;
}

@media (max-width: 900px) {
  .hero-shell {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .hero-media {
    max-width: 233px;
    margin: 0 auto;
    width: 100%;
    justify-self: center;
  }

  .hero-img {
    max-width: 233px;
    max-height: min(233px, 31vh);
  }
}

@media (min-width: 901px) {
  .hero-media {
    transform: translateX(-80px);
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted2);
  margin-bottom: 1.45rem;
  animation: fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  transform-origin: left center;
  animation: line-grow 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1.45rem;
  animation: fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hero-title .gradient {
  background: linear-gradient(
    125deg,
    #e9d5ff 0%,
    #a78bfa 22%,
    #c4b5fd 45%,
    #818cf8 62%,
    #a78bfa 82%,
    #e9d5ff 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-flow 8s ease-in-out infinite;
}

.hero-lead {
  font-size: 1.0625rem;
  color: var(--muted);
  margin: 0;
  max-width: 38rem;
  line-height: 1.86;
  animation: fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* Pillars grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.15rem 2.35rem;
}

@media (max-width: 768px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}

.pillar {
  position: relative;
  padding: 2.45rem 2.3rem 2.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.pillar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(129, 140, 248, 0.5) 35%,
    rgba(167, 139, 250, 0.95) 50%,
    rgba(129, 140, 248, 0.5) 65%,
    transparent 100%
  );
  background-size: 45% 100%;
  background-repeat: no-repeat;
  opacity: 0.75;
  animation: pillar-scan 5.5s ease-in-out infinite;
}

.pillars-grid .pillar:nth-child(1)::before {
  animation-delay: 0s;
}

.pillars-grid .pillar:nth-child(2)::before {
  animation-delay: 1.2s;
}

.pillars-grid .pillar:nth-child(3)::before {
  animation-delay: 2.4s;
}

.pillars-grid .pillar:nth-child(4)::before {
  animation-delay: 0.6s;
}

.pillar.is-visible:hover {
  border-color: rgba(167, 139, 250, 0.32);
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.32);
}

.pillar--wide {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .pillar--wide {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 2.1rem 3rem;
    align-items: start;
  }
}

.pillar-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.05rem;
  flex-wrap: wrap;
}

.pillar-index {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0.9;
}

.pillar-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.4rem 1.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.35;
  border: 2px solid rgba(196, 181, 253, 0.78);
  border-radius: 9999px;
  background: linear-gradient(
    165deg,
    rgba(167, 139, 250, 0.14) 0%,
    rgba(129, 140, 248, 0.06) 100%
  );
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.12),
    0 6px 20px rgba(124, 58, 237, 0.1);
}

.pillar-hook {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.68;
}

.pillar-body {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.88;
}

.pillar-body + .pillar-body {
  margin-top: 1rem;
}

/* Career timeline */
.timeline-wrap {
  margin-top: 4.1rem;
  padding-top: 1.1rem;
}

.timeline-wrap__head {
  margin-bottom: 2.45rem;
}

.timeline-wrap__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted2);
  margin: 0 0 0.9rem;
}

.timeline-wrap__eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.timeline-wrap__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.timeline-wrap__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.72;
}

.timeline {
  position: relative;
  padding-top: 0.85rem;
  max-width: 920px;
  margin: 0 auto;
}

.timeline__spine {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  bottom: 1.25rem;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(196, 181, 253, 0.9) 0%,
    rgba(129, 140, 248, 0.35) 45%,
    rgba(167, 139, 250, 0.12) 100%
  );
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.25);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.timeline[data-reveal].is-visible .timeline__spine {
  transform: scaleY(1);
}

.timeline__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 2.5rem;
  row-gap: 0.95rem;
  align-items: start;
  padding-bottom: 2.75rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1.2rem;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid #c4b5fd;
  box-shadow:
    0 0 14px rgba(167, 139, 250, 0.55),
    0 0 0 3px rgba(167, 139, 250, 0.12);
  z-index: 2;
  opacity: 0;
  transform: scale(0.35);
  transition:
    opacity 0.45s ease,
    transform 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
  transition-delay: 0.12s;
}

.timeline__item[data-reveal].is-visible::before {
  opacity: 1;
  transform: scale(1);
}

.timeline__item:nth-child(odd) .timeline__year {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  padding-top: 0.2rem;
  padding-right: 0;
}

.timeline__item:nth-child(odd) .timeline__card {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
  width: 100%;
  max-width: min(400px, 100%);
}

.timeline__item:nth-child(even) .timeline__year {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  text-align: left;
  padding-top: 0.2rem;
}

.timeline__item:nth-child(even) .timeline__card {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  width: 100%;
  max-width: min(400px, 100%);
}

.timeline__year {
  min-width: 0;
}

.timeline__year-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ddd6fe;
  padding: 0.38rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(196, 181, 253, 0.45);
  background: linear-gradient(
    165deg,
    rgba(167, 139, 250, 0.16) 0%,
    rgba(99, 102, 241, 0.06) 100%
  );
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  white-space: normal;
  max-width: min(100%, 14rem);
  text-align: center;
  line-height: 1.25;
}

.timeline__card {
  position: relative;
  padding: 1.35rem 1.45rem 1.45rem;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  background: rgba(36, 43, 61, 0.55);
  backdrop-filter: blur(10px);
  overflow: hidden;
  text-align: left;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline__item:nth-child(1) .timeline__card {
  background: linear-gradient(
    165deg,
    rgba(52, 68, 98, 0.72) 0%,
    rgba(32, 40, 58, 0.58) 100%
  );
}

.timeline__item:nth-child(2) .timeline__card {
  background: linear-gradient(
    165deg,
    rgba(58, 52, 88, 0.65) 0%,
    rgba(34, 36, 56, 0.58) 100%
  );
}

.timeline__item:nth-child(3) .timeline__card {
  background: linear-gradient(
    165deg,
    rgba(48, 62, 72, 0.68) 0%,
    rgba(30, 38, 48, 0.56) 100%
  );
}

.timeline__item:nth-child(4) .timeline__card {
  background: linear-gradient(
    165deg,
    rgba(72, 52, 68, 0.62) 0%,
    rgba(38, 32, 44, 0.55) 100%
  );
}

.timeline__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.7), transparent);
  opacity: 0.75;
}

.timeline__item:nth-child(odd) .timeline__card:hover {
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  transform: translateX(6px);
}

.timeline__item:nth-child(even) .timeline__card:hover {
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  transform: translateX(-6px);
}

.timeline__role {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.timeline__meta {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted2);
  line-height: 1.55;
}

.timeline__achievements {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.timeline__achievements li {
  margin-bottom: 0.35rem;
}

.timeline__achievements li:last-child {
  margin-bottom: 0;
}

/* Timeline detail modal + flowchart */
.timeline-modal {
  position: fixed;
  inset: 0;
  width: min(98vw, 80rem);
  max-height: min(92vh, 90vh);
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
}

.timeline-modal::backdrop {
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(6px);
}

.timeline-modal__panel {
  position: relative;
  padding: clamp(2rem, 4.5vw, 3.5rem) clamp(1.75rem, 4vw, 3.25rem) clamp(2rem, 4.5vw, 3.25rem);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(196, 181, 253, 0.28);
  background: linear-gradient(165deg, rgba(30, 38, 56, 0.98) 0%, rgba(20, 26, 40, 0.96) 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  max-height: min(88vh, 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

.timeline-modal__close {
  position: absolute;
  top: clamp(0.85rem, 2.2vw, 1.35rem);
  right: clamp(0.85rem, 2.2vw, 1.35rem);
  width: 2.875rem;
  height: 2.875rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: clamp(1.35rem, 2.2vw, 1.55rem);
  cursor: pointer;
}

.timeline-modal__title {
  margin: 0 0 0.8rem;
  padding-right: clamp(3.25rem, 8vw, 4.25rem);
  font-size: clamp(1.35rem, 2.2vw + 0.35rem, 2.25rem);
}

.timeline-modal__subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.timeline-modal__subtitle:empty,
.timeline-modal__body:empty {
  display: none;
}

.timeline__card--clickable {
  cursor: pointer;
}

.timeline__card--clickable:focus-visible,
.timeline-modal__close:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.75);
  outline-offset: 2px;
}

.email-flow {
  --flow-node-duration: 0.52s;
  --flow-node-stagger: 0.085s;
  --flow-connector-duration: 0.42s;
  --flow-connector-gap: 0.2s;
  --flow-tail-pulse: 2.75s;
  background: transparent;
  max-width: min(100%, 42rem);
  margin: 0 auto;
}

.email-flow.email-flow--concealed {
  display: none !important;
}

.email-flow__scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.email-flow__svg {
  display: block;
  width: 100%;
  max-width: min(100%, 26rem);
  min-width: min(260px, 100%);
  height: auto;
  margin: 0 auto;
  background: transparent;
}

.email-flow__rect {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(196, 181, 253, 0.42);
  stroke-width: 1.25;
}

.email-flow__label {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  fill: #e8e9f4;
  text-anchor: middle;
}

.email-flow__label--tight {
  font-size: 11.25px;
}

.email-flow__connector {
  fill: none;
  stroke: rgba(167, 139, 250, 0.7);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.email-flow__node {
  opacity: 0;
  transform: translateY(12px);
}

.email-flow--static .email-flow__node {
  opacity: 1;
  transform: none;
}

.email-flow--static .email-flow__connector {
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .email-flow--play .email-flow__node {
    animation: email-flow-node-in var(--flow-node-duration) cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .email-flow--play .email-flow__node[data-flow-step="0"] { animation-delay: calc(var(--flow-node-stagger) * 0); }
  .email-flow--play .email-flow__node[data-flow-step="1"] { animation-delay: calc(var(--flow-node-stagger) * 1); }
  .email-flow--play .email-flow__node[data-flow-step="2"] { animation-delay: calc(var(--flow-node-stagger) * 2); }
  .email-flow--play .email-flow__node[data-flow-step="3"] { animation-delay: calc(var(--flow-node-stagger) * 3); }
  .email-flow--play .email-flow__node[data-flow-step="4"] { animation-delay: calc(var(--flow-node-stagger) * 4); }
  .email-flow--play .email-flow__node[data-flow-step="5"] { animation-delay: calc(var(--flow-node-stagger) * 5); }
  .email-flow--play .email-flow__node[data-flow-step="6"] { animation-delay: calc(var(--flow-node-stagger) * 6); }
  .email-flow--play .email-flow__node[data-flow-step="7"] { animation-delay: calc(var(--flow-node-stagger) * 7); }

  .email-flow--play .email-flow__connector { animation: email-flow-draw var(--flow-connector-duration) ease forwards; }
  .email-flow--play .email-flow__connector[data-connector="0"] { animation-delay: calc(var(--flow-node-stagger) * 0 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="1"] { animation-delay: calc(var(--flow-node-stagger) * 1 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="2"] { animation-delay: calc(var(--flow-node-stagger) * 2 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="3"] { animation-delay: calc(var(--flow-node-stagger) * 3 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="4"] { animation-delay: calc(var(--flow-node-stagger) * 4 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="5"] { animation-delay: calc(var(--flow-node-stagger) * 5 + var(--flow-node-duration) + var(--flow-connector-gap)); }
  .email-flow--play .email-flow__connector[data-connector="6"] { animation-delay: calc(var(--flow-node-stagger) * 6 + var(--flow-node-duration) + var(--flow-connector-gap)); }

  .email-flow--play .email-flow__node--tail .email-flow__rect {
    animation: email-flow-tail-pulse var(--flow-tail-pulse) ease-in-out calc(var(--flow-node-stagger) * 7 + var(--flow-node-duration) + 0.28s) infinite;
  }
}

@keyframes email-flow-node-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes email-flow-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes email-flow-tail-pulse {
  0%, 100% { stroke: rgba(196, 181, 253, 0.5); }
  50% { stroke: rgba(224, 213, 255, 0.95); }
}

@media (max-width: 720px) {
  .timeline-modal {
    width: min(98vw, 100%);
  }

  .timeline {
    max-width: none;
  }

  .timeline__spine {
    display: none;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 1rem;
    padding-bottom: 2.1rem;
  }

  .timeline__item::before {
    display: none;
  }

  .timeline__item:nth-child(odd) .timeline__year,
  .timeline__item:nth-child(even) .timeline__year {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    text-align: left;
  }

  .timeline__item:nth-child(odd) .timeline__card,
  .timeline__item:nth-child(even) .timeline__card {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
  }

  .timeline__year-pill {
    white-space: normal;
  }

  .timeline__item:nth-child(odd) .timeline__card:hover,
  .timeline__item:nth-child(even) .timeline__card:hover {
    transform: none;
  }
}

/* Closing */
.closing {
  margin-top: 3.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(167, 139, 250, 0.2);
  text-align: center;
}

.closing p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.closing a {
  font-weight: 600;
}

/* Scroll / reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
    border-color 0.3s ease,
    box-shadow 0.35s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal].pillar.is-visible,
[data-reveal].timeline__item.is-visible {
  transform: translateY(0);
}

/* Keyframes */
@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes gradient-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes orb-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(6vw, 8vh) scale(1.06);
  }
}

@keyframes grid-breathe {
  from {
    opacity: 0.75;
  }
  to {
    opacity: 1;
  }
}

@keyframes pillar-scan {
  0%,
  100% {
    background-position: -40% 0;
  }
  50% {
    background-position: 140% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .email-flow__node {
    opacity: 1;
    transform: none;
  }

  .email-flow__connector {
    stroke-dashoffset: 0;
  }

  .email-flow--play .email-flow__node,
  .email-flow--play .email-flow__connector,
  .email-flow--play .email-flow__node--tail .email-flow__rect {
    animation: none !important;
  }

  .site-header,
  .hero-eyebrow,
  .hero-eyebrow::before,
  .hero-title,
  .hero-lead,
  .hero-title .gradient,
  .page-bg::before,
  .page-bg::after,
  .pillar::before,
  .section-divider__gem {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  [data-reveal]  .pillar.is-visible:hover {
    transform: none;
    box-shadow: none;
  }

  .nav-back:hover {
    transform: none;
  }

  .timeline__spine {
    transition: none !important;
    transform: scaleY(1) !important;
  }

  .timeline__item::before {
    transition: none !important;
    opacity: 1 !important;
    transform: scale(1) !important;
  }

  .timeline__item:nth-child(odd) .timeline__card:hover,
  .timeline__item:nth-child(even) .timeline__card:hover {
    transform: none;
  }

}
