/* Highstake Letters — self-contained stylesheet.
   Design tokens mirror the main site (styles.css :root) so the archive and
   letter pages feel native without depending on the React app's CSS. */

:root {
  --bg:      #08090A;
  --bg-1:    #0E0F11;
  --bg-2:    #141518;
  --line:    rgba(255,255,255,0.07);
  --line-hi: rgba(255,255,255,0.13);
  --fg:      #F2F1EE;
  --fg-2:    #9A9890;
  --fg-3:    #575550;
  /* matches the live site's runtime accent (set in index.html on load),
     not the #5EEDB8 fallback in styles.css :root */
  --accent:  oklch(0.80 0.15 145);

  --font-sans:  "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 56px; --s7: 72px; --s8: 96px;
  --radius: 8px;

  --max:    1240px; /* site nav width */
  --gutter: 32px;

  --read: 680px;   /* letter body reading width */
  --wide: 760px;   /* archive width */
}
@media (max-width: 640px) { :root { --gutter: 20px; } }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "tnum";
  overflow-x: hidden;
}

a { color: inherit; }

/* ─── Page chrome ─────────────────────────────────────────── */

/* matches the site's .shell — left-aligned to the same gutter as the nav */
.lt-wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  box-sizing: border-box;
}

/* ─── Site nav (static replica of the React nav, kept in sync with styles.css) ── */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: 60px;
  display: flex; align-items: center;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  width: 100%;
}
.nav-left  { display: flex; align-items: center; gap: var(--s6); }
.nav-right { display: flex; align-items: center; gap: var(--s2); }
.nav-links { display: flex; gap: var(--s4); }
.nav-links a { font-size: 13px; color: var(--fg-2); text-decoration: none; transition: color .15s; }
.nav-links a:hover,
.nav-links a.is-active { color: var(--fg); }

.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); }
.logo img { height: 26px; width: auto; display: block; filter: brightness(0) invert(1); }
.logo-text { display: flex; align-items: baseline; gap: 1px; }
.logo-high  { font-family: var(--font-sans); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.logo-stake { font-family: var(--font-serif); font-style: italic; font-size: 20px; letter-spacing: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-hi); color: var(--fg-2);
  background: var(--bg-2); line-height: 1.5;
}
.pill.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.live .dot { animation: pulse 2s ease-in-out infinite; box-shadow: 0 0 6px currentColor; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 6px;
  font-size: 13px; font-family: var(--font-sans);
  border: 1px solid var(--line-hi); background: transparent; color: var(--fg);
  cursor: pointer; text-decoration: none; letter-spacing: 0.01em;
  transition: border-color .18s, background .18s;
}
.btn:hover { border-color: rgba(255,255,255,0.25); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { background: #e8e8e3; border-color: #e8e8e3; color: var(--bg); }

@media (max-width: 960px) { .nav-links { display: none; } }
@media (max-width: 640px) {
  .nav-right { gap: 10px; }
  .nav-right .pill.live { display: none; }
  .nav-right .btn:not(.btn-primary) { display: none; }
  .nav-right .btn.btn-primary { padding: 9px 14px; font-size: 13px; }
}

/* ─── Eyebrow / labels ────────────────────────────────────── */

/* matches .sec-label on the main site (grey, 10px, // prefix) */
.lt-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--s2);
}
.lt-eyebrow::before { content: "//"; color: var(--fg-3); font-size: 12px; letter-spacing: 0; }

.lt-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ─── Archive hero ────────────────────────────────────────── */

.lt-hero {
  padding-block: var(--s7) var(--s4);
  border-bottom: 1px solid var(--line);
}
.lt-hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 var(--s3);
}
.lt-hero h1 em { font-style: italic; color: var(--fg-2); }
.lt-hero .lt-desc {
  color: var(--fg-2);
  font-size: 15px;
  max-width: 46ch;
  margin: 0;
  text-wrap: pretty;
}

/* ─── Archive row list ────────────────────────────────────── */

.lt-list { padding-top: var(--s3); padding-bottom: var(--s4); }

.lt-year { margin-bottom: var(--s4); }
.lt-year:last-child { margin-bottom: 0; }
.lt-year-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0;
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--line);
}

