:root {
  --bg: #111111;
  --surface: #171717;
  --surface-2: #1d1d1d;
  --text: #f4f4f2;
  --muted: #8c8c88;
  --line: rgba(255,255,255,.11);
  --soft-line: rgba(255,255,255,.06);
  --accent: #f4f4f2;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button, a { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 74px;
  padding: 0 clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--soft-line);
}
.brand, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 24px rgba(255,255,255,.45);
}
.status { color: #b6ff8a; }
.trade-mode-badge { color: #ffd86b; border: 1px solid rgba(255,216,107,.35); border-radius: 999px; padding: 5px 8px; font-size: 8px; letter-spacing: .14em; }
.status::before { content: "•"; margin-right: 6px; }
.clock { color: var(--muted); min-width: 52px; text-align: right; }

.hero {
  position: relative;
  min-height: 58vh;
  padding: clamp(52px, 7vw, 92px) clamp(22px, 7vw, 108px) 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-kicker, .section-eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
}
.phrase-stage {
  position: relative;
  display: grid;
  align-items: center;
  margin: 28px 0 38px;
  min-height: clamp(170px, 25vw, 330px);
  overflow: hidden;
}
.phrase {
  grid-area: 1 / 1;
  max-width: 1180px;
  font-size: clamp(48px, 8.4vw, 138px);
  line-height: .84;
  letter-spacing: -.075em;
  font-weight: 800;
  text-transform: uppercase;
  text-wrap: balance;
  transform-origin: left center;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), filter .7s ease;
}
.phrase.entering { opacity: 0; transform: translateY(28px) scale(.985); filter: blur(9px); }
.phrase.leaving { opacity: 0; transform: translateY(-20px) scale(.985); filter: blur(7px); }
.phrase.ghost { visibility: hidden; pointer-events: none; }
.progress-line { height: 1px; background: var(--line); overflow: hidden; }
.progress-line span { display: block; width: 0%; height: 100%; background: var(--text); }
.phrase-meta {
  margin-top: 13px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}

.marquee-wrap {
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  overflow: hidden;
  white-space: nowrap;
}
.marquee {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  min-width: max-content;
  padding: 17px 0;
  animation: ticker 42s linear infinite;
  will-change: transform;
}
.marquee span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  color: #d0d0cc;
}
.marquee .sep { color: #4e4e4b; }
@keyframes ticker { to { transform: translateX(-50%); } }

.news-section { padding: 42px clamp(22px, 4vw, 64px) 34px; }
.news-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 24px;
}
.news-head h2 { margin: 7px 0 0; font-size: clamp(27px, 4vw, 46px); letter-spacing: -.045em; }
.source-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.filter {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  cursor: pointer;
  transition: .2s ease;
}
.filter:hover, .filter.active { background: var(--text); color: #111; border-color: var(--text); }
.news-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(285px, 34vw);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
  padding-bottom: 10px;
}
.news-card {
  min-height: 214px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--soft-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-snap-align: start;
  transition: transform .2s ease, background .2s ease;
}
.news-card:hover { transform: translateY(-3px); background: var(--surface-2); }
.news-card a { color: inherit; text-decoration: none; display: contents; }
.news-topline, .news-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.news-title {
  margin: 20px 0 24px;
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.news-arrow { font-size: 18px; color: var(--text); }
.loading-card { color: var(--muted); justify-content: center; font-size: 11px; letter-spacing: .12em; }

.footer {
  margin-top: auto;
  padding: 24px clamp(22px, 4vw, 64px) 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.footer-actions { display: flex; gap: 18px; }
.text-btn { border: 0; padding: 0; background: transparent; cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.text-btn:hover { color: white; }
.mode-btn { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .12em; transition: .2s ease; }
.mode-btn:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.mode-btn.active { color: #111; background: #ffd86b; border-color: #ffd86b; }
.trade-mode .brand-dot { background: #ffd86b; box-shadow: 0 0 24px rgba(255,216,107,.45); }
.trade-mode .progress-line span { background: #ffd86b; }

@media (max-width: 760px) {
  .topbar { height: 62px; }
  .hero { min-height: 52vh; padding-top: 48px; }
  .phrase-stage { min-height: 225px; }
  .news-head { align-items: flex-start; flex-direction: column; }
  .source-filters { justify-content: flex-start; }
  .news-track { grid-auto-columns: minmax(280px, 84vw); }
  .footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
