/* One job's night: four-station horizontal rail (vertical on phone) */

.story-section {
  width: 100%;
}

.story-stage {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 65% 80% at 50% 0%, rgba(61, 196, 152, 0.08), transparent 72%),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-rail-wrap {
  position: relative;
}

.story-rail-track {
  position: absolute;
  top: 20px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.story-rail-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--rail-scale, 0));
  background: linear-gradient(90deg, rgba(61, 196, 152, 0.55), var(--accent-ink));
  box-shadow: 0 0 12px rgba(61, 196, 152, 0.5);
}

.story-stations {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.story-station {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  color: inherit;
}

.station-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 18px;
  transition: border-color 260ms var(--ease), color 260ms var(--ease), background-color 260ms var(--ease), box-shadow 260ms var(--ease), transform 220ms var(--ease);
}

.story-station:hover .station-dot {
  border-color: var(--control-line);
  color: var(--ink);
}

.story-station.is-passed .station-dot {
  border-color: rgba(61, 196, 152, 0.48);
  color: var(--accent-ink);
}

.story-station.is-active .station-dot {
  border-color: var(--accent);
  background: #0d2621;
  color: var(--accent);
  box-shadow: 0 0 22px rgba(61, 196, 152, 0.45);
  transform: scale(1.06);
}

.station-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.station-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 240ms var(--ease);
}

.station-tag {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-3);
  transition: color 240ms var(--ease);
}

.story-station.is-active .station-name {
  color: var(--ink);
}

.story-station.is-active .station-tag {
  color: var(--accent-ink);
}

/* Traveling Job Card Lane (sized tightly to the card) */
.story-lane {
  position: relative;
  width: 100%;
}

.story-card {
  position: relative;
  width: 324px;
  min-height: 134px;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 196, 152, 0.42);
  background: var(--surface-solid);
  box-shadow: 0 10px 30px rgba(2, 6, 10, 0.5), 0 0 24px rgba(61, 196, 152, 0.14);
  padding: 15px 17px;
  display: flex;
  align-items: center;
  transform: translateX(var(--card-x, 0px));
  transition: transform 620ms var(--ease), border-color 260ms var(--ease), box-shadow 260ms var(--ease);
  will-change: transform;
}

.card-face {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.card-face[hidden] { display: none; }
.card-face.is-entering {
  animation: face-in 300ms var(--ease) both;
}

@keyframes face-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.face-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.face-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.face-sub {
  font-size: 13px;
  color: var(--ink-2);
}
.face-sub.is-mint {
  color: var(--accent-ink);
  font-weight: 500;
}

.face-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-wash);
  border: 1px solid rgba(61, 196, 152, 0.35);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.face-badge.is-bright {
  background: var(--accent-tint);
  border-color: var(--accent);
}

/* Face 0: Find (job title, company, and three ticks matching hero chips) */
.find-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.find-tick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-wash);
  border: 1px solid rgba(61, 196, 152, 0.35);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
}
.find-tick .ph {
  font-size: 13px;
  color: var(--accent);
}
.card-face.is-entering .find-tick {
  animation: item-in 320ms var(--ease) both;
}
.card-face.is-entering .find-tick.t1 { animation-delay: 80ms; }
.card-face.is-entering .find-tick.t2 { animation-delay: 240ms; }
.card-face.is-entering .find-tick.t3 { animation-delay: 400ms; }

/* Face 1: Write (three tailored resume lines appearing in turn) */
.resume-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resume-item {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
  padding-left: 11px;
  border-left: 2px solid var(--accent);
  white-space: nowrap;
}
.card-face.is-entering .resume-item {
  animation: item-in 360ms var(--ease) both;
}
.card-face.is-entering .resume-item.r1 { animation-delay: 100ms; }
.card-face.is-entering .resume-item.r2 { animation-delay: 420ms; }
.card-face.is-entering .resume-item.r3 { animation-delay: 740ms; }

/* Face 2: Apply (three rows ticking in turn, then Sent stamp) */
.apply-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apply-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
  white-space: nowrap;
}

.apply-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
}

.card-face.is-entering .apply-row {
  animation: item-in 300ms var(--ease) both;
}
.card-face.is-entering .apply-row.a1 { animation-delay: 80ms; }
.card-face.is-entering .apply-row.a2 { animation-delay: 380ms; }
.card-face.is-entering .apply-row.a3 { animation-delay: 680ms; }

.sent-stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 12px;
  font-weight: 700;
}
.card-face.is-entering .sent-stamp {
  animation: stamp-in 340ms var(--ease) 960ms both;
}

/* Face 3: Reply (inbox preview) */
.reply-preview {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  white-space: nowrap;
}
.card-face.is-entering .reply-preview {
  animation: item-in 360ms var(--ease) 160ms both;
}

@keyframes item-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes stamp-in {
  from { opacity: 0; transform: scale(1.22); }
  to { opacity: 1; transform: scale(1); }
}

/* Vertical rail on phone */
@media (max-width: 720px) {
  .story-stage {
    padding: 18px 16px;
    gap: 16px;
  }
  .story-rail-track {
    top: 20px;
    bottom: 20px;
    left: 19px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .story-rail-fill {
    width: 100%;
    height: 100%;
    transform-origin: top center;
    transform: scaleY(var(--rail-scale, 0));
    background: linear-gradient(180deg, rgba(61, 196, 152, 0.55), var(--accent-ink));
  }
  .story-stations {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .story-station {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0;
    gap: 12px;
  }
  .station-copy {
    align-items: flex-start;
  }
  .story-card {
    width: 100%;
    min-height: 130px;
    transform: none;
  }
  .resume-item,
  .apply-row,
  .reply-preview {
    white-space: normal;
  }
}

/* Reduced motion: still readable state with all four faces visible */
@media (prefers-reduced-motion: reduce) {
  .story-rail-fill {
    transform: scaleX(1);
  }
  .story-station .station-dot {
    border-color: var(--accent);
    background: #0d2621;
    color: var(--accent);
  }
  .story-station .station-name { color: var(--ink); }
  .story-station .station-tag { color: var(--accent-ink); }
  .story-lane {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .story-card {
    display: contents;
  }
  .card-face,
  .card-face[hidden] {
    display: flex;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-solid);
    padding: 14px 16px;
  }
  .resume-item,
  .apply-row,
  .reply-preview {
    white-space: normal;
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .story-rail-fill {
    transform: scaleY(1);
  }
  .story-lane {
    grid-template-columns: minmax(0, 1fr);
  }
}
