/* ============================================================
   HavenLink - Team page ("The People" - cinematic editorial)
   Requires editorial.css (tokens, primitives, nav/footer re-skin)
   loaded before this sheet. Classes prefixed tm-.

   Contents:
     0. Shared: masked line reveals
     1. Hero - ink constellation
     2. Manifesto
     3. Founders - editorial plates
     4. Ledger lists + hover lens
     5. Global-reach map framing
     6. Belief band
     7. Responsive
     8. Reduced motion
   ============================================================ */

.tm-main {
  overflow-x: clip;
}

/* ==================== 0. Masked line reveals ====================
   <span class="tm-mask"><span class="tm-mask-in">line</span></span>
   inside any .hm-reveal ancestor: the line rises out of its clip
   when editorial.js marks the ancestor .is-in. Stagger via --d. */

.tm-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;   /* keep descenders clear of the clip */
  margin-bottom: -0.09em;
  padding-right: 0.06em;    /* italic overhang */
}

.tm-mask-in {
  display: block;
}

html.js body.editorial .tm-mask-in {
  transform: translateY(120%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

html.js body.editorial .hm-reveal.is-in .tm-mask-in {
  transform: translateY(0);
}

/* ==================== 1. Hero ==================== */

.tm-hero {
  position: relative;
  min-height: calc(100vh - var(--hm-nav-h));
  min-height: calc(100svh - var(--hm-nav-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--ink-deep);
  background-image:
    radial-gradient(120% 90% at 76% 22%, rgba(180, 85, 31, 0.18), transparent 62%),
    radial-gradient(90% 80% at 8% 100%, rgba(20, 33, 61, 0.9), transparent 70%);
}

/* oversized so the JS scroll parallax never exposes an edge */
.tm-hero-canvas {
  position: absolute;
  left: 0;
  top: -10%;
  width: 100%;
  height: 120%;
  pointer-events: none;
  will-change: transform;
}

.tm-hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding: clamp(3.5rem, 9vh, 6.5rem) var(--gutter) 0;
  will-change: transform, opacity;
}

.tm-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
}

.tm-hero-rule {
  width: clamp(3rem, 9vw, 8rem);
  height: 1px;
  background: rgba(250, 248, 245, 0.28);
}

.tm-hero-vol {
  margin-left: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: rgba(250, 248, 245, 0.45);
  white-space: nowrap;
}

body.editorial .tm-hero-title {
  font-size: clamp(3rem, 8.5vw, 7.25rem);
  font-weight: 400;
  line-height: 0.99;
  letter-spacing: -0.028em;
  font-variation-settings: "opsz" 144;
  color: var(--paper);
  margin: 0 0 clamp(1.75rem, 4.5vh, 2.75rem);
}

.tm-hero-title em {
  font-style: italic;
  color: #e4b79a;
}

.tm-hero-standfirst {
  font-size: var(--text-lede);
  line-height: 1.65;
  font-weight: 420;
  color: rgba(250, 248, 245, 0.72);
  max-width: 36rem;
  margin: 0 0 clamp(2.25rem, 5.5vh, 3.5rem);
}

.tm-hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* bottom strip: scroll cue + live counters (stays pinned while the
   inner content parallaxes away above it) */
.tm-hero-foot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  margin-top: clamp(3rem, 7vh, 5rem);
  padding: 1.5rem var(--gutter) 1.7rem;
  border-top: var(--hairline-inv);
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.tm-scrollcue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--text-eyebrow);
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}

.tm-scrollcue-line {
  display: inline-block;
  width: 1px;
  height: 26px;
  background: rgba(250, 248, 245, 0.85);
  transform-origin: top;
  animation: tm-cue 2.4s var(--ease-out) infinite;
}