.lt-rows { display: flex; flex-direction: column; }

/* 2. Denser rows — tighter padding */
.lt-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 18px var(--s2);
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transition: background .15s ease, border-color .15s ease;
}
/* 4. Hover polish — background lift + border brightens */
.lt-row:hover { background: var(--bg-1); border-bottom-color: var(--line-hi); }

/* 4. Icon glow on hover */
.lt-row-mark {
  width: 24px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity .15s ease;
}
.lt-row:hover .lt-row-mark { opacity: 0.7; }

/* 4. Title brightens on hover */
.lt-row-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s ease;
}
.lt-row:hover .lt-row-title { color: var(--accent); }

.lt-row-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* 3. More muted excerpt — smaller, lower opacity */
.lt-row-excerpt {
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 4. Date nudges right on hover */
.lt-row-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s ease;
}
.lt-row:hover .lt-row-date { color: var(--fg-2); }

/* 4. Arrow slides in on hover */
.lt-row-arrow {
  font-size: 13px;
  color: var(--fg-3);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.lt-row:hover .lt-row-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

@media (max-width: 680px) {
  .lt-row { flex-wrap: wrap; gap: var(--s1) var(--s2); padding: var(--s3) var(--s1); }
  .lt-row-excerpt { display: none; }
  .lt-row-date { order: 3; }
  .lt-row-arrow { display: none; }
}

.lt-empty {
  padding: var(--s6) 0;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ─── Letter page ─────────────────────────────────────────── */

/* centered reading column */
.lt-article { max-width: var(--read); margin: 0 auto; position: relative; }

/* back link — left margin annotation */
.lt-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  text-decoration: none;
  transition: color .15s ease;
}
.lt-back:hover { color: var(--fg); }

/* ─ Article header — left-aligned, institutional ─ */
.lt-article-head {
  padding-block: var(--s7) var(--s3);
  border-bottom: 1px solid var(--line);
}
.lt-article-head .lt-back {
  position: absolute;
  left: calc(-1 * (var(--gutter) + 120px));
  top: var(--s5);
}
@media (max-width: 960px) {
  .lt-article-head .lt-back {
    position: static;
    margin-bottom: var(--s3);
  }
}
.lt-article-head .lt-meta {
  margin-bottom: var(--s3);
  letter-spacing: 0.08em;
  color: var(--accent);
}
.lt-article-head h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.lt-article-head .lt-sub {
  color: var(--fg-2);
  font-size: 13px;
  margin: 0;
  max-width: 42ch;
  text-wrap: pretty;
}

/* ─ Lede — intro paragraph ─ */
.lt-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--fg) 55%, var(--fg-2));
  margin: 0 0 var(--s3);
  padding-top: var(--s3);
  text-wrap: pretty;
}

/* ─ Section divider (decorative) ─ */
.lt-section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: var(--s4) 0 var(--s3);
}
.lt-section-divider::before,
.lt-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.lt-section-divider .lt-div-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fg-3);
  flex-shrink: 0;
}

/* ─ Metric strip (tear-sheet style) ─ */
.lt-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 var(--s4);
  max-width: 92%;
}
.lt-metric {
  padding: 16px var(--s2);
  text-align: center;
}
.lt-metric-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}
.lt-metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
}
@media (max-width: 480px) { .lt-metrics { grid-template-columns: 1fr; } }

/* prose */
.lt-prose { padding-block: 0 var(--s2); font-size: 14px; line-height: 1.75; color: var(--fg); }
.lt-prose > *:first-child { margin-top: 0; }
.lt-prose h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: var(--s3) 0 6px;
}
.lt-h2-num {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  margin-right: 6px;
}
.lt-prose h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  margin: var(--s3) 0 var(--s1);
}
.lt-prose p { margin: 0 0 var(--s2); }
.lt-prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line-hi); }
.lt-prose a:hover { border-color: var(--accent); }
.lt-prose ul, .lt-prose ol { margin: 0 0 var(--s3); padding-left: 1.3em; }
.lt-prose li { margin: 0 0 var(--s1); }
.lt-prose li::marker { color: var(--fg-3); }
.lt-prose blockquote {
  margin: var(--s3) 0;
  padding: var(--s2) var(--s3);
  border-left: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg-2);
  font-style: normal;
}
.lt-prose blockquote p:last-child { margin-bottom: 0; }
.lt-prose hr { border: none; border-top: 1px solid var(--line); margin: var(--s4) 0; }
.lt-prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: var(--s3) 0; }
.lt-prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.lt-prose em { color: var(--fg-2); }
.lt-prose strong { color: var(--fg); font-weight: 600; }

