/* ============ AI SUPER CYCLE — light editorial edition ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --panel: #ffffff;
  --border: #e5e8ee;
  --border-strong: #d4d9e2;
  --text: #14161c;
  --muted: #5e6776;
  --faint: #98a0ae;
  --green: #0a8a4e;
  --red: #d92347;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --amber: #b45309;
  --rose: #be123c;
  --grad: linear-gradient(92deg, #7c3aed 0%, #4f46e5 45%, #0891b2 100%);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --shadow: 0 1px 2px rgba(20, 22, 28, 0.05), 0 8px 24px rgba(20, 22, 28, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; }

a { color: inherit; text-decoration: none; }
.up   { color: var(--green); }
.down { color: var(--red); }
.hidden { display: none; }

/* ---------- ticker tape ---------- */
.tape-wrap {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}
.tape { display: inline-block; padding: 7px 0; animation: tape-scroll 60s linear infinite; will-change: transform; }
.tape-wrap:hover .tape { animation-play-state: paused; }
@keyframes tape-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; gap: 7px; margin: 0 16px; align-items: baseline; }
.tape-item .sym { color: var(--muted); font-weight: 600; }
.tape-item .px  { color: var(--text); }

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 22px 28px 14px;
  max-width: 1380px;
  margin: 0 auto;
  border-bottom: 2px solid var(--text);
}
.brand h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dateline { color: var(--muted); font-size: 12.5px; letter-spacing: 0.06em; margin-top: 3px; font-family: var(--mono); }

