/* ============================================================
   ABOUT / MY STORY page — v7
   - 5 chronological prose sections
   - Photos full-bleed black band with edge mask fade (reel-style)
   - Prose centered, max ~70ch, with comfortable rhythm
   ============================================================ */

.story-page { color: var(--text); }
.story-page .page { max-width: 1240px; }

/* ── INTRO ─────────────────────────────────── */
.story-intro {
  padding: 88px 0 56px;
  max-width: 760px;
}
.story-intro p {
  font-family: var(--font-serif);
  font-size: clamp(22px, 1.8vw, 26px);
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 22px;
  text-wrap: pretty;
  letter-spacing: 0.005em;
}
.story-intro p:last-child {
  color: var(--text-dim);
  margin: 0;
}
.story-intro p strong {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ── NAV ─────────────────────────────────────
   Sits AFTER the timeline. Pulls the spacing in a little so it visually
   hands off into the prose sections below. */
.story-nav {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.story-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-right: 1px solid var(--line);
  position: relative;
  transition: color 180ms ease;
}
.story-nav__item:last-child { border-right: none; }
.story-nav__item::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(.2,.6,.2,1);
}
.story-nav__item:hover,
.story-nav__item.is-active { color: var(--text); }
.story-nav__item:hover::after,
.story-nav__item.is-active::after { transform: scaleX(1); }
.story-nav__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.story-nav__item.is-active .story-nav__num { color: var(--accent); }
.story-nav__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
}

/* ── HORIZONTAL TIMELINE ──────────────────────
   Now sits ABOVE the nav. Keep its bottom padding tight so the two
   read as a paired header block. */
