@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* Stocks HQ Live — dark navy market terminal theme.
   The logo animation (draw / pop / heartbeat) is ported from the
   Market Trends Live preview's theme.css, recolored to the final
   "Pulse" spec: white line + arrowhead in a circle on dark navy. */

:root {
  color-scheme: dark;
  --bg: #081120;
  --bg-2: #0a1730;
  --surface: #0e1e3d;
  --surface-alt: #12294d;
  --text: #eef2f8;
  --dim: #8fa3c0;
  --border: #1e3355;
  --up: #2fbf71;
  --down: #f0564a;
  --amber: #e8a33d;
  --logo-disc: #12294d;
  --logo-fg: #ffffff;
  --radius: 10px;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.mono { font-family: var(--font-mono); }
.up { color: var(--up); }
.down { color: var(--down); }
.dim { color: var(--dim); }

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.site-header {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.brand-name .live { color: var(--up); }

.brand-tag {
  font-size: 12px;
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--dim);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 11px;
  font-weight: 600;
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.status-dot.open { background: var(--up); }

/* ------------------------------------------------------------------ */
/* Logo: the pulse line draws itself, the arrowhead pops in, then the  */
/* whole mark beats twice — one 3.6s loop, as in the preview.          */
/* ------------------------------------------------------------------ */

@keyframes logo-draw-line {
  0% { stroke-dashoffset: 100; opacity: 1; }
  45%, 88% { stroke-dashoffset: 0; opacity: 1; }
  97% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 100; opacity: 0; }
}

@keyframes logo-pop-arrow {
  0%, 43% { opacity: 0; transform: scale(0.3); }
  53% { opacity: 1; transform: scale(1.25); }
  62%, 88% { opacity: 1; transform: scale(1); }
  97%, 100% { opacity: 0; transform: scale(1); }
}

@keyframes logo-beat {
  0%, 62% { transform: scale(1); }
  68% { transform: scale(1.14); }
  74% { transform: scale(1); }
  79% { transform: scale(1.08); }
  85%, 100% { transform: scale(1); }
}

.logo-draw-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: logo-draw-line 3.6s ease-in-out infinite;
}

.logo-pop-arrow {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-pop-arrow 3.6s ease-in-out infinite;
}

.logo-beat {
  transform-origin: center;
  animation: logo-beat 3.6s ease-in-out infinite;
}

.logo-mark { width: 46px; height: 46px; flex: none; }
.logo-mark-lg { width: 84px; height: 84px; }

/* Blinking live dot */
@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.blink-dot { animation: blink-dot 1.6s ease-in-out infinite; }

/* ------------------------------------------------------------------ */
/* Ticker tape                                                         */
/* ------------------------------------------------------------------ */

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

.tape {
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tape-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 34px;
  padding: 8px 16px;
  animation: tape-scroll 60s linear infinite;
}

.tape-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tape-item .sym { font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Search                                                              */
/* ------------------------------------------------------------------ */

.hero { padding: 34px 0 8px; }

.hero h1 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 8px;
  font-weight: 800;
}

.hero p { color: var(--dim); margin: 0 0 20px; max-width: 620px; }

.search-box { position: relative; max-width: 640px; }

.search-row { display: flex; gap: 10px; }

.search-input {
  flex: 1;
  min-height: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
  padding: 0 16px;
  text-transform: uppercase;
}

.search-input::placeholder { color: var(--dim); text-transform: none; font-family: var(--font-display); font-size: 16px; }
.search-input:focus { outline: 2px solid var(--up); outline-offset: 1px; }

.btn {
  min-height: 52px;
  border: none;
  border-radius: var(--radius);
  background: var(--up);
  color: #06130b;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 30;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.suggest button {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 10px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: 15px;
}

