/* ════════════════════════════════════════════════════════════
   dailybrief — neon edition
   ════════════════════════════════════════════════════════════ */

:root {
  /* base */
  --bg-0:      #05060a;
  --bg-1:      #0b0d18;
  --bg-2:      #131628;
  --panel:     #11142440;     /* translucent over neon glow bg */
  --panel-2:   #1a1f3540;
  --line:      #2a2f4d;
  --line-2:    #3a4170;
  --text:      #ffffff;
  --text-2:    #d9def0;
  --muted:     #8b95b8;
  --dim:       #5a6285;

  /* NEON palette */
  --neon-cyan:    #00e1ff;
  --neon-mag:     #ff2bd6;
  --neon-lime:    #b6ff3c;
  --neon-yellow:  #ffe600;
  --neon-pink:    #ff5be8;
  --neon-violet:  #b388ff;
  --neon-orange:  #ff9a3c;
  --neon-red:     #ff4d6d;

  /* category colors (neon) */
  --c-world:  var(--neon-cyan);
  --c-econ:   var(--neon-lime);
  --c-tech:   var(--neon-violet);
  --c-ai:     var(--neon-mag);
  --c-crypto: var(--neon-orange);
  --c-korea:  var(--neon-pink);
  --c-whale:  var(--neon-lime);
  --c-trade:  var(--neon-yellow);
  --c-video:  var(--neon-pink);

  --up:   var(--neon-lime);
  --down: var(--neon-red);

  /* fonts
     ─── English ─────────────────────────────────────────────
     Bricolage Grotesque is a 2023 variable font by Mathieu Triay with
     opsz/wdth/wght axes — it gets dramatic and bold at display sizes,
     compact and readable at body sizes. Much punchier than Fraunces.
     DM Serif Display is reserved for the hero drop-cap accent. */
  --display: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --accent-serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --kr:      "Pretendard Variable", Pretendard, "Apple SD Gothic Neo",
             "Noto Sans KR", "Malgun Gothic", -apple-system, sans-serif;
  --mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --glow-cyan:   0 0 22px rgba(0,225,255,0.45);
  --glow-mag:    0 0 22px rgba(255,43,214,0.45);
  --glow-lime:   0 0 22px rgba(182,255,60,0.45);
  --glow-yellow: 0 0 22px rgba(255,230,0,0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  background:
    radial-gradient(900px 600px at 12% -5%,  rgba(255, 43, 214, 0.13), transparent 60%),
    radial-gradient(900px 600px at 88% 5%,   rgba(0, 225, 255, 0.10),  transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(182, 255, 60, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  min-height: 100vh;
  /* Kill horizontal scroll caused by overflowing marquee strips or
     fixed-width children — on mobile, this was making the page look
     like a chunk of content was missing on one edge. */
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: inherit; text-decoration: none; }

/* ── Language-aware typography ─────────────────────────────
   :lang() lets us tune the same CSS rules per content language.
   Korean uses Pretendard's `palt` (proportional alt widths) for
   tighter horizontal rhythm, and a slightly smaller heading scale
   because Hangul glyphs are visually denser than Latin at the same px.
   English uses Bricolage Grotesque with optical sizing + width axis
   for dramatic display weights.
*/
:lang(ko), [lang="ko"] {
  font-family: var(--kr);
  font-feature-settings: "palt" 1, "vpal" 1, "kern" 1, "ss03" 1;
  word-break: keep-all;
  line-height: 1.36;
  letter-spacing: -0.3px;
}
:lang(en), [lang="en"] {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
}

/* All headlines get auto-balanced wrapping (Chrome 114+ / Safari 17.4+).
   This makes "최태원, 내달 TSMC회장과 회동…엔비디아 포함" wrap evenly
   instead of leaving a sad lonely word on the last line. */
.h, h1, h2, h3 {
  text-wrap: balance;
}

/* ── Masthead ─────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
  /* So .brand .date can absolute-position itself top-right of the bar */
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo {
  color: var(--neon-yellow);
  font-size: 24px;
  line-height: 1;
  text-shadow: var(--glow-yellow);
}
.brand .name {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 64, "wdth" 96;
  font-size: 28px;
  letter-spacing: -1.5px;
  background: linear-gradient(90deg, #ffffff, var(--neon-cyan), var(--neon-mag));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand .date {
  /* Designed top-right pill — yellow neon ring + soft glow.
     Stays out of the brand row's flexbox so the logo/name stay clean. */
  position: absolute;
  top: 12px;
  right: 18px;
  margin-left: 0;
  padding: 4px 10px;
  background:
    linear-gradient(135deg, rgba(255,230,0,0.10), rgba(255,154,60,0.06));
  border: 1px solid rgba(255,230,0,0.35);
  border-radius: 999px;
  color: var(--neon-yellow);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,230,0,0.45);
  z-index: 31;
  pointer-events: none;
}

.actions { display: flex; gap: 6px; }
.actions input, .actions button {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--sans);
}
.actions input { width: 220px; }
.actions button { cursor: pointer; min-width: 32px; font-weight: 700; }
.actions input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(0,225,255,0.15); }
.actions button:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan); }