@keyframes tm-cue {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.tm-hero-stats {
  display: flex;
  gap: clamp(1.75rem, 5vw, 4.5rem);
  margin: 0 0 0 auto;
}

.tm-stat {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.tm-stat-num {
  order: 1;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-weight: 420;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1;
  color: var(--paper);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.tm-stat-label {
  order: 2;
  margin-top: 0.5rem;
  font-size: var(--text-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 540;
  color: rgba(250, 248, 245, 0.5);
  white-space: nowrap;
}

/* ==================== 2. Manifesto ==================== */

.tm-section {
  padding-block: var(--section-pad);
}

.tm-section--dim {
  background: var(--paper-dim);
}

.tm-manifesto-statement {
  grid-column: 1 / span 8;
  max-width: 24ch;
}

.tm-manifesto-aside {
  grid-column: 10 / span 3;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tm-manifesto-aside p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.tm-manifesto-rule {
  display: block;
  width: 3.5rem;
  height: 2px;
  background: var(--terracotta);
}

html.js body.editorial .tm-manifesto-rule {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease-out) 0.35s;
}

html.js body.editorial .tm-manifesto-aside.is-in .tm-manifesto-rule {
  transform: scaleX(1);
}

/* ==================== 3. Founders ==================== */

.tm-lede {
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--muted);
  max-width: 40rem;
  margin-top: -1.5rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

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

.tm-person {
  position: relative;
  padding: clamp(3rem, 7vh, 5rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  border-top: var(--hairline);
}

.tm-people .tm-person:last-child {
  border-bottom: var(--hairline);
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

/* outlined ghost numeral floating behind each plate */
.tm-person-ghost {
  position: absolute;
  top: clamp(0.5rem, 2vh, 1.5rem);
  right: -1rem;
  z-index: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 340;
  font-size: clamp(8rem, 18vw, 15rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(20, 33, 61, 0.1);
  pointer-events: none;
  user-select: none;
}

@supports not (-webkit-text-stroke: 1px black) {
  .tm-person-ghost {
    color: rgba(20, 33, 61, 0.05);
  }
}

.tm-person:nth-child(even) .tm-person-ghost {
  right: auto;
  left: -1rem;
}

.tm-person-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  column-gap: clamp(1.25rem, 3vw, 2.25rem);
  row-gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
}

.tm-person-index {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--terracotta);
  letter-spacing: 0.04em;
}

body.editorial .tm-person-name {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 420;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96;
  margin: 0;
}

.tm-person-name em {
  font-style: italic;
  color: var(--terracotta);
}

.tm-person-role {
  margin: 0 0 0 auto;
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 560;
  color: var(--muted);
  white-space: nowrap;
}

.tm-person-plate {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: center;
}

.tm-person-portrait {
  grid-column: 1 / span 5;
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-dim);
}

.tm-person:nth-child(even) .tm-person-portrait {
  grid-column: 8 / span 5;
}

.tm-person-body {
  grid-column: 7 / span 6;
}

.tm-person:nth-child(even) .tm-person-body {
  grid-column: 1 / span 6;
  grid-row: 1;
}

/* image is taller than its frame: JS drifts it slowly on scroll */
.tm-person-portrait img {
  position: absolute;
  left: 0;
  top: -18px;
  width: 100%;
  height: calc(100% + 36px);
  object-fit: cover;
  will-change: transform;
}

/* paper curtain that wipes away when the plate enters the viewport */
.tm-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--paper);
}

html.js body.editorial .tm-veil {
  transform: scaleX(1);
  transform-origin: 100% 50%;
  transition: transform 1.05s var(--ease-out) 0.15s;
}

html.js body.editorial .tm-person:nth-child(even) .tm-veil {
  transform-origin: 0 50%;
}

html.js body.editorial .hm-reveal.is-in .tm-veil {
  transform: scaleX(0);
}

.tm-person-bio {
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.8;
  max-width: 36rem;
  margin: 0 0 1.9rem;
}

.tm-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tm-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: var(--hairline);
  border-radius: 50%;
  color: var(--ink);
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-out);
}

.tm-social a:hover {
  color: var(--terracotta);
  border-color: var(--terracotta);
  transform: translateY(-2px);
}

.tm-social .social-icon {
  width: 20px;
  height: 20px;
  color: inherit;
}

/* ==================== 4. Ledger lists + hover lens ==================== */

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

.tm-ledger-item {
  border-top: var(--hairline);
  transition: opacity 0.4s ease;
}

.tm-ledger-item:last-child {
  border-bottom: var(--hairline);
}

/* hovering one entry recedes the others */
.tm-ledger:has(.tm-ledger-link:hover) .tm-ledger-item:not(:hover) {
  opacity: 0.35;
}

.tm-ledger-link {
  display: grid;
  grid-template-columns: 2.5rem 5rem minmax(0, 1fr) 1.5rem;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: 2rem 0;
  text-decoration: none;
  color: inherit;
}

.tm-ledger-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(20, 33, 61, 0.4);
  transition: color 0.3s ease;
}

.tm-ledger-link:hover .tm-ledger-num {
  color: var(--terracotta);
}

.tm-ledger-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: var(--hairline);
}

.tm-section--dim .tm-ledger-logo {
  background: var(--paper-dim);
}

.tm-ledger-logo img {
  max-width: 74%;
  max-height: 74%;
  object-fit: contain;
  display: block;
}

.tm-ledger-text {
  display: flex;
  flex-direction: column;
  transition: transform 0.45s var(--ease-out);
}

.tm-ledger-link:hover .tm-ledger-text {
  transform: translateX(0.85rem);
}

.tm-ledger-name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  font-weight: 450;
  line-height: 1.15;
  font-variation-settings: "opsz" 40;
  color: var(--ink);
  margin: 0 0 0.4rem;
  transition: color 0.3s ease;
}

