/* ==========================================================================
   Thesis page — long-form reading layout
   ========================================================================== */

.thesis-page { --read: "Newsreader", "Instrument Serif", Georgia, serif; }

.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; }
.read-progress i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--heat-2), var(--heat), var(--cool)); }

/* ---------- masthead ---------- */
.t-hero { position: relative; padding: 168px 0 40px; overflow: hidden; }
.t-hero-glow { position: absolute; left: 50%; top: -260px; width: 1100px; height: 700px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 122, 61, 0.13), rgba(91, 227, 207, 0.05) 60%, transparent); pointer-events: none; }
.t-hero-inner { position: relative; text-align: center; }
.t-hero .label { justify-content: center; }
.t-hero .label::before { display: none; }
.t-hero .label .num { padding: 4px 10px; border: 1px solid rgba(255, 122, 61, .4); border-radius: 100px; }
.t-back { display: flex; width: max-content; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 auto 36px; transition: color .2s; }
.t-back svg { width: 14px; height: 14px; }
.t-back:hover { color: var(--text); }
.t-hero h1 { font-size: clamp(48px, 7.4vw, 112px); max-width: 14ch; margin: 0 auto; line-height: 1; }
.t-hero h1 em { background: linear-gradient(100deg, var(--heat-2) 0%, var(--heat) 40%, var(--cool) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.t-dek { font-family: var(--read); font-style: italic; font-size: clamp(20px, 2vw, 26px); color: var(--text-2); margin: 28px 0 0; }
.t-meta { display: inline-flex; gap: 28px; margin-top: 36px; padding: 12px 24px; border: 1px solid var(--line); border-radius: 100px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.t-meta b { color: var(--text); font-weight: 500; letter-spacing: .14em; }
.t-hero-arc { width: 100%; max-width: 1100px; height: auto; margin: 64px auto 0; overflow: visible; }

/* ---------- layout ---------- */
.t-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 80px; padding-top: 72px; padding-bottom: 120px; border-top: 1px solid var(--line); }
.t-toc-inner { position: sticky; top: 112px; }
.t-toc-k { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.t-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line-2); }
.t-toc a { display: grid; grid-template-columns: 30px 1fr; gap: 4px; padding: 9px 0 9px 16px; margin-left: -1px; border-left: 1px solid transparent; font-size: 14px; line-height: 1.4; color: var(--muted); transition: color .25s, border-color .25s; }
.t-toc a span { font-family: "Instrument Serif", serif; font-size: 17px; line-height: 1.1; color: var(--dim); transition: color .25s; }
.t-toc a:hover { color: var(--text-2); }
.t-toc a.active { color: var(--text); border-left-color: var(--heat); }
.t-toc a.active span { color: var(--heat-2); }

/* ---------- article ---------- */
.t-article { max-width: 700px; }
.t-ch { padding-bottom: 72px; scroll-margin-top: 100px; }
.t-ch + .t-ch { padding-top: 72px; border-top: 1px solid var(--line); }
.t-ch-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: baseline; margin-bottom: 36px; }
.t-num { font-family: "Instrument Serif", serif; font-size: 72px; line-height: .8; color: transparent; -webkit-text-stroke: 1px var(--heat); min-width: 1.2em; }
.t-ch-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -0.01em; margin: 0; }

.t-article p { font-family: var(--read); font-size: 21px; line-height: 1.68; color: #d9dee4; margin: 0 0 1.3em; font-optical-sizing: auto; }
.t-article p strong { font-weight: 500; color: var(--text); }
.t-article p.drop::first-letter { float: left; font-family: "Instrument Serif", serif; font-size: 5.1em; line-height: .78; padding: 8px 14px 0 0; color: var(--heat-2); }

.t-fig { margin: 48px 0 52px; padding: 32px 28px 22px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,.025), transparent 60%), var(--bg-1); }
.t-fig svg { width: 100%; height: auto; overflow: visible; }
.t-fig .svg-text { font-size: 11.5px; }
.t-fig figcaption { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.t-fig figcaption span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--heat-2); margin-right: 10px; }

.t-pull { margin: 56px -40px 8px; padding: 36px 40px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.15; color: var(--ivory); position: relative; }
.t-pull::before { content: "“"; position: absolute; top: -6px; left: 40px; transform: translateY(-50%); font-size: 80px; line-height: 1; color: var(--heat); background: var(--bg); padding: 0 12px; }
.t-pull span { color: var(--muted); }

.t-questions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 40px 0 8px; }
.t-questions div { background: var(--bg-1); padding: 22px 20px; font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.t-questions span { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--heat); letter-spacing: .14em; margin-bottom: 10px; }

.t-article p.t-close { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 42px); line-height: 1.18; color: var(--text); margin: 48px 0 40px; }
.t-close em { background: linear-gradient(100deg, var(--heat-2), var(--cool)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-sign { display: flex; align-items: center; gap: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.t-sign-line { width: 48px; height: 1px; background: var(--line-3); }
.t-sign img { height: 24px; width: auto; }

/* ---------- continue ---------- */
.t-next { padding: 120px 0 140px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.t-next::before { content: ""; position: absolute; left: 50%; bottom: -380px; width: 1200px; height: 760px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255, 122, 61, 0.1), rgba(91, 227, 207, 0.05) 50%, transparent); pointer-events: none; }
.t-next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; }
.t-card { display: flex; flex-direction: column; gap: 12px; padding: 28px; min-height: 220px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8, 11, 16, .8); transition: border-color .3s, transform .4s var(--ease), background .3s; }
.t-card:hover { border-color: var(--line-3); transform: translateY(-4px); background: var(--bg-2); }
.t-card .mono { font-size: 11px; color: var(--muted); letter-spacing: .14em; }
.t-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.t-card p { margin: 0; font-size: 15px; color: var(--text-2); flex: 1; }
.t-card .go { font-size: 13px; color: var(--heat-2); }
.t-join { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); position: relative; flex-wrap: wrap; }
.t-join .display { font-size: clamp(32px, 4vw, 54px); margin: 0; max-width: 18ch; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .t-layout { grid-template-columns: 1fr; gap: 0; padding-top: 48px; }
  .t-toc { display: none; }
  .t-article { margin: 0 auto; }
  .t-pull { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .t-pull::before { left: 0; }
  .t-next-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .t-hero { padding-top: 120px; }
  .t-meta { gap: 14px; padding: 10px 16px; font-size: 11px; }
  .t-article p { font-size: 18px; }
  .t-ch-head { gap: 16px; }
  .t-num { font-size: 52px; }
  .t-fig { padding: 20px 14px 16px; margin-left: -4px; margin-right: -4px; }
  .t-questions { grid-template-columns: 1fr; }
  .t-card { min-height: 0; }
}
@media (max-width: 640px) {
  /* keep figure labels legible: let wide diagrams scroll sideways */
  .t-fig { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .t-fig svg { min-width: 560px; }
  .t-fig figcaption { position: sticky; left: 0; max-width: calc(100vw - 64px); }
}