/* ── Phone + small tablet (≤ 1024px) ─────────────────────────
   Stack the masthead so the search bar can fill the full width and
   the refresh/density buttons sit flush at the right edge. Date
   drops onto its own line under the brand name so the inline wrap
   doesn't push everything left. EVERY sticky/horizontal container
   gets the same 12px side padding so they line up edge-to-edge.
   `!important` on the structural overrides so any later cascade or
   stale browser-cached desktop rule can't accidentally win. */
@media (max-width: 1024px) {
  .masthead {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px;
    padding: 10px 12px !important;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    /* date is absolute-positioned, so nothing extra needed here */
    /* leave room on the right so the date pill doesn't overlap text */
    padding-right: 96px;
  }
  .brand .logo { font-size: 22px; }
  .brand .name { font-size: 24px; }
  .brand .date {
    /* Smaller pill on mobile */
    top: 10px;
    right: 12px;
    padding: 3px 8px;
    font-size: 9.5px;
  }
  .actions {
    display: flex !important;
    width: 100% !important;
    gap: 6px;
  }
  .actions input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .actions button { flex: 0 0 auto; }

  /* Match the side padding on every other top-level horizontal band
     so left and right edges of all the bars line up exactly. */
  .tape-track,
  .strip-track,
  .headline,
  .chips,
  .main-col {
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Chip nav: smaller, allow wrap, no horizontal scroll */
  .chips { gap: 5px; }
  .chip { padding: 4px 9px; font-size: 11px; }

  /* The headline (top-of-day brief) was 17px italic — too big on a
     phone. Shrink so it doesn't wrap into 4 lines. */
  .headline { font-size: 14px; padding-top: 12px; padding-bottom: 12px; }

  /* The price tape and the three flow strips were inheriting desktop
     padding (24px) but now share the same 12px. Same with the chip
     scroll gutter. */
  .tape { font-size: 11px; }

  /* Main column padding too — same edge alignment as everything above */
  .main-col {
    padding-top: 12px;
    padding-bottom: 30px;
  }
  /* In #paper grid, force single-column at this size so cards stretch
     edge-to-edge instead of squishing in a 12-col template. */
  #paper {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Tape ─────────────────────────────────────────────────── */
.tape {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,230,0,0.05), transparent);
  overflow: hidden;
  position: sticky;
  top: 60px;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.tape-track {
  display: flex;
  gap: 28px;
  padding: 8px 24px;
  white-space: nowrap;
  animation: marquee 110s linear infinite;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tick { display: inline-flex; align-items: center; gap: 7px; }
.tick .lbl { color: var(--text-2); font-weight: 700; letter-spacing: 0.4px; }
.tick .px  { color: var(--text); font-weight: 500; }
.tick .ch.up    { color: var(--up); font-weight: 700; text-shadow: 0 0 8px rgba(182,255,60,0.55); }
.tick .ch.down  { color: var(--down); font-weight: 700; text-shadow: 0 0 8px rgba(255,77,109,0.55); }

/* ── Headline ─────────────────────────────────────────────── */
.headline {
  padding: 16px 24px;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wdth" 95;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: linear-gradient(90deg, rgba(0,225,255,0.06), transparent 80%);
  letter-spacing: -0.3px;
}
.headline[lang="ko"] { font-family: var(--kr); font-weight: 600; letter-spacing: -0.4px; }
.headline:empty { display: none; }
.headline::before {
  content: "✦ TODAY";
  display: inline-block;
  font-family: var(--mono);
  color: var(--neon-yellow);
  font-weight: 700;
  font-size: 10.5px;
  font-style: normal;
  letter-spacing: 2px;
  margin-right: 12px;
  vertical-align: 2px;
  text-shadow: var(--glow-yellow);
}

/* ── Chips ────────────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: rgba(5,6,10,0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 102px;
  z-index: 19;
}
.chip {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
  text-transform: uppercase;
}
.chip .ct {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}
.chip .ct:empty { display: none; }
.chip.active .ct { background: rgba(0,0,0,0.18); color: inherit; opacity: 0.65; }
.chip:hover { border-color: var(--text-2); color: var(--text); }
.chip.active {
  background: var(--text);
  color: var(--bg-0);
  border-color: var(--text);
  box-shadow: 0 0 24px rgba(255,255,255,0.3);
}
.chip.active .ct { color: var(--bg-0); opacity: 0.5; }
.chip.cat-world.active  { background: var(--c-world);  border-color: var(--c-world);  color: #001722; box-shadow: 0 0 24px rgba(0,225,255,0.5); }
.chip.cat-econ.active   { background: var(--c-econ);   border-color: var(--c-econ);   color: #0b1a00; box-shadow: 0 0 24px rgba(182,255,60,0.45); }
.chip.cat-tech.active   { background: var(--c-tech);   border-color: var(--c-tech);   color: #170433; box-shadow: 0 0 24px rgba(179,136,255,0.45); }
.chip.cat-ai.active     { background: var(--c-ai);     border-color: var(--c-ai);     color: #2a0024; box-shadow: 0 0 24px rgba(255,43,214,0.5); }
.chip.cat-crypto.active { background: var(--c-crypto); border-color: var(--c-crypto); color: #2a1500; box-shadow: 0 0 24px rgba(255,154,60,0.5); }
.chip.cat-korea.active  { background: var(--c-korea);  border-color: var(--c-korea);  color: #2a001b; box-shadow: 0 0 24px rgba(255,91,232,0.5); }

/* ── Layout: main + right rail ────────────────────────────── */
/* Main column is now full-width — the right rail was retired and its
   contents moved to scrolling strips under the price tape. */
.main-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 18px 24px 30px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ── Horizontal marquee strips for whales / trades / videos ─────────
   Match the price-tape pattern at the top: each strip is a thin
   horizontal band that scrolls infinitely. Hover pauses. Click any
   item opens the detail modal. ── */
.strip {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.strip:empty { display: none; }
.strip-track {
  display: flex;
  gap: 22px;
  padding: 7px 16px;
  white-space: nowrap;
  animation: marquee 100s linear infinite;
  font-family: var(--mono);
  font-size: 11.5px;
}
.strip:hover .strip-track { animation-play-state: paused; }

.strip-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 10.5px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
}
.strip-whales .strip-label { color: var(--neon-lime);   text-shadow: 0 0 14px rgba(182,255,60,0.45); }
.strip-trades .strip-label { color: var(--neon-yellow); text-shadow: 0 0 14px rgba(255,230,0,0.45); }
.strip-videos .strip-label { color: var(--neon-pink);   text-shadow: 0 0 14px rgba(255,91,232,0.45); }

.strip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: background 0.12s;
}
.strip-item:hover { background: rgba(255,255,255,0.05); }

/* Whale strip item: [BTC] [BUY] $79M UNK → Binance */
.strip-whales .asset { color: var(--neon-cyan); font-weight: 800; letter-spacing: 0.5px; }
.strip-whales .amt   { color: var(--neon-lime); font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(182,255,60,0.35); }
.strip-whales .flow  { color: var(--text-2); }
.strip-whales .arrow { color: var(--muted); padding: 0 1px; }
.strip-whales .action {
  font-weight: 800;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.6px;
}
.strip-whales .action.BUY  { background: rgba(182,255,60,0.18); color: var(--up); }
.strip-whales .action.SELL { background: rgba(255,77,109,0.18); color: var(--down); }

/* Trade strip item: Pelosi BUY NVDA $1M–$5M */
.strip-trades .who    { color: var(--text); font-weight: 700; }
.strip-trades .action { font-weight: 800; padding: 0 5px; border-radius: 3px; font-size: 10px; }
.strip-trades .action.BUY  { background: rgba(182,255,60,0.18);  color: var(--up); }
.strip-trades .action.SELL { background: rgba(255,77,109,0.18); color: var(--down); }
.strip-trades .ticker { color: var(--neon-yellow); font-weight: 800; text-shadow: 0 0 8px rgba(255,230,0,0.3); }
.strip-trades .band   { color: var(--muted); }

/* Video strip item: 📺 Bloomberg · headline… */
.strip-videos .channel { color: var(--neon-pink); font-weight: 800; }
.strip-videos .vtitle  { color: var(--text-2); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── No-image cards: float layout — each card sizes to its own
       content; no grid row-stretching pulling neighbors taller. ── */
#paper-noimg {
  display: flow-root;        /* establishes BFC, contains the floats */
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
#paper-noimg:empty { display: none; }
#paper-noimg::before {
  content: "MORE 더보기";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}
#paper-noimg > .art {
  float: left;
  width: calc((100% - 36px) / 4);   /* 4 per row, 12px gutters × 3 */
  margin: 0 12px 12px 0;
}
#paper-noimg > .art:nth-child(4n) { margin-right: 0; }