/* ─ Reporting period ─ */
.lt-period {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: var(--s2);
}

/* ─ Disclaimer — operational footnote ─ */
.lt-disclaimer {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-3);
}

/* ─ Issuance line ─ */
.lt-issuance {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: var(--s3);
}

/* ─ Previous / Next letter nav ─ */
.lt-letter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  margin-bottom: var(--s5);
}
.lt-letter-nav a,
.lt-letter-nav span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-2);
  transition: color .15s ease;
}
.lt-letter-nav a:hover { color: var(--fg); }
.lt-letter-nav-disabled { color: var(--fg-3); }

/* ─ Article subscribe CTA (centered, branded) ─ */
.lt-article-cta {
  text-align: center;
  padding: var(--s6) 0;
  margin-top: var(--s4);
}
.lt-article-cta .lt-cta-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: var(--s5);
}
.lt-article-cta .lt-cta-rule::before,
.lt-article-cta .lt-cta-rule::after {
  content: "";
  height: 1px;
  width: 48px;
  background: linear-gradient(90deg, transparent, var(--line-hi), transparent);
}
.lt-article-cta .lt-cta-rule img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.18;
}
.lt-article-cta h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.lt-article-cta h3 em { font-style: italic; color: var(--fg-2); }
.lt-article-cta p {
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 var(--s3);
}
.lt-article-cta .lt-form { display: inline-flex; }
.lt-article-cta .lt-form-row { display: inline-flex; gap: var(--s2); }
@media (max-width: 480px) {
  .lt-article-cta .lt-form-row { flex-direction: column; width: 100%; }
  .lt-article-cta .lt-form { display: flex; }
  .lt-article-cta .lt-form input[type="email"] { width: 100%; }
}

/* ─── Subscribe block ─────────────────────────────────────── */

.lt-subscribe {
  padding-block: var(--s6) var(--s6);
  border-top: 1px solid var(--line);
}
.lt-sub-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
}
.lt-sub-text { min-width: 0; }
.lt-sub-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 6px;
}
.lt-sub-title em { font-style: italic; color: var(--fg-2); }
.lt-sub-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-3);
  margin: 0;
}
.lt-sub-desc a { color: var(--fg-2); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.lt-sub-desc a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.lt-form { position: relative; }
.lt-form-row { display: inline-flex; gap: var(--s2); }
.lt-form input[type="email"] {
  width: 240px;
  box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease;
}
.lt-form input[type="email"]:focus { border-color: var(--line-hi); }
.lt-form input[type="email"]::placeholder { color: var(--fg-3); }
.lt-form button {
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.lt-form button:hover { background: #e8e8e3; border-color: #e8e8e3; }
.lt-form button:disabled { opacity: 0.4; cursor: not-allowed; }

.lt-form-msg { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; margin-top: 8px; min-height: 1em; }
.lt-form-msg.ok  { color: var(--accent); }
.lt-form-msg.err { color: #FF6B6B; }

@media (max-width: 640px) {
  .lt-sub-inner { flex-direction: column; align-items: flex-start; gap: var(--s3); }
  .lt-form-row { display: flex; width: 100%; }
  .lt-form, .lt-form-row { width: 100%; }
  .lt-form input[type="email"] { width: auto; flex: 1; }
}

/* ─── Footer (mirrors main site) ─────────────────────────── */

.footer { padding: var(--s6) 0 var(--s4); background: var(--bg-1); }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: var(--s2);
  font-weight: 400;
}
.footer-col a {
  display: block;
  color: var(--fg-2);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--fg); }
.footer-blurb {
  font-size: 12px;
  color: var(--fg-2);
  max-width: 44ch;
  margin-top: var(--s2);
  line-height: 1.65;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 680px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ─── Scroll reveal ──────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