.story-timeline {
  padding: 16px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.story-tl {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  min-height: 240px;
}
.story-tl::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4%;
  right: 4%;
  height: 1px;
  background: var(--line-strong);
}
.story-tl__item {
  position: relative;
  height: 100%;
}
.story-tl__btn {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  text-align: center;
  padding: 0 8px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 200ms ease;
}
.story-tl__btn:hover,
.story-tl__btn:focus-visible { outline: none; }
.story-tl__btn:hover .story-tl__role,
.story-tl__item.is-active .story-tl__role { color: var(--accent); }
.story-tl__btn:hover .story-tl__node,
.story-tl__item.is-active .story-tl__node {
  transform: scale(1.45);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--accent-soft);
}
.story-tl__item--warm .story-tl__btn:hover .story-tl__node,
.story-tl__item--warm.is-active .story-tl__node {
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--warm-soft);
}
.story-tl__node {
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.story-tl__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 14px;
  max-width: 150px;
}
.story-tl__item--below .story-tl__txt {
  grid-row: 3;
  padding: 14px 0 0;
}
.story-tl__role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
  line-height: 1.25;
}
.story-tl__org {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.35;
}
.story-tl__node {
  grid-row: 2;
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  z-index: 2;
}
.story-tl__item--warm  .story-tl__node { background: var(--warm); }
.story-tl__item--muted .story-tl__node { background: var(--text-muted); }
.story-tl__node::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--line-strong);
}
.story-tl__item--above .story-tl__node::after {
  bottom: 100%;
  height: 14px;
}
.story-tl__item--below .story-tl__node::after {
  top: 100%;
  height: 14px;
}
.story-tl__yr {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.story-tl__item--above .story-tl__yr {
  grid-row: 3;
  padding-top: 12px;
}
.story-tl__item--below .story-tl__yr {
  grid-row: 1;
  align-self: end;
  padding-bottom: 12px;
}

/* Expanding detail panel under the timeline */
.story-tl-detail {
  margin-top: 18px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease, margin-top 200ms ease;
}
.story-tl-detail.is-open {
  max-height: 240px;
  opacity: 1;
  margin-top: 24px;
}
.story-tl-detail__inner {
  position: relative;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding: 18px 56px 18px 22px;
  border-radius: 2px;
}
.story-tl__item--warm.is-active ~ .story-tl-detail .story-tl-detail__inner,
.story-tl-detail .story-tl-detail__inner[data-kind="warm"] {
  background: var(--warm-soft);
  border-left-color: var(--warm);
}
.story-tl-detail__meta {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.story-tl-detail__yr {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.story-tl-detail__role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.story-tl-detail__org {
  font-size: 13px;
  color: var(--text-dim);
}
.story-tl-detail__body {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
  max-width: 70ch;
}
.story-tl-detail__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 160ms;
}
.story-tl-detail__close:hover { color: var(--text); }

/* ── MAIN ────────────────────────────────────
   Sections live outside .page so the photo bands can go full-bleed.
   Prose is centered with a wide-but-readable measure. */
.story-main {
  padding: 32px 0 96px;
}

.story-section {
  padding: 0 0 64px;
  scroll-margin-top: 96px;
}
.story-section:last-child { padding-bottom: 0; }

/* Plain sections (no photo band): constrain to page width and left-align text */
.story-section:not(.story-section--row) {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
  box-sizing: border-box;
}
.story-section:not(.story-section--row) .story-anchor {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.story-section:not(.story-section--row) .story-prose {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.story-prose,
.story-anchor {
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

.story-anchor {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(28px, 2.4vw, 40px);
  line-height: 1.15;
  color: var(--accent);
  margin: 0 0 32px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.story-anchor em { font-style: normal; }

.story-prose p {
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 26px;
  text-wrap: pretty;
  letter-spacing: 0.005em;
}
.story-prose p:last-child { margin-bottom: 0; }
.story-prose p strong {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.story-prose p em {
  color: var(--accent);
  font-style: italic;
}

/* ── PHOTO + TEXT ROW ───────────────────────────
   For sections with a side-by-side image + prose layout.
   The entire section is a full-bleed black band; prose sits on top of
   the black, photo is positioned in its half with a symmetric mask. */
.story-section--row {
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  background: #000;
}
.story-section--row .story-anchor,
.story-section--row .story-prose {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

.story-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}
.story-row__col {
  min-width: 0;
  max-width: 56ch;
}
.story-section--photo-right .story-row__col { justify-self: start; }
.story-section--photo-left  .story-row__col { justify-self: end; }

.story-row__photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
/* Push the photo column inward from the viewport edge so the image
   isn't crowding the screen border. */
.story-section--photo-right .story-row__photo { padding-right: clamp(24px, 5vw, 96px); }
.story-section--photo-left  .story-row__photo { padding-left:  clamp(24px, 5vw, 96px); }

/* The photo container — transparent now, since the section provides the
   black background. */
.story-row__band {
  position: relative;
  height: clamp(360px, 48vw, 600px);
  overflow: hidden;
}
.story-row__band img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
}
/* Mask fades only on the INNER edge (side facing the text).
   The outer edge stays sharp — the photo butts against the solid black band. */
.story-section--photo-right .story-row__band img {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 33%, #000 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 33%, #000 100%);
}
.story-section--photo-left .story-row__band img {
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 67%, transparent 100%);
          mask-image: linear-gradient(to right, #000 0%, #000 67%, transparent 100%);
}

/* Per-section size variations */
#early    .story-row__band  { height: clamp(468px, 62vw, 780px); }  /* DIY · 1.3x */
#engineer .story-row__band  { height: clamp(432px, 58vw, 720px); }  /* industrial · 1.2x */
#teaching .story-row__band  { height: clamp(396px, 54vw, 660px); }  /* teaching · 1.1x */
#book     .story-row__band  { height: clamp(432px, 58vw, 720px); }  /* writing · 1.2x */

.story-row__cap {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: 0.005em;
}
.story-section--photo-right .story-row__cap { text-align: left; }
.story-section--photo-left  .story-row__cap { text-align: right; }

/* ── PHOTO BANDS — LEGACY (full-bleed centered)
   Full-bleed black band, image absolutely positioned and centered,
   contained (no crop), with a horizontal mask fade at 33%/67%. ── */
.story-photo {
  margin: 56px 0 0;
}
.story-section .story-prose + .story-photo { margin-top: 72px; }
.story-section .story-photo + .story-prose { margin-top: 72px; }

.story-photo__band {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-photo__band img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  border: none;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 33%, #000 67%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 33%, #000 67%, transparent 100%);
}

/* size variants — control the band HEIGHT (like .reel) */
.story-photo--large  .story-photo__band { height: clamp(360px, 56vw, 720px); }
.story-photo--medium .story-photo__band { height: clamp(320px, 48vw, 600px); }

.story-photo__cap {
  display: block;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: 0.005em;
  margin: 22px auto 0;
  padding: 0 32px;
  max-width: 600px;
}

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 980px) {
  /* Stack photo + text rows vertically. Photo first, then prose. */
  .story-row {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px 24px;
  }
  .story-section--photo-left .story-row > .story-row__photo,
  .story-section--photo-right .story-row > .story-row__photo {
    order: -1;
    padding-left: 0;
    padding-right: 0;
  }
  .story-row__col {
    max-width: none;
    padding: 0;
  }
  .story-row__cap,
  .story-section--photo-right .story-row__cap,
  .story-section--photo-left  .story-row__cap {
    text-align: center;
  }
  .story-section--row .story-row__band { height: clamp(220px, 60vw, 360px); }

  /* Stack the horizontal timeline into a tidy vertical list */
  .story-timeline { padding: 48px 0 64px; }
  .story-tl {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    min-height: 0;
    gap: 0;
  }
  .story-tl::before {
    top: 0; bottom: 0;
    left: 90px;
    width: 1px;
    height: auto;
    right: auto;
  }
  .story-tl__item,
  .story-tl__item--above,
  .story-tl__item--below {
    display: grid;
    grid-template-columns: 80px 18px 1fr;
    grid-template-rows: auto;
    text-align: left;
    justify-items: start;
    padding: 14px 0;
    height: auto;
  }
  .story-tl__item--above .story-tl__txt,
  .story-tl__item--below .story-tl__txt {
    grid-row: 1;
    grid-column: 3;
    padding: 0;
    max-width: none;
  }
  .story-tl__item--above .story-tl__yr,
  .story-tl__item--below .story-tl__yr {
    grid-row: 1;
    grid-column: 1;
    padding: 4px 0 0;
    text-align: right;
    justify-self: end;
  }
  .story-tl__node {
    grid-row: 1;
    grid-column: 2;
    align-self: start;
    margin-top: 6px;
  }
  .story-tl__node::after { display: none; }

  .story-main { padding: 64px 0 80px; }
  .story-section { padding-bottom: 72px; }
}

@media (max-width: 820px) {
  .story-intro { padding: 56px 0 40px; }
  .story-intro p { font-size: 19px; }
  .story-nav { flex-wrap: wrap; }
  .story-nav__item { flex: 1 1 50%; padding: 16px 0; border-right: 1px solid var(--line); }
  .story-nav__item:nth-child(2n) { border-right: none; }
  .story-nav__label { font-size: 15px; }

  .story-anchor { font-size: 24px; margin-bottom: 22px; }
  .story-prose p { font-size: 18px; line-height: 1.6; margin-bottom: 22px; }
  .story-section--row .story-prose,
  .story-section--row .story-anchor { padding-left: 24px; padding-right: 24px; }
  .story-section:not(.story-section--row) { padding-left: 20px; padding-right: 20px; }

  .story-photo__band { /* sizes already clamp on mobile via the variant clamps */ }
  .story-photo--large  .story-photo__band { height: clamp(220px, 60vw, 360px); }
  .story-photo--medium .story-photo__band { height: clamp(200px, 55vw, 320px); }
  .story-photo__cap { font-size: 14px; margin-top: 16px; }
}