@media (max-width: 1400px) {
  #paper-noimg > .art { width: calc((100% - 24px) / 3); margin-right: 12px; }
  #paper-noimg > .art:nth-child(4n) { margin-right: 12px; }
  #paper-noimg > .art:nth-child(3n) { margin-right: 0; }
}
@media (max-width: 900px) {
  #paper-noimg > .art { width: calc((100% - 12px) / 2); }
  #paper-noimg > .art:nth-child(3n) { margin-right: 12px; }
  #paper-noimg > .art:nth-child(2n) { margin-right: 0; }
}
@media (max-width: 600px) {
  #paper-noimg > .art { width: 100%; margin-right: 0; }
}

/* ── Paper grid ───────────────────────────────────────────── */
#paper {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-flow: dense;
  gap: 12px;
}

/* Spans by tier (image cards only — text-only cards are floated in
   #paper-noimg and don't participate in this grid).
   All non-hero tiers span 6 so the grid is a uniform 2-per-row band
   below the hero — no orphan boxes left over in the last row. */
.tier-hero       { grid-column: span 12; }
.tier-feature    { grid-column: span 6;  }
.tier-large      { grid-column: span 6;  }
.tier-medium     { grid-column: span 6;  }
.tier-small      { grid-column: span 6;  }

@media (max-width: 800px) {
  .tier-hero, .tier-feature, .tier-large, .tier-medium, .tier-small {
    grid-column: span 12;
  }
}