.suggest button:last-child { border-bottom: none; }
.suggest button:hover, .suggest button.active { background: var(--surface); }
.suggest .sym { font-family: var(--font-mono); font-weight: 600; min-width: 74px; }
.suggest .nm { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .ex { color: var(--dim); font-size: 12px; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.chip:hover { border-color: var(--up); }

/* ------------------------------------------------------------------ */
/* Sections, cards, boards                                             */
/* ------------------------------------------------------------------ */

section.block { padding: 26px 0 6px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 { font-size: 21px; margin: 0; font-weight: 700; }
.section-head .asof { color: var(--dim); font-size: 13px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font-display);
  width: 100%;
}

.quote-card:hover { border-color: var(--up); }
.quote-card .sym { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.quote-card .nm { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 8px; }
.quote-card .px { font-family: var(--font-mono); font-size: 19px; font-weight: 600; }
.quote-card .chg { font-family: var(--font-mono); font-size: 13px; margin-top: 2px; }

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.board h3 {
  margin: 0;
  padding: 12px 14px;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.board table { width: 100%; border-collapse: collapse; font-size: 14px; }

.board td, .board th {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.board tr:last-child td { border-bottom: none; }
.board td:first-child, .board th:first-child { text-align: left; }
.board tbody tr { cursor: pointer; }
.board tbody tr:hover { background: var(--bg-2); }
.board .sym { font-weight: 600; }
.board .nm { display: block; font-family: var(--font-display); font-size: 11px; color: var(--dim); white-space: normal; }

/* ------------------------------------------------------------------ */
/* Ticker detail                                                       */
/* ------------------------------------------------------------------ */

.detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 10px;
}

.detail-head { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; }
.detail-head .sym { font-family: var(--font-mono); font-size: 15px; color: var(--dim); font-weight: 600; }
.detail-head h2 { margin: 0; font-size: 26px; }
.detail-price { font-family: var(--font-mono); font-size: 34px; font-weight: 600; line-height: 1.1; }
.detail-chg { font-family: var(--font-mono); font-size: 16px; }

.range-row { display: flex; gap: 6px; margin: 16px 0 6px; flex-wrap: wrap; }

.range-btn {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--dim);
  border-radius: 8px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.range-btn.active { color: var(--text); border-color: var(--up); background: var(--surface-alt); }

.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; font-family: var(--font-mono); margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 18px;
}

.stat { background: var(--bg-2); padding: 10px 13px; }
.stat .k { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat .v { font-family: var(--font-mono); font-size: 16px; margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* News                                                                */
/* ------------------------------------------------------------------ */

.news-list { list-style: none; margin: 0; padding: 0; }

.news-list li { border-bottom: 1px solid var(--border); padding: 11px 2px; }
.news-list li:last-child { border-bottom: none; }

.news-list a { text-decoration: none; font-weight: 600; font-size: 16px; }
.news-list a:hover { text-decoration: underline; }

.news-meta { color: var(--dim); font-size: 13px; margin-top: 2px; }
.news-meta .tickers { font-family: var(--font-mono); color: var(--amber); }

/* ------------------------------------------------------------------ */
/* Signup + footer                                                     */
/* ------------------------------------------------------------------ */

.signup {
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 30px 0;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.signup .copy { flex: 1 1 320px; }
.signup h2 { margin: 0 0 6px; font-size: 22px; }
.signup p { margin: 0; color: var(--dim); }

.signup form { display: flex; gap: 10px; flex: 1 1 340px; flex-wrap: wrap; }

.signup input[type="email"] {
  flex: 1;
  min-width: 220px;
  min-height: 50px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 0 15px;
  font-family: var(--font-display);
}

.signup input[type="email"]:focus { outline: 2px solid var(--up); outline-offset: 1px; }

.signup-msg { width: 100%; font-size: 14px; min-height: 20px; }
.signup-msg.ok { color: var(--up); }
.signup-msg.err { color: var(--down); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding: 22px 0 30px;
  color: var(--dim);
  font-size: 13px;
}

.footer-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.footer-row .brand-name { font-size: 17px; color: var(--text); }

.state-msg {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--dim);
  text-align: center;
}

.state-msg.err { color: var(--down); border-color: var(--down); }

@media (prefers-reduced-motion: reduce) {
  .tape-track { animation: none; }
  .logo-draw-line { animation: none; stroke-dashoffset: 0; }
  .logo-pop-arrow { animation: none; opacity: 1; transform: none; }
  .logo-beat { animation: none; transform: none; }
  .blink-dot { animation: none; }
  .status-dot.open { animation: none; }
}

/* Phone tap targets */
button, input, select { min-height: 2rem; }
