/* threads-hero.css
   "The Threads" on the About page. A scroll-driven story (typed headline,
   four traits, a "Now" block) that ends on links back to the work. Colors
   and fonts come from the tokens in concept-timeline.css, so load this after
   it. Motion: js/threads-hero.js. */

.th {
  --th-side: 24px;
  --th-bar: 76px;
  --th-text: rgba(243, 245, 236, 0.86);
  --th-text-2: rgba(243, 245, 236, 0.7);
  --th-inactive: rgba(243, 245, 236, 0.5);
  --th-sep: rgba(243, 245, 236, 0.3);
  --th-reveal: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

.th a { color: inherit; }

.th :focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* ---------- sticky top bar ---------- */

.th-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--th-bar);
  padding: 0 var(--th-side);
  background: var(--bg);
}

.th-bar-row {
  height: 44px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.th-name {
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

.th-skip {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}

/* Name first, role one step down the hierarchy. */
.th-role {
  margin-left: 4px;
  font-weight: 500;
  color: var(--th-text-2);
}

/* The full role title won't share a phone-width bar with the work link. */
@media (max-width: 599px) {
  .th-role { display: none; }
}

.th-skip { white-space: nowrap; }

.th-skip:hover, .th-name:hover, .th-name:hover .th-role { color: var(--lime); }

.th-nav {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.th-nav-word {
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  color: var(--th-inactive);
  transition: color 0.3s, border-color 0.3s;
}

.th .th-nav-word { color: var(--th-inactive); }
.th .th-nav-word.is-active { color: var(--ink); border-bottom-color: var(--lime); }
.th .th-nav.is-now .th-nav-word { color: var(--ink); border-bottom-color: transparent; }
.th-nav-word.is-flying { opacity: 0; }

.th-sep {
  width: 1px;
  height: 10px;
  background: var(--th-sep);
}

/* Draws in across the bar bottom as the intro ends: the divider into the reel. */
.th-rule {
  position: absolute;
  left: var(--th-side);
  right: var(--th-side);
  bottom: 0;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- opening (pinned) ---------- */

.th-open {
  height: calc(100vh - var(--th-bar) + 640px);
  height: calc(100svh - var(--th-bar) + 640px);
}

.th-stage {
  position: sticky;
  top: var(--th-bar);
  height: calc(100vh - var(--th-bar));
  height: calc(100svh - var(--th-bar));
  display: flex;
  flex-direction: column;
  padding: 0 calc(var(--th-side) + 4px) 80px var(--th-side);
}

.th-cover {
  display: block;
  flex: 1;
  min-height: 0;
  margin: 8px -4px 26px 0;
  border-radius: 4px;
  overflow: hidden;
  transform-origin: 50% 100%;
}

.th-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.th-head,
.th-ov {
  font-weight: 800;
  font-size: 37px;
  line-height: 0.9;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.th-head { margin: 0; }

.th-w { transition: opacity 0.3s; }

/* Untyped letters keep their space so typing never reflows the layout. */
.th-c { color: transparent; }
.th-c.is-on { color: inherit; }

.th-caret {
  display: inline-block;
  width: 0;
  position: relative;
}

.th-caret::after {
  content: '';
  position: absolute;
  left: 2px;
  top: -0.78em;
  width: 3px;
  height: 0.82em;
  background: var(--lime);
}

.th-caret.is-off::after { opacity: 0; }

/* "how / everything / worked." stacked copy that slides and grows. */
.th-ov {
  position: absolute;
  left: var(--th-side);
  bottom: 80px;
  transform-origin: left bottom;
  pointer-events: none;
  opacity: 0;
}

.th-ov-w { width: max-content; }

/* ---------- trait sections ---------- */

.th-sec {
  padding: 40px var(--th-side) 120px;
}

.th-mast {
  position: relative;
  z-index: 6;
  width: max-content;
  margin: 0;
  font-weight: 900;
  font-size: 54px;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  transform-origin: left top;
}

.th-body { margin-top: 28px; }

.th.js .th-body,
.th.js .th-now {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--th-reveal), transform 0.7s var(--th-reveal);
}

.th.js .th-body.is-in,
.th.js .th-now.is-in {
  opacity: 1;
  transform: none;
}

.th-sub {
  margin: 0;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.th-fig {
  margin: 26px calc(var(--th-side) * -1) 0;
  height: 300px;
  overflow: hidden;
}

.th-fig--tall { height: 440px; }

.th-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  transform: scale(1.12);
}

/* Portrait photo: crop and zoom from the top so any trim comes off the feet. */
.th-fig--tall img {
  object-position: 50% 0;
  transform-origin: 50% 0;
}

.th-quote {
  position: relative;
  margin: 26px 0 0;
  padding-left: 22px;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--th-text);
  text-wrap: pretty;
}

.th-quote p { margin: 0; }

.th-quote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: -6px;
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
}

.th-story {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.th-story[hidden] { display: none; }

.th-story p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--th-text-2);
  text-wrap: pretty;
}

.th-more {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  margin: 10px 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.th-more:hover { color: var(--lime); }

/* ---------- "Now" block ---------- */

/* Pins in place (top set by threads-hero.js) while the reel slides up over
   it. This spacer is the runway the reel overlaps; it has to be content, not
   padding, because a sticky element stays inside its container's content. */
.th::after {
  content: '';
  display: block;
  height: 100vh;
  height: 100dvh;
}

.th-now {
  position: sticky;
  top: var(--th-bar);
  padding: 32px var(--th-side);
}

.th-now-statement {
  margin: 0 0 34px;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.th-now-rows { margin: 0; }

.th-now-row {
  border-top: 1px solid var(--line);
  padding: 14px 0 16px;
}

.th-now-row dt {
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.th-now-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 22px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease);
}

.th-now-cta:hover { color: var(--lime); }

.th-now-row dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--th-text-2);
}