/* ── Article cards (base) ─────────────────────────────────── */
.art {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005)),
    rgba(11, 13, 24, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  animation: fadein 0.4s ease-out both;
}

/* Flex-grow: the headline fills the box on image-less cards.
   Stops short, lonely cards from leaving empty padding wasteland. */
.art > .h { flex: 1 1 auto; }
.art:hover {
  transform: translateY(-3px);
  z-index: 2;
}

/* category neon glow on hover, with vertical accent bar */
.art::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--line-2);
  transition: width 0.18s, background 0.18s, box-shadow 0.18s;
}
.art:hover::before { width: 5px; }

.art.cat-world  { --c: var(--c-world); }
.art.cat-econ   { --c: var(--c-econ); }
.art.cat-tech   { --c: var(--c-tech); }
.art.cat-ai     { --c: var(--c-ai); }
.art.cat-crypto { --c: var(--c-crypto); }
.art.cat-korea  { --c: var(--c-korea); }
.art.cat-whale  { --c: var(--c-whale); }
.art.cat-trade  { --c: var(--c-trade); }
.art.cat-video  { --c: var(--c-video); }

.art::before { background: var(--c, var(--line-2)); }
.art:hover {
  border-color: var(--c, var(--neon-cyan));
  box-shadow:
    0 6px 28px rgba(0,0,0,0.45),
    0 0 0 1px var(--c, var(--neon-cyan)),
    0 0 28px color-mix(in srgb, var(--c, var(--neon-cyan)) 40%, transparent);
}

