/* readability pass: +2px on every font-size (applied) */
/* =========================================================================
   Scaling With Content · email sequence specimen page
   Sits on ../assets/funnel.css (tokens, fonts, canvas, footer).
   Sizes use the font-size longhand only, never the font shorthand.
   ========================================================================= */

.seq { position: relative; padding: clamp(76px, 12vh, 128px) 0 clamp(72px, 10vh, 112px); }

/* ------------------------------- intro --------------------------------- */
.seq-intro { text-align: center; max-width: 820px; margin: 0 auto clamp(48px, 7vh, 72px); padding: 0 clamp(16px, 5vw, 32px); }
.seq-intro .eyebrow { margin-bottom: 18px; }
.seq-intro h1 { font-size: calc(clamp(34px, 4.6vw, 54px) + 2px); line-height: 1.06; white-space: nowrap; }
.seq-intro h1 .nw { white-space: nowrap; }

/* signature load beat (CSS only, so it works with JS off) */
.seq-intro > * { animation: seqRise .9s var(--ease) both; }
.seq-intro > *:nth-child(2) { animation-delay: .08s; }
@keyframes seqRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ------------------------------ the flow -------------------------------- */
.seq-flow { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px); }
.phase + .phase { margin-top: clamp(80px, 11vh, 112px); }

/* phase label: mono kicker with two hairlines that fade out on both sides */
.phase-h { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0; font-family: var(--mono);
  font-size: 14px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-stretch: 100%; line-height: 1.4; text-align: center; }
.phase-h::before, .phase-h::after { content: ""; flex: 1; max-width: 150px; height: 1px; }
.phase-h::before { background: linear-gradient(90deg, transparent, rgba(59, 227, 107, .4)); }
.phase-h::after { background: linear-gradient(90deg, rgba(59, 227, 107, .4), transparent); }

/* each email: a connector rising into its send-time chip, then the card */
.step { position: relative; padding-top: 44px; }
.step::before { content: ""; position: absolute; top: 6px; left: 50%; width: 1px; height: 30px; transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(59, 227, 107, 0), rgba(59, 227, 107, .45)); }
.when { display: flex; justify-content: center; margin: 0 0 16px; }
.when-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 15px 8px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); line-height: 1.35; text-align: center; }
.when-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* -------------------------------- card ---------------------------------- */
.mail { position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface) 160px); border: 1px solid var(--line);
  border-radius: 22px; padding: clamp(22px, 4vw, 42px) clamp(20px, 4.6vw, 46px) clamp(26px, 4vw, 40px);
  box-shadow: 0 30px 70px -50px rgba(0, 0, 0, .8); }
.mail::before { content: ""; position: absolute; left: 22%; right: 22%; top: -1px; height: 1px; border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 245, 158, .38), transparent); }