.status-cluster { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.market-state {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  letter-spacing: 0.1em;
  background: var(--bg-soft);
}
.market-state.open    { color: var(--green); border-color: rgba(10, 138, 78, 0.45); background: rgba(10, 138, 78, 0.07); }
.market-state.extended{ color: var(--amber); border-color: rgba(180, 83, 9, 0.4); background: rgba(180, 83, 9, 0.06); }
.market-state.closed  { color: var(--muted); }
.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.refresh-btn, .gist-refresh, .load-more {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.refresh-btn:hover, .gist-refresh:hover, .load-more:hover { border-color: var(--violet); color: var(--violet); }
.spinning .refresh-icon { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  max-width: 1380px;
  margin: 10px auto 0;
  padding: 10px 18px;
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  border-radius: 10px;
  font-size: 13px;
}

/* ---------- layout ---------- */
main { max-width: 1380px; margin: 0 auto; padding: 20px 28px 40px; }

.kicker { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.kicker-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kicker-sub { color: var(--muted); font-size: 12px; }
.updated { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.skeleton-row { color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 14px 2px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ---------- the gist ---------- */
.gist {
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(700px 220px at 8% 0%, rgba(124, 58, 237, 0.07), transparent 60%),
    radial-gradient(700px 240px at 95% 100%, rgba(8, 145, 178, 0.07), transparent 60%),
    var(--bg-soft);
  padding: 20px 26px 20px;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.gist .kicker { margin-bottom: 10px; }
.gist-refresh { margin-left: auto; }
.gist-body p { font-family: var(--serif); font-size: 17.5px; line-height: 1.62; margin-bottom: 12px; }
.gist-body p:last-child { margin-bottom: 0; }
.gist-body strong { color: #000; }
.gist-body a { border-bottom: 1px dotted var(--faint); }
.gist-body a:hover { color: var(--violet); border-color: var(--violet); }
.gist-list { list-style: none; margin: 4px 0 12px; }
.gist-list li {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.55;
  padding-left: 22px;
  position: relative;
  margin-bottom: 7px;
}
.gist-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gist-drivers-label { font-size: 15px !important; color: var(--muted); }
.gist-drivers-label code { font-family: var(--mono); font-size: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.ai-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  color: var(--violet);
  background: rgba(124, 58, 237, 0.06);
}

/* ---------- hero zone (magazine layout) ---------- */
.big10 { margin-bottom: 38px; }
/* #1 — wide lead: image beside the headline, fills one row (no dead column) */
.big10-lead {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
/* #2–#10 — even grid of uniform cards */
.big10-rest {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 24px 22px;
}

/* images & placeholders */
.thumb { position: relative; overflow: hidden; border-radius: 10px; background: var(--bg-soft); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-169 { aspect-ratio: 16 / 9; }
.thumb-43  { aspect-ratio: 4 / 3; }
.ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
}
.ph-icon { font-size: clamp(20px, 22%, 44px); line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25)); }
.ph-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; font-weight: 600; opacity: 0.92; }
/* subtle texture so a tile never reads as a flat block of color */
.ph::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,0.18), transparent 55%);
  pointer-events: none;
}
.ph-markets  { background: linear-gradient(135deg, #0e7490, #155e75 60%, #164e63); }
.ph-tech     { background: linear-gradient(135deg, #7c3aed, #5b21b6 60%, #4c1d95); }
.ph-business { background: linear-gradient(135deg, #d97706, #b45309 60%, #92400e); }
.ph-politics { background: linear-gradient(135deg, #e11d48, #be123c 60%, #9f1239); }

.rank-pip {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  background: var(--grad);
  border-radius: 6px;
  padding: 1px 7px;
  flex: none;
}
.sub-head { display: flex; gap: 8px; align-items: baseline; }
.hero-thumb { position: relative; }
.hero-rank {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-weight: 700; font-size: 18px;
  color: #fff; background: var(--grad);
  border-radius: 9px; padding: 3px 13px;
  box-shadow: 0 2px 10px rgba(20, 22, 28, 0.35);
}

/* lead (#1) */
.big10-lead .hero-thumb { box-shadow: var(--shadow); }
.big10-lead .thumb { border-radius: 12px; }
.hero-title { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.005em; }
.hero-summary { font-family: var(--serif); font-size: 16px; color: #3c4250; line-height: 1.56; margin-top: 10px; }
a:hover .hero-title, a:hover .card-title, a:hover .zone-title, a:hover .news-title { text-decoration: underline; text-decoration-color: rgba(124, 58, 237, 0.55); text-underline-offset: 3px; }

/* cards (#2–#10) */
.big10-card { display: flex; flex-direction: column; }
.card-thumb { position: relative; margin-bottom: 9px; }
.card-pip { position: absolute; top: 8px; left: 8px; font-size: 11px; box-shadow: 0 1px 6px rgba(20,22,28,0.3); }
.card-title { font-family: var(--serif); font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.card-summary {
  font-family: var(--serif); font-size: 13.5px; color: #4b5260; line-height: 1.48; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.big-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; margin-top: 10px; }
.big-meta-sm { margin-top: 6px; }
.src-badge { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); letter-spacing: 0.04em; background: var(--bg-soft); }
.cat-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.cat-markets  { background: var(--cyan); }
.cat-tech     { background: var(--violet); }
.cat-business { background: #d97706; }
.cat-politics { background: var(--rose); }
.news-time { color: var(--faint); }
.new-flag { color: #fff; background: var(--green); font-weight: 700; padding: 1px 7px; border-radius: 999px; letter-spacing: 0.1em; font-size: 10px; }
.also { color: var(--muted); }
.also a { color: var(--muted); border-bottom: 1px dotted var(--faint); }
.also a:hover { color: var(--violet); border-color: var(--violet); }

/* ---------- markets band ---------- */
.markets-band {
  border-top: 2px solid var(--text);
  padding-top: 14px;
  margin-bottom: 38px;
}
.markets-band .vibe { display: inline-flex; align-items: center; gap: 8px; }
.vibe-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: rgba(217, 35, 71, 0.25); overflow: hidden; }
.vibe-fill { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #0a8a4e, #0891b2); border-radius: 3px; transition: width 0.8s ease; }
.vibe-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; }

.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.strip-ai { padding-top: 0; }
.chip {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 1px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 13px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(20, 22, 28, 0.04);
  transition: border-color 0.15s, transform 0.15s;
}
.chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.chip .c-label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip .c-px { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip .c-pct { font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: right; }
.chip svg { width: 56px; height: 18px; grid-row: span 2; }
.chip-empty { opacity: 0.6; }
.chip .c-dash { font-family: var(--mono); font-size: 12px; color: var(--faint); text-align: center; }
.tape-item .flat { color: var(--faint); }
.t-pct.flat { color: var(--faint); }

/* ---------- trending ---------- */
.trending { border-top: 2px solid var(--text); padding-top: 14px; margin-bottom: 38px; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.trend-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.t-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.t-rank {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: #fff; background: var(--grad); border-radius: 6px; padding: 1px 7px;
}
.t-sym { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.t-name { color: var(--muted); font-size: 12.5px; }
.t-pct { margin-left: auto; font-family: var(--mono); font-size: 14px; font-weight: 600; }
.t-price { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.trend-card .t-chart svg { width: 100%; height: 58px; display: block; }
.t-buzz { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; line-height: 1.5; }
.t-eod { font-family: var(--mono); font-size: 8.5px; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; vertical-align: middle; }
.t-explain {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: var(--violet);
  font-family: var(--mono);
  font-size: 11.5px;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.15s, color 0.15s;
}
.t-explain:hover { background: var(--violet); color: #fff; }
.t-answer {
  border-top: 1px dashed var(--border-strong);
  margin-top: 8px;
  padding-top: 9px;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: #2c3340;
}
.t-answer p { margin-bottom: 7px; }
.t-answer p:last-child { margin-bottom: 0; }
.t-answer .t-src { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.08em; }
.t-answer ul { list-style: none; }
.t-answer li { margin-bottom: 6px; }
.t-answer li a { border-bottom: 1px dotted var(--faint); }
.t-answer li a:hover { color: var(--violet); border-color: var(--violet); }

/* ---------- watch ---------- */
.watch { border-top: 2px solid var(--text); padding-top: 14px; margin-bottom: 38px; }
.video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.video-card { display: flex; flex-direction: column; gap: 7px; }
.v-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2433, #0f1320);
  box-shadow: var(--shadow);
}
.v-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.72);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  padding-left: 3px;
  transition: background 0.15s, transform 0.15s;
}
.video-card:hover .v-play { background: var(--violet); transform: translate(-50%, -50%) scale(1.08); }
.v-title { font-family: var(--serif); font-size: 14.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.video-card:hover .v-title { text-decoration: underline; text-decoration-color: rgba(124, 58, 237, 0.55); text-underline-offset: 3px; }
.v-meta { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; }

/* ---------- section zones ---------- */
.zone { border-top: 2px solid var(--text); padding-top: 14px; margin-bottom: 38px; }
.zone-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.zone-name { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; gap: 9px; }
.zone-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; align-items: start; }
.zone-lead .thumb { margin-bottom: 10px; }
.zone-title { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.3; }
.zone-lead .zone-title { font-size: 22px; }
.zone-summary { font-family: var(--serif); font-size: 14px; color: #4b5260; line-height: 1.5; margin-top: 6px; }
.zone-col .zone-item { padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--border); }
.zone-col .zone-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.zone-col .zone-title { font-size: 15.5px; font-weight: 600; }

/* ---------- the latest ---------- */
.latest { border-top: 2px solid var(--text); padding-top: 14px; }
.news-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.news-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.news-tabs button {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.news-tabs button:hover { color: var(--text); border-color: var(--text); }
.news-tabs button.active { color: #fff; background: var(--grad); border-color: transparent; font-weight: 600; }

#newsSearch {
  flex: 1;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 15px;
  outline: none;
  transition: border-color 0.2s;
}
#newsSearch:focus { border-color: var(--violet); }
#newsSearch::placeholder { color: var(--faint); }

.news-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 34px; }
.news-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 13px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.news-item .thumb { aspect-ratio: 1 / 1; border-radius: 8px; }
.news-item .ph { gap: 3px; }
.news-item .ph-icon { font-size: 22px; }
.news-item .ph-label { font-size: 7px; letter-spacing: 0.08em; }
.news-title { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.35; }
.news-summary { font-family: var(--serif); font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; margin-top: 6px; flex-wrap: wrap; }

.load-more { display: block; margin: 20px auto 0; padding: 8px 22px; }

footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 28px 30px;
  color: var(--faint);
  font-size: 11px;
  font-family: var(--mono);
  border-top: 1px solid var(--border);
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .zone-grid { grid-template-columns: 1fr 1fr; }
  .zone-lead { grid-column: 1 / -1; }
  .news-list { grid-template-columns: 1fr; }
  .trend-grid { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .masthead, main, footer { padding-left: 14px; padding-right: 14px; }
  .clock { display: none; }
  .big10-lead { grid-template-columns: 1fr; gap: 14px; }
  .zone-grid, .trend-grid, .video-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 25px; }
}
