/* Every Few Years — essay spoke on seoulcrushing.
 *
 * Coupling contract: palette + fonts + chrome (.house / .spoke-foot) are
 * INHERITED from /styles.css. Shared tokens used here: --ink, --primary,
 * --primary-dark, --secondary, --grey, --grey-dark, --grey-lighter.
 * Families: 'Bagel Fat One', 'Source Sans 3', 'JetBrains Mono'. Rename any in
 * /styles.css or /fonts and this page falls back to system fonts SILENTLY.
 *
 * The viz tokens below (--icon / --icon-past / --card / --rule / --rule-strong)
 * are LITERALS on purpose — app.js reads them via getComputedStyle to colour the
 * canvas, so they must resolve to concrete values, not var() chains.
 */
:root {
  --icon: #ff52e5;        /* active ribbon (left of the scrubber) = the pink signal */
  --icon-past: #dbdbdb;   /* future portion (right of the scrubber) = faint grey */
  --card: #ffffff;        /* chart card bg — also the icon cut-out colour */
  --rule: #e3e3e3;        /* inner chart rules / dividers */
  --rule-strong: #1a1a1a; /* scrubber line + year label */
}

/* the feed app shell locks html/body to viewport height; an essay scrolls. */
html:has(body.efy-page),
body.efy-page {
  height: auto;
  min-height: 100vh;
  max-height: none;
  overflow: auto;
}
body.efy-page {
  background: #fafafa;
  color: var(--ink);
  font-family: 'Source Sans 3', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#page { max-width: 760px; margin: 0 auto; padding: 0 24px 12px; }

/* ===== lede ===== */
.efy-page .lede { padding: 3.4rem 0 1rem; }
.efy-page .kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey);
  margin: 0 0 1.4rem;
}
.efy-page .lede h1 {
  font-family: 'Bagel Fat One', cursive; font-weight: 400;
  font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.005em;
  color: var(--ink); margin: 0 0 1.5rem; max-width: 16ch;
}
.efy-page .dek {
  font-size: 18px; color: var(--grey-dark); max-width: 36ch; line-height: 1.5; margin: 0;
}

/* ===== case ===== */
.case { padding: 3.4rem 0 0; border-top: 1px solid var(--grey-lighter); margin-top: 3.4rem; }
.case .kicker { margin-bottom: 12px; }
.case-title {
  font-family: 'Bagel Fat One', cursive; font-weight: 400;
  font-size: clamp(26px, 4.2vw, 38px); line-height: 1.08; letter-spacing: -0.005em;
  color: var(--ink); margin: 0 0 1.3rem;
}
.case-intro { font-size: 17px; line-height: 1.7; color: var(--ink); max-width: 62ch; margin: 0 0 2rem; }

/* ===== chart card ===== */
.card { background: var(--card); border: 1px solid var(--grey-lighter); border-radius: 6px; padding: 22px 22px 20px; }

.viz-readout { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; gap: 20px; }
.viz-year { font-family: 'JetBrains Mono', monospace; font-size: 42px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.viz-count-block { text-align: right; }
.viz-count-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--grey); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.viz-count-value { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 500; line-height: 1; color: var(--primary-dark); }
.viz-count-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--grey); margin-top: 5px; }
.viz-frame { position: relative; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 24px 0; cursor: ew-resize; user-select: none; }
.viz-frame canvas { display: block; width: 100%; height: auto; max-width: 100%; }
.viz-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--grey); letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none; transition: opacity 0.4s ease; background: var(--card); padding: 4px 10px; }
.viz-hint.hidden { opacity: 0; }
.viz-axis { display: flex; justify-content: space-between; padding: 0.5rem 0 0; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--grey); letter-spacing: 0.08em; }
.viz-event { margin-top: 1.25rem; min-height: 56px; }
.viz-event-year { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--grey); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.viz-event-text { font-size: 14px; color: var(--ink); line-height: 1.65; max-width: 62ch; transition: opacity 0.25s ease; }
.viz-event-text.fading { opacity: 0.3; }
.viz-caveat { margin-top: 1.4rem; font-size: 11px; color: var(--grey); line-height: 1.6; font-style: italic; max-width: 62ch; }
.viz-caveat strong { font-style: normal; font-weight: 600; color: var(--grey-dark); }

/* ===== pattern interstitial ===== */
.pattern { padding: 4rem 0; border-top: 1px solid var(--grey-lighter); margin-top: 3.4rem; }
.pattern-text { font-size: 18px; line-height: 1.75; max-width: 58ch; margin: 0 auto; }
.pattern-text p + p { margin-top: 1.25rem; }
.pull-quote {
  font-family: 'Bagel Fat One', cursive; font-weight: 400;
  font-size: clamp(20px, 2.8vw, 27px); line-height: 1.3; letter-spacing: -0.005em;
  margin: 2.6rem 0 0; padding-left: 1.4rem; border-left: 3px solid var(--primary); max-width: 24ch; color: var(--ink);
}

/* ===== comparison ===== */
.comparison { padding: 3.4rem 0 0; border-top: 1px solid var(--grey-lighter); margin-top: 3.4rem; }
.comparison-intro { font-size: 16px; line-height: 1.7; max-width: 62ch; margin: 0 0 1.4rem; }
.comparison-intro b, .comparison-intro strong { color: var(--primary-dark); }
.comparison-chart { padding: 24px 18px; }
.comparison-chart canvas { display: block; width: 100%; height: auto; }
.comparison-caption { font-size: 14px; line-height: 1.6; color: var(--grey); margin-top: 1rem; }
.comparison-caption .us { color: var(--primary-dark); font-weight: 600; }

/* ===== close ===== */
.close { padding: 3.4rem 0 1rem; border-top: 1px solid var(--grey-lighter); margin-top: 3.4rem; }
.close-text { font-size: 18px; line-height: 1.75; max-width: 58ch; margin: 0 auto; }
.close-text p + p { margin-top: 1.25rem; }
.close-text .kicker-close {
  font-size: 19px; margin-top: 2.4rem; color: var(--ink); font-weight: 600;
  text-transform: none; letter-spacing: 0; font-family: inherit;
}

@media (max-width: 640px) {
  #page { padding: 0 18px 12px; }
  .efy-page .lede { padding: 2.4rem 0 0.5rem; }
  .case, .pattern, .comparison, .close { margin-top: 2.6rem; padding-top: 2.6rem; }
  .card { padding: 18px 14px 16px; }
  .viz-year { font-size: 34px; }
}
