/* Direction A — "A letter to the person who closes up".
   Editorial: paper ground, deep ink, Literata body, AllRoundGothic display,
   hairline rules, a left kicker rail on desktop. */

body {
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-size: 1.0625rem;
}

/* ------------------------------------------------------------- letterhead
   Floats over the hero as a soft glass pill. */
.tb-letterhead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1rem 0;
}
.tb-letterhead .tb-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(248, 249, 247, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
}
.tb-mark {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.tb-letterhead nav { display: flex; gap: 1.6rem; }
.tb-letterhead nav a {
  font-family: var(--tb-display);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}
.tb-letterhead nav a:hover { color: var(--tb-forest); }

/* ------------------------------------------------------------------- hero
   The photograph opens the page; the letter's type sits over it on the
   left, on a paper scrim that dissolves into the image and melts into the
   page at the bottom. */
.tb-hero {
  position: relative;
  min-height: 94svh;
  display: flex;
  align-items: center;
  padding: clamp(5.5rem, 10vw, 7rem) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}
.tb-hero-media { position: absolute; inset: 0; }
.tb-hero-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.tb-hero-video.is-playing { opacity: 1; }
.tb-hero-media.has-video img { animation: none; }
.tb-hero-media img,
.tb-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 40%;
}
@media (prefers-reduced-motion: no-preference) {
  .tb-hero-media img {
    transform-origin: 72% 45%;
    animation: tb-kenburns 38s ease-in-out infinite alternate;
  }
  @keyframes tb-kenburns { from { transform: scale(1); } to { transform: scale(1.055); } }
}
.tb-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(248, 249, 247, 0.97) 0%, rgba(248, 249, 247, 0.9) 28%, rgba(248, 249, 247, 0.5) 46%, rgba(248, 249, 247, 0) 64%),
    linear-gradient(180deg, rgba(248, 249, 247, 0) 78%, var(--tb-paper) 100%);
}
.tb-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 2.5rem, 82rem);
  margin-inline: auto;
}
.tb-hero-inner > * { max-width: 33rem; }
@media (max-width: 760px) {
  .tb-hero { align-items: flex-end; min-height: 96svh; padding-bottom: 3rem; }
  .tb-hero-media img, .tb-hero-media video { object-position: 62% 22%; }
  .tb-hero-scrim {
    background:
      linear-gradient(180deg, rgba(248, 249, 247, 0.55) 0%, rgba(248, 249, 247, 0) 22%),
      linear-gradient(0deg, var(--tb-paper) 8%, rgba(248, 249, 247, 0.92) 34%, rgba(248, 249, 247, 0) 62%);
  }
}
.tb-hero .tb-kicker::before {
  content: '';
  display: block;
  width: 3.5rem;
  height: 3px;
  background: var(--tb-forest);
  margin-bottom: 1.1rem;
}
.tb-hero h1 {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 1.2rem 0 1.6rem;
}
.tb-hero h1 .l2 {
  display: block;
  font-family: 'Literata', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tb-forest);
}
/* line-mask entrance: each headline line rises out of its own clip on load */
.tb-line { display: block; overflow: hidden; }
.tb-line-inner { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .tb-line-inner {
    transform: translateY(110%);
    animation: tb-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .tb-line:nth-child(2) .tb-line-inner { animation-delay: 0.14s; }
  @keyframes tb-rise { to { transform: translateY(0); } }
}
.no-js .tb-line-inner { transform: none; animation: none; }
.tb-lede {
  font-size: 1.1875rem;
  max-width: var(--tb-measure);
  margin-bottom: 1.8rem;
}

/* --------------------------------------------------------------- sections */
.tb-sec {
  border-top: 1px solid var(--tb-hairline);
  padding: clamp(2.2rem, 5vw, 3.6rem) 0;
}
.tb-sec .tb-wrap { display: grid; gap: 1.6rem; }
@media (min-width: 900px) {
  .tb-sec .tb-wrap {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 3.5rem;
  }
  .tb-sec .tb-rail { position: sticky; top: 2rem; align-self: start; }
}
.tb-sec h2 {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.1rem;
}

/* -------------------------------------------------------------- qualifier */
.tb-madlib {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.tb-blank {
  color: var(--tb-forest);
  border-bottom: 3px dashed var(--tb-forest);
  padding-bottom: 0.06em;
  background-image: linear-gradient(var(--tb-forest), var(--tb-forest));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 3px;
}
.has-kind .tb-blank {
  border-bottom-color: transparent;
  background-size: 100% 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .tb-blank {
    transition: background-size 0.7s ease, border-bottom-color 0.4s ease;
  }
}
.tb-qualifier .tb-chips { margin: 0.4rem 0 2rem; }
.tb-lots {
  margin: 0.5rem 0 0;
  font-style: italic;
  color: var(--tb-forest);
}

.tb-know-wrap { max-width: var(--tb-measure); }
.tb-know { display: none; }
.tb-know-line {
  position: relative;
  padding: 0.55rem 0 0.8rem 1.4rem;
  cursor: pointer;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  display: block;
  width: 100%;
}
.tb-know-line::before {
  content: '—';
  position: absolute;
  left: 0;
  top: 0.55rem;
  color: var(--tb-forest);
}
/* the spotlight dims only opacity/color — nothing moves, nothing reflows */
.tb-spot-on .tb-know-line { opacity: 0.4; transition: opacity 0.45s ease; }
.tb-spot-on .tb-know-line.is-hot { opacity: 1; }
.tb-know-bar {
  position: absolute;
  left: 1.4rem;
  right: 15%;
  bottom: 0.2rem;
  height: 2px;
  background: var(--tb-forest);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}
.tb-spot-on .tb-know-line.is-hot .tb-know-bar {
  opacity: 0.55;
  animation: tb-spotbar var(--spot-ms, 3600ms) linear forwards;
}
@keyframes tb-spotbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tb-know-tail { display: none; font-style: italic; color: var(--tb-forest); }
.tb-know-wrap.has-answer .tb-know { display: block; }
.tb-know-wrap.has-answer .tb-know-tail { display: block; }
.tb-know-wrap.has-answer .tb-know-fallback { display: none; }
.tb-know-fallback { font-style: italic; }

/* -------------------------------------------------- the night band (stance)
   The dawn touch: a full-bleed deep-green interlude. Outlined numerals echo
   an operator's ledger; the belief line brings the light back. */
.tb-night {
  background: var(--tb-deep);
  color: var(--tb-paper);
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.tb-night .tb-kicker { color: var(--tb-sage); }
.tb-night h2 {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0.7rem 0 1rem;
}
.tb-night-intro {
  font-size: 1.125rem;
  color: rgba(248, 249, 247, 0.85);
  max-width: var(--tb-measure);
  margin-bottom: 2.4rem;
}
.tb-night-list { max-width: 46rem; }
.tb-night-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem clamp(1.2rem, 4vw, 2.2rem);
  align-items: start;
  padding: 1.6rem 0;
  border-top: 1px solid rgba(248, 249, 247, 0.14);
}
.tb-night-num {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.25px rgba(248, 249, 247, 0.45);
  user-select: none;
}
.tb-night-list h3 {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.tb-night-list p {
  color: rgba(248, 249, 247, 0.82);
  font-size: 1.0625rem;
  max-width: 34rem;
}
.tb-night-belief {
  margin-top: 2.4rem;
  font-style: italic;
  font-size: 1.1875rem;
  max-width: var(--tb-measure);
}
.tb-night :focus-visible { outline-color: var(--tb-paper); }

/* ----------------------------------------------------------------- origin */
.tb-origin p { max-width: var(--tb-measure); margin-bottom: 1rem; }

/* ------------------------------------------------------------ application */
.tb-apply-card {
  background: #fff;
  border: 1.5px solid var(--tb-hairline);
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 44rem;
}
.tb-apply-card > p { margin-bottom: 1.4rem; max-width: var(--tb-measure); }
#tb-apply-done p { margin-bottom: 0.6rem; }
#tb-apply-done .tb-done-lead {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: 1.25rem;
}

/* ------------------------------------------------------------------ close */
.tb-signoff { text-align: left; }
.tb-signoff p { max-width: var(--tb-measure); font-style: italic; }
.tb-signature {
  font-family: var(--tb-display);
  font-weight: 600;
  font-style: normal;
  margin-top: 1.2rem;
}

/* scroll text-fill: the belief sentence lights up word by word as you read
   through the night band (JS splits into spans; static under reduced motion) */
.tb-fill-word { opacity: 0.3; transition: opacity 0.4s ease; }
.tb-fill-word.lit { opacity: 1; }


/* -------------------------------------------------------- qualifier visual */
.tb-qual-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 1020px) {
  .tb-qual-grid { grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem); gap: 3rem; }
}
.tb-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tb-tint);
  border: 1.5px dashed var(--tb-hairline);
}
.tb-visual-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .tb-visual-slide { transition: opacity 0.5s ease; }
}
.tb-visual-slide.is-on { opacity: 1; }
.tb-visual-num {
  font-family: var(--tb-display);
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.25px var(--tb-forest);
}
.tb-visual-label {
  font-family: var(--tb-display);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-forest);
  opacity: 0.7;
}