.tm-ledger-role {
  font-size: var(--text-meta);
  letter-spacing: 0.04em;
  color: var(--terracotta);
  margin: 0 0 0.35rem;
}

.tm-ledger-desc {
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.6;
  max-width: 46rem;
  margin: 0;
}

.tm-ledger-arrow {
  font-size: 1.1rem;
  color: rgba(20, 33, 61, 0.4);
  transition: color 0.3s ease, transform 0.3s var(--ease-out);
  justify-self: end;
}

.tm-ledger-link:hover .tm-ledger-arrow {
  color: var(--terracotta);
  transform: translateX(4px);
}

.tm-ledger-link:hover .tm-ledger-name {
  color: var(--terracotta);
}

/* ==================== 5. Global-reach map ==================== */

.tm-map {
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

/* cartographic plate: hairline mat + terracotta registration corners */
.tm-map-frame {
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  border: var(--hairline);
}

.tm-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid var(--terracotta);
  pointer-events: none;
}

.tm-corner--tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.tm-corner--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.tm-corner--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.tm-corner--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.tm-map .expansion-map {
  border: var(--hairline);
  background: var(--paper);
}

.tm-section--dim .tm-map .expansion-map {
  background: var(--paper-dim);
}

.tm-map-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
}

.tm-map .map-legend {
  margin-top: 1.5rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  font-size: var(--text-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 540;
  color: var(--muted);
}

.tm-map .map-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.tm-map .legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 2px;
  display: inline-block;
}

.tm-map .legend-partner {
  background: var(--ink);
}

.tm-map .legend-negotiating {
  background: var(--terracotta);
}

/* ==================== 6. Belief band ==================== */

.tm-belief {
  padding-block: clamp(7rem, 16vh, 12rem);
  background-image: radial-gradient(
    110% 100% at 82% 112%,
    rgba(180, 85, 31, 0.16),
    transparent 60%
  );
}

.tm-belief-quote {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 4.3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 100;
  color: var(--paper);
  max-width: 24ch;
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
}

.tm-belief-quote em {
  font-style: italic;
  color: #e4b79a;
}

.tm-belief-sig {
  margin: clamp(1.75rem, 4vh, 2.5rem) 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: rgba(250, 248, 245, 0.55);
}

.tm-belief-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

/* ==================== 7. Responsive ==================== */

@media (max-width: 900px) {
  .tm-manifesto-statement {
    grid-column: 1 / span 12;
  }

  .tm-manifesto-aside {
    grid-column: 1 / span 12;
    margin-top: 1.5rem;
    max-width: 32rem;
  }

  .tm-person-plate {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .tm-person-portrait,
  .tm-person:nth-child(even) .tm-person-portrait {
    grid-column: 1;
    max-width: 24rem;
  }

  .tm-person-body,
  .tm-person:nth-child(even) .tm-person-body {
    grid-column: 1;
    grid-row: auto;
  }

  .tm-person-role {
    margin-left: 0;
    width: 100%;
    white-space: normal;
  }

  .tm-person-ghost {
    top: auto;
    bottom: 0;
    font-size: clamp(6rem, 24vw, 9rem);
  }

  .tm-ledger-link {
    grid-template-columns: 3.5rem minmax(0, 1fr);
    row-gap: 0.75rem;
  }

  .tm-ledger-num {
    grid-row: 1;
  }

  .tm-ledger-logo {
    grid-row: 1 / span 2;
    grid-column: 1;
    width: 3.5rem;
  }

  .tm-ledger-text {
    grid-column: 2;
  }

  .tm-ledger-arrow {
    display: none;
  }
}

@media (max-width: 768px) {
  .tm-hero-vol {
    display: none;
  }

  .tm-hero-foot {
    flex-wrap: wrap;
    gap: 1.25rem 1.5rem;
    padding-right: max(var(--gutter), 88px); /* chat launcher clearance */
  }

  .tm-hero-stats {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1rem;
  }

  .tm-stat-label {
    white-space: normal;
  }

  .tm-hero-actions .hm-btn,
  .tm-belief-actions .hm-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==================== 8. Reduced motion ==================== */

@media (prefers-reduced-motion: reduce) {
  .tm-scrollcue-line {
    animation: none;
  }

  html.js body.editorial .tm-mask-in {
    transform: none !important;
    transition: none !important;
  }

  html.js body.editorial .tm-veil {
    transform: scaleX(0) !important;
    transition: none !important;
  }

  html.js body.editorial .tm-manifesto-rule {
    transform: none !important;
    transition: none !important;
  }

  .tm-ledger-item,
  .tm-ledger-text {
    transition: none;
  }
}