/* ── Meta line ────────────────────────────────────────────── */
.art .meta {
  /* Stays on ONE line — never wrap, never steal vertical space.
     Source name truncates with ellipsis if it would push the row wider. */
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.2;
}
.art .meta > * { flex-shrink: 0; }
.art .meta .src {
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.art .meta .src { color: var(--text-2); }
.art .meta .when { color: var(--dim); }
.art .meta .lang {
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9.5px;
  border: 1px solid var(--line-2);
}
.art .meta .lang-ko { color: var(--c-korea); border-color: rgba(255,91,232,0.45); }
.art .meta .lang-en { color: var(--c-world); border-color: rgba(0,225,255,0.45); }
.art .meta .tag {
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 800;
  background: color-mix(in srgb, var(--c, var(--text-2)) 18%, transparent);
  color: var(--c, var(--text-2));
  letter-spacing: 0.6px;
}
.art .meta .score-pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-yellow);
  letter-spacing: 0.5px;
}

/* ── Image (responsive, with bottom gradient + category badge) ── */
.art .img {
  /* Layered background:
     1. inline `background-image: url('…')` set by JS (top, covers when loaded)
     2. category-color gradient fallback below — if the publisher's CDN
        404s or stalls, this is what the user sees instead of an empty box. */
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.5s ease-out, filter 0.5s ease-out;
  filter: saturate(1.08) contrast(1.06);
}
/* Per-category neon backdrop that peeks through when the photo fails
   to load. Lives behind .img via ::before so the inline image URL on
   .img keeps its precedence when the photo IS available. */
.art .img::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 30% 20%,
      color-mix(in srgb, var(--c, var(--neon-cyan)) 35%, transparent),
      transparent 70%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--c, var(--neon-mag)) 22%, transparent),
      color-mix(in srgb, var(--c, var(--neon-cyan)) 14%, transparent));
}
.art .img::after {
  /* subtle vignette so the image edge melts into the dark card */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5,6,10,0.45) 100%);
  pointer-events: none;
}
.art:hover .img {
  transform: scale(1.04);
  filter: saturate(1.28) contrast(1.12) brightness(1.04);
}