/* ---------- closing links ---------- */

.th-end {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 56px 24px 64px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

.th-end a { color: inherit; }

.th-end-link {
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.th-end-link:hover { color: var(--lime); }

.th-end-contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s var(--ease);
}

.th-end-contact:hover { color: var(--lime); }

.th-end :focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* ---------- desktop adaptation (not in the mobile handoff) ---------- */

@media (min-width: 1024px) {
  .th { --th-side: 40px; }
  .th-end { padding-left: 40px; padding-right: 40px; }

  .th-stage {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: minmax(0, 1fr);
    column-gap: 48px;
    align-items: end;
    padding: 16px var(--th-side) 64px;
  }

  .th-cover {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    margin: 0;
  }

  /* Chris is the kid on the right of the horizontal print. */
  .th-cover img { object-position: 72% 50%; }

  .th-head {
    grid-column: 1;
    grid-row: 1;
  }

  .th-head,
  .th-ov { font-size: clamp(34px, 4.4vw, 76px); }

  .th-ov { bottom: 64px; }

  .th-sec {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px var(--th-side) 160px;
  }

  .th-mast { font-size: clamp(54px, 7.2vw, 112px); }

  .th-body {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto auto auto auto 1fr;
    column-gap: 64px;
    margin-top: 40px;
  }

  .th-sub, .th-quote, .th-story, .th-more { grid-column: 1; }

  .th-sub { font-size: clamp(24px, 2.2vw, 32px); }

  .th-quote { margin-top: 32px; }

  .th-fig {
    grid-column: 2;
    grid-row: 1 / -1;
    margin: 0;
    height: 560px;
  }

  .th-fig--tall { height: 680px; }

  .th-now {
    max-width: 1280px;
    margin: 0 auto;
  }

  .th-now-statement {
    max-width: 1000px;
    font-size: clamp(34px, 4.4vw, 64px);
    margin-bottom: 48px;
  }

  .th-now-rows {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 32px;
  }
}

/* ---------- reduced motion: no pin, no fly-ups, plain fades ---------- */

@media (prefers-reduced-motion: reduce) {
  .th-open { height: auto; }

  .th-stage {
    position: relative;
    top: auto;
  }

  .th-w { transition: none; }

  .th-fig img { transform: none; }

  .th.js .th-body,
  .th.js .th-now {
    transform: none;
    transition: opacity 0.4s linear;
  }
}