.mail-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
/* QA pass 3: the counter stays top-right; a long label wraps on the left instead of pushing the counter to its own row */
.mail-top { flex-wrap: nowrap; align-items: flex-start; }
.mail-top .mail-tag { min-width: 0; text-wrap: balance; }
.mail-tag { font-family: var(--mono); font-size: 13.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.mail-num { font-family: var(--mono); font-size: 13.5px; font-weight: 500; letter-spacing: .12em; color: var(--text-3); white-space: nowrap; }

.mail-subject { margin: 16px 0 10px; font-family: var(--display); font-size: calc(clamp(21px, 2.3vw, 26px) + 2px); font-weight: 800; line-height: 1.2;
  letter-spacing: -0.015em; color: var(--text); text-wrap: pretty; }
.mail-preview { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.pv-k { flex: none; position: relative; top: -1px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); font-family: var(--mono);
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }

.mail-from { display: flex; align-items: center; gap: 13px; margin: 24px 0 0; padding-bottom: 22px; position: relative; }
.mail-from::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(226, 255, 236, .12), rgba(226, 255, 236, .08) 70%, transparent); }
.mail-av { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.mail-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.mail-who b { font-size: 17px; font-weight: 700; color: var(--text); }
.mail-who > span { font-size: 15.5px; color: var(--text-3); }

/* -------------------------------- body ---------------------------------- */
.mail-body { padding-top: 24px; font-size: 18px; line-height: 1.72; color: #d3ddd8; }
.mail-body p { margin: 0 0 15px; }
.mail-body b { color: var(--text); font-weight: 700; }
.mail-sign { margin-top: 26px !important; color: var(--text); font-weight: 600; }
.mail-ps { margin: 22px 0 0 !important; padding: 16px 18px; border-radius: 14px; background: rgba(226, 255, 236, .035);
  border: 1px solid var(--line-soft); color: var(--text-2); font-size: 17px; line-height: 1.65; }
.mail-ps b { color: var(--accent); font-family: var(--mono); font-size: 14.5px; letter-spacing: .08em; margin-right: 4px; }

/* lead lines (FAQ questions, method steps) */
.mail-body .em-h { margin: 26px 0 8px; color: var(--text); font-weight: 800; font-size: 18.5px; line-height: 1.45; letter-spacing: -0.005em; }

/* quotes from members */
.em-q { margin: 6px 0 18px; padding: 2px 0 2px 18px; border-left: 2px solid rgba(59, 227, 107, .7); }
.em-q p { margin: 0 !important; color: var(--text); font-size: 18px; line-height: 1.66; }
.em-q + .em-q { margin-top: -6px; }

/* link lines */
.em-link { margin: 4px 0 19px !important; }
.em-link .tok { font-size: 15.5px; padding: 6px 12px; border-radius: 9px; }

/* lists */
.em-ol, .em-ul { margin: 4px 0 20px; padding: 0; list-style: none; }
.em-ol { counter-reset: em; }
.em-ol li, .em-ul li { position: relative; padding-left: 36px; margin: 0 0 11px; }
.em-ol li::before { counter-increment: em; content: counter(em, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 14.5px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.em-ul li { padding-left: 24px; }
.em-ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.em-pillars li { color: var(--text); font-weight: 700; }
.em-pillars-d li { margin-bottom: 16px; }
.em-pt { display: block; color: var(--text); font-weight: 700; }
.em-pd { display: block; margin-top: 4px; color: var(--text-2); font-weight: 400; font-size: 17.5px; line-height: 1.62; }

/* labelled rows (week-by-week, the call, the stack) */
.em-dl { margin: 6px 0 22px; display: grid; gap: 14px; }
.em-dl-row { padding: 16px 18px; border-radius: 14px; background: rgba(226, 255, 236, .03); border: 1px solid var(--line-soft); }
.em-dl-k { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 13.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); }
.em-dl-row p { margin: 0 !important; font-size: 17.5px; line-height: 1.65; }

/* figures inside emails */
.em-fig { margin: 8px 0 22px; }
.em-media { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #050706; }
.em-media img { display: block; width: 100%; height: auto; }
.em-fig figcaption { margin-top: 10px; font-family: var(--mono); font-size: 13.5px; letter-spacing: .06em; color: var(--text-3); line-height: 1.5; }
.em-fig-cover { text-align: center; }
.em-cover { display: inline-block; width: min(230px, 64%); border-radius: 12px; transform: rotate(-2deg); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9); }
.em-shot { background: #fff; }
.em-photo { background: #050706; }
.em-photo img { transform: scale(1.01); }
.em-video { aspect-ratio: 16 / 9; }
.em-video img { height: 100%; object-fit: cover; filter: brightness(.9); }
.em-play { position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 14px 34px -10px var(--accent-glow); }
.em-play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.em-src { position: absolute; left: 12px; bottom: 11px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 7px; border-radius: 999px;
  background: rgba(5, 7, 6, .74); font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.em-src svg { width: 20px; height: 14px; flex: none; }

/* replay card: the thumbnail's empty left side carries the title */
.em-replay .em-play { left: 60%; }
.em-replay-copy { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); width: 46%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.em-replay-k { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); }
.em-replay-k i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.em-replay-t { font-family: var(--display); font-weight: 800; font-size: calc(clamp(17px, 2.4vw, 24px) + 2px); line-height: 1.08; letter-spacing: -0.015em; color: var(--text); font-stretch: 96%; }
.em-replay-s { font-size: 14.5px; color: var(--text-2); }

/* ------------------------------ tokens ---------------------------------- */
.tok { display: inline-block; max-width: 100%; font-family: var(--mono); font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: .02em;
  padding: 1px 8px; border-radius: 7px; white-space: nowrap; vertical-align: 1px; }
.tok-link { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(59, 227, 107, .32); }
.tok-merge { color: var(--text-2); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.mail-subject .tok { font-size: 17px; vertical-align: 3px; }
.mail-subject { text-wrap: balance; }
.mail-who .tok { font-size: 13px; padding: 0 6px; }

/* ------------------------------ reveals --------------------------------- */
/* Hidden only when JS is on; the inline script reveals on scroll and shows
   everything after 1.2s if the observer never fires (iframe lightbox). */
html.js .sq-rv { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
html.js .sq-rv.sq-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .sq-rv { opacity: 1; transform: none; transition: none; }
  .seq-intro > * { animation: none; }
}

/* ------------------------------ footer ---------------------------------- */
.foot { margin-top: 0; }

/* ------------------------------ mobile ---------------------------------- */
@media (max-width: 640px) {
  .seq { padding-top: 64px; }
  /* a 3-word title stays on one line on a phone (no orphan word) */
  .seq-intro h1 { white-space: nowrap; font-size: min(calc(clamp(30px, 8.4vw, 36px) + 2px), 6.8vw); }
  .seq-flow { padding: 0 16px; }
  .phase-h { font-size: 13px; gap: 12px; letter-spacing: .16em; }
  .phase-h::before, .phase-h::after { max-width: 60px; }
  .when-chip { font-size: 12.5px; letter-spacing: .1em; padding: 7px 12px 7px 11px; }
  .mail { border-radius: 18px; }
  .mail-subject { font-size: 23px; }
  .mail-preview { flex-direction: column; gap: 6px; }
  .mail-body { font-size: 18px; line-height: 1.7; }
  .em-ol li { padding-left: 32px; }
  .em-dl-row { padding: 14px 15px; }
  .em-replay-copy { left: 5%; width: 52%; gap: 3px; }
  .em-replay-s { display: none; }
  .em-replay .em-play { left: 70%; width: 46px; height: 46px; }
  .em-play { width: 50px; height: 50px; }
}

/* ---- mobile hardening (references/mobile.md) ---- */
*, *::before, *::after { box-sizing: border-box; }

img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* Long unbroken strings (URLs, merge tokens, [CONFIRM: ...] notes) must never
   push the page wide. This is the #1 cause of horizontal scroll in generated copy. */
p, li, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6 { overflow-wrap: anywhere; }

/* Anything intentionally wide scrolls inside itself, never the page. */
table, pre { display: block; max-width: 100%; overflow-x: auto; }

@media (max-width: 700px) {
  /* Flex rows carrying a trailing pill/tag must wrap, not overflow. */
  [class*="row"], [class*="stack"] > *, [class*="item"], .it { flex-wrap: wrap; }
  /* A tag pushed right by margin-left:auto goes full width on its own line. */
  .tag, [class*="badge"], [class*="pill"] { margin-left: 0; }
  /* Multi-column grids collapse to one. */
  [style*="grid-template-columns"], [class*="grid"] { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  /* Merge tokens and inline code may wrap on the smallest screens. */
  .tok-merge, .tok-link, code { white-space: normal; }
}

/* keep the hardening from distorting fixed-ratio media and the mark */
.em-video img { height: 100%; }
.mail-av { height: 44px; }
.brand .mark { height: 30px; }