/* ── Headline typography ──────────────────────────────────── */
.art .h {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 96;
  letter-spacing: -0.6px;
  color: var(--text);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
  font-optical-sizing: auto;
}
.art .h[lang="ko"] {
  font-family: var(--kr);
  font-weight: 800;
  font-variation-settings: normal;
  letter-spacing: -0.55px;
  line-height: 1.22;
  font-feature-settings: "palt" 1, "vpal" 1, "kern" 1;
}
/* dek = body snippet — make it always-visible and pretty */
.art .dek {
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  opacity: 0.85;
}
.art .dek[lang="ko"] { font-family: var(--kr); }
.art .dek {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.art .why {
  font-family: var(--accent-serif);
  font-style: italic;
  color: var(--neon-yellow);
  font-size: 13px;
  line-height: 1.35;
  border-left: 2px solid var(--neon-yellow);
  padding-left: 8px;
  margin-top: 2px;
  text-shadow: 0 0 14px rgba(255,230,0,0.25);
}
.art .why[lang="ko"] { font-family: var(--kr); font-style: normal; font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   Tier layouts — each tier is its own composition.
   No tier sets min-height: cards size to their actual content so the
   grid packs densely (short story → small box, long story → big box).
   Every tier shows the body snippet (dek) where there's room.
   ════════════════════════════════════════════════════════════ */

/* ── HERO — image covers the TOP HALF (full width), text below ── */
.tier-hero {
  padding: 0;                  /* image flush with card edges */
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(0,225,255,0.07), rgba(255,43,214,0.07)),
    rgba(11,13,24,0.85);
  box-shadow: 0 10px 50px rgba(0,0,0,0.35);
  gap: 0;
  /* default flex-column from .art → image on top */
}
.tier-hero::before { display: none; }
.tier-hero .img {
  width: 100%;
  aspect-ratio: 21/9;          /* cinematic, ~50% of the card */
  min-height: 420px;
  border-radius: 0;            /* image fills to the card edge */
  filter: saturate(1.15) contrast(1.08);
}
.tier-hero .body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 28px 26px;
}
@media (max-width: 900px) {
  .tier-hero .img { min-height: 240px; aspect-ratio: 16/9; }
}
.tier-hero .body { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.tier-hero .h {
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 96;
  line-height: 0.98;
  letter-spacing: -2px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-hero .h[lang="ko"] {
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.15;
  letter-spacing: -1.6px;
}
/* English hero gets a high-contrast DM Serif drop cap. */
.tier-hero .h[lang="en"]::first-letter {
  font-family: var(--accent-serif);
  font-style: italic;
  color: var(--neon-yellow);
  text-shadow: var(--glow-yellow);
  font-weight: 400;
  padding-right: 4px;
}
.tier-hero .dek { font-size: 15px; -webkit-line-clamp: 5; }
.tier-hero .why { font-size: 14.5px; }
@media (max-width: 900px) {
  .tier-hero { grid-template-columns: 1fr; }
}

/* ── FEATURE — image ON TOP, full card width, big and dominant ── */
.tier-feature {
  padding: 14px 16px;
  /* default flex-column from .art puts image on top */
}
.tier-feature .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 280px;
  border-radius: 11px;
  filter: saturate(1.12) contrast(1.07);
}
.tier-feature .h {
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 800;
  font-variation-settings: "opsz" 72, "wdth" 90;
  line-height: 1.08;
  letter-spacing: -0.8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-feature .h[lang="ko"] {
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 800;
  letter-spacing: -0.8px;
}
.tier-feature .dek { -webkit-line-clamp: 4; font-size: 13px; }

/* ── LARGE — image ON TOP, full card width ──────────────── */
.tier-large {
  padding: 12px 14px;
}
.tier-large .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 220px;
  border-radius: 10px;
  filter: saturate(1.1) contrast(1.06);
}
.tier-large .h {
  font-size: clamp(20px, 1.7vw, 24px);
  font-weight: 800;
  font-variation-settings: "opsz" 60, "wdth" 92;
  line-height: 1.12;
  letter-spacing: -0.6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-large .h[lang="ko"] { font-size: clamp(17.5px, 1.55vw, 20px); }
.tier-large .dek { -webkit-line-clamp: 3; font-size: 12.5px; }

/* ── MEDIUM — image ON TOP, full card width ─────────────── */
.tier-medium {
  padding: 12px 14px;
  /* default flex-column from .art puts image on top */
}
.tier-medium .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 170px;
  border-radius: 9px;
}
.tier-medium .h {
  font-size: clamp(18px, 1.4vw, 22px);    /* >2× the 9.5px meta */
  font-weight: 800;
  font-variation-settings: "opsz" 48, "wdth" 90;
  line-height: 1.12;
  letter-spacing: -0.55px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-medium .h[lang="ko"] {
  font-size: clamp(16px, 1.25vw, 19px);
  letter-spacing: -0.8px;
}
.tier-medium .dek { -webkit-line-clamp: 3; font-size: 12px; }

/* ── SMALL — image ON TOP, dominates card height ──────── */
.tier-small {
  padding: 11px 13px;
  /* default flex-column from .art */
}
.tier-small .img {
  width: 100%;
  aspect-ratio: 16/10;
  min-height: 150px;
  border-radius: 8px;
}
.tier-small .h {
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 800;
  font-variation-settings: "opsz" 36, "wdth" 88;
  line-height: 1.14;
  letter-spacing: -0.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-small .h[lang="ko"] {
  font-size: clamp(14.5px, 1.1vw, 17px);
  letter-spacing: -0.7px;
}
.tier-small .dek { -webkit-line-clamp: 2; font-size: 11.5px; }

/* ── HEADLINE — NO image, big bold display title + dek snippet
       Box shrinks to content (no min-height). */
.tier-headline {
  padding: 14px 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--c, var(--text-2)) 8%, transparent), transparent 40%),
    rgba(11,13,24,0.82);
}
.tier-headline .h {
  font-family: var(--display);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 800;
  font-variation-settings: "opsz" 88, "wdth" 85;
  line-height: 1.02;
  letter-spacing: -1.2px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 0 22px color-mix(in srgb, var(--c, var(--text)) 22%, transparent);
}
.tier-headline .h[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  font-weight: 900;
  font-size: clamp(20px, 1.85vw, 26px);
  letter-spacing: -1px;
  line-height: 1.18;
}
.tier-headline .dek {
  font-size: 12px;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── FLASH — no image, smaller, still bold, with one-line dek ── */
.tier-flash {
  padding: 11px 13px;
}
.tier-flash .h {
  font-family: var(--display);
  font-size: clamp(17px, 1.55vw, 22px);   /* >2× meta */
  font-weight: 800;
  font-variation-settings: "opsz" 44, "wdth" 86;
  line-height: 1.12;
  letter-spacing: -0.6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-flash .h[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  font-weight: 800;
  font-size: clamp(15.5px, 1.4vw, 19px);
  line-height: 1.22;
  letter-spacing: -0.8px;
}
.tier-flash .dek {
  font-size: 11px;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tier-flash .meta { font-size: 9.5px; }

/* ── Sparkline row ────────────────────────────────────────── */
.spark-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.spark {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.spark .sym { font-weight: 800; color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,225,255,0.4); }
.spark svg { display: block; }
.spark .ch.up   { color: var(--up); font-weight: 700; }
.spark .ch.down { color: var(--down); font-weight: 700; }
.spark svg polyline {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: draw 1s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Right rail (legacy — no longer rendered) ───────────────
   The whales / trades / videos content lives in the horizontal
   marquee strips at the top now. These rules stay in place purely
   so older snapshots don't visually explode. */
#rail { display: none !important; }
.LEGACY_RAIL {
  position: sticky;
  top: 160px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-bottom: 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
#rail::-webkit-scrollbar { width: 6px; }
#rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

@media (max-width: 1080px) {
  #rail { position: static; max-height: none; }
}

.rail-section {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005)),
    rgba(11,13,24,0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.rail-head .dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--neon-lime);
  box-shadow: 0 0 12px var(--neon-lime);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.55; transform: scale(1.4); }
}
.rail-whales .rail-head { color: var(--neon-lime); text-shadow: 0 0 12px rgba(182,255,60,0.4); }
.rail-trades .rail-head { color: var(--neon-yellow); text-shadow: 0 0 12px rgba(255,230,0,0.4); }
.rail-trades .rail-head .dot { background: var(--neon-yellow); box-shadow: 0 0 12px var(--neon-yellow); }
.rail-videos .rail-head { color: var(--neon-pink); text-shadow: 0 0 12px rgba(255,91,232,0.4); }
.rail-videos .rail-head .dot { background: var(--neon-pink); box-shadow: 0 0 12px var(--neon-pink); }

.rail-body { display: flex; flex-direction: column; }

/* Whale row */
.w-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.w-row:first-child { border-top: 0; }
.w-row .amt {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--neon-lime);
  letter-spacing: -0.3px;
  text-shadow: 0 0 12px rgba(182,255,60,0.35);
  font-variant-numeric: tabular-nums;
}
.w-row .asset {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0,225,255,0.3);
}
.w-row .flow {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 11.5px;
}
.w-row .when {
  font-family: var(--mono);
  color: var(--dim);
  font-size: 10px;
}

/* Trade row */
.t-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.t-row:first-child { border-top: 0; }
.t-row .who {
  font-family: var(--kr), var(--sans);
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.t-row .action {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.t-row .action.BUY  { background: rgba(182,255,60,0.18);  color: var(--up); }
.t-row .action.SELL { background: rgba(255,77,109,0.18); color: var(--down); }
.t-row .ticker {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255,230,0,0.3);
}
.t-row .meta-line {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex; gap: 10px;
}

/* Video row */
.v-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.v-row:first-child { border-top: 0; }
.v-row .thumb {
  width: 90px;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  border-radius: 5px;
  filter: saturate(1.1);
  transition: filter 0.2s;
}
.v-row:hover .thumb { filter: saturate(1.4) brightness(1.05); }
.v-row .meta-block { display: flex; flex-direction: column; gap: 3px; }
.v-row .title { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); }
.v-row .ch { font-family: var(--mono); font-size: 10px; color: var(--neon-pink); letter-spacing: 0.4px; }

/* ── Pager ────────────────────────────────────────────────── */
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 50px;
  flex-wrap: wrap;
}
.pager button {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 40px;
  transition: all 0.12s;
}
.pager button:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.pager button.current {
  background: var(--neon-yellow);
  border-color: var(--neon-yellow);
  color: #1a1305;
  box-shadow: var(--glow-yellow);
}
.pager button:disabled { opacity: 0.3; cursor: default; box-shadow: none; }
.pager .label { color: var(--muted); font-family: var(--mono); font-size: 12px; align-self: center; margin: 0 6px; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.8px;
}
.muted { color: var(--muted); }

/* ── Fade-in ──────────────────────────────────────────────── */
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reader modal ─────────────────────────────────────────── */
.reader.hidden { display: none; }
.reader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  animation: fadein 0.18s ease-out;
}
.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(10px);
}
.reader-card {
  position: relative;
  width: min(820px, calc(100vw - 32px));
  max-height: 92vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent),
    var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  padding: 30px 36px 36px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.5),
              0 0 60px rgba(0,225,255,0.08);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.reader-card::-webkit-scrollbar { width: 6px; }
.reader-card::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.reader-close {
  /* Pinned to a fixed slot inside .reader-card. Replaces the old
     sticky+float combo which let multiple sibling × buttons stack at
     the same anchor when JS accidentally appended duplicates. */
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(11,13,24,0.85);
  color: var(--text);
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  font-family: var(--sans);
  z-index: 5;
}
.reader-close:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

.reader-loading {
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  padding: 100px 0;
  font-size: 13px;
  letter-spacing: 1.5px;
}

.reader-img {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  border-radius: 12px;
  margin-bottom: 22px;
  filter: saturate(1.1);
}

.reader-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}
.reader-meta .src { color: var(--text-2); font-weight: 700; }
.reader-meta .tag {
  background: rgba(0,225,255,0.14);
  color: var(--neon-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.reader-title {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "opsz" 88, "wdth" 92;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  margin: 0 0 22px;
  color: var(--text);
}
.reader-title[lang="ko"] {
  font-family: var(--kr);
  font-variation-settings: normal;
  letter-spacing: -1.2px;
  line-height: 1.18;
}

.reader-tldr {
  background:
    linear-gradient(90deg, rgba(255,230,0,0.08), transparent 80%),
    rgba(255,255,255,0.02);
  border-left: 3px solid var(--neon-yellow);
  padding: 16px 20px;
  border-radius: 10px;
  margin: 0 0 22px;
}
.reader-tldr .tldr-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neon-yellow);
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: 700;
  text-shadow: var(--glow-yellow);
}
.reader-tldr p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wdth" 96;
}
.reader-tldr p[lang="ko"] { font-family: var(--kr); font-variation-settings: normal; }

.reader-section-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  font-weight: 700;
  margin: 0 0 10px;
  text-shadow: var(--glow-cyan);
}

.reader-points {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reader-points li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.reader-points li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--neon-cyan);
  font-weight: 800;
  font-family: var(--mono);
}

.reader-body p {
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 14px;
  color: var(--text-2);
}
.reader-body p[lang="ko"] { font-family: var(--kr); line-height: 1.65; }

.reader-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.reader-footer .badge {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.reader-original {
  color: var(--neon-cyan);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.6px;
  font-weight: 700;
}
.reader-original:hover { text-shadow: var(--glow-cyan); }
