/* StockClip design system
   Professional financial-media aesthetic: navy + signal blue on near-white,
   dense type, hairline rules, no decorative imagery. */

:root {
  --navy: #0d1b2f;
  --navy-soft: #16294a;
  --navy-line: #24395c;
  --blue: #1560d4;
  --blue-hover: #1250b4;
  --blue-soft: #eaf1fd;
  --blue-line: #b9d1f7;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-mute: #f1f3f6;
  --line: #e2e6ec;
  --line-strong: #cfd6e0;

  --text: #0f1b2d;
  --muted: #5c6a7e;
  --faint: #8b97a8;

  --up: #0f8a5f;
  --down: #cf2f45;
  --danger: #cf2f45;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 18px 44px rgba(15, 27, 45, 0.1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

/* Component display rules (flex/grid) otherwise beat the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.022em;
  line-height: 1.15;
  font-weight: 800;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 247, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-dark {
  background: var(--navy);
  color: #fff;
}

.btn-dark:hover {
  background: #16294a;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
}

.btn-blue:hover {
  background: var(--blue-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--navy);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Ticker band ---------- */

.ticker-band {
  background: var(--navy);
  border-block: 1px solid var(--navy-line);
  overflow: hidden;
  position: relative;
  /* Keep the track on its own compositor layer; empty-then-fill
     animations otherwise stall on iOS Safari / Chrome. */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 44px;
  padding: 11px 0;
  will-change: transform;
  /* Animation is attached after quotes render — see ticker.js.
     Applying it in CSS on an empty track is what freezes mobile. */
}

.ticker-track.is-scrolling {
  animation: ticker-scroll 42s linear infinite;
}

/* Pause only on devices that truly hover; sticky :hover on touch
   otherwise leaves the marquee permanently paused. */
@media (hover: hover) {
  .ticker-band:hover .ticker-track.is-scrolling {
    animation-play-state: paused;
  }
}

@keyframes ticker-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    /* Track holds two identical runs, so -50% loops seamlessly. */
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-band {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ticker-track.is-scrolling {
    animation: none;
  }

  .ticker-note {
    display: none;
  }
}

.ticker-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ticker-symbol {
  color: #ffffff;
  font-weight: 600;
}

.ticker-price {
  color: #9fb0c9;
}

.ticker-change.up {
  color: #4ade9a;
}

.ticker-change.down {
  color: #ff7a8c;
}

.ticker-note {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 14px 0 34px;
  background: linear-gradient(90deg, rgba(13, 27, 47, 0), var(--navy) 34%);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f819c;
}

/* ---------- Page headers ---------- */

.page-head {
  padding: 44px 0 26px;
}

.page-head h1 {
  font-size: clamp(30px, 4vw, 40px);
}

.page-head p {
  margin-top: 10px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card {
  margin-top: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 2px 6px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

/* ---------- Forms ---------- */

.field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 212, 0.14);
}

input::placeholder {
  color: var(--faint);
}

.section-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--up);
}

/* ---------- Ticker autocomplete ---------- */

.autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, 82vw);
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}

.suggestion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.suggestion:hover,
.suggestion.active {
  background: var(--blue-soft);
}

.suggestion-symbol {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  min-width: 58px;
  color: var(--blue);
}

.suggestion-name {
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suggestion-exchange {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.suggestions-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Article picker ---------- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.news-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.news-card:hover {
  border-color: var(--line-strong);
}

.news-card.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.news-body {
  flex: 1;
  min-width: 0;
}

.news-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
}

.news-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.news-card.selected .news-mark {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ---------- Style picker (text only) ---------- */

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.style-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.style-card:hover {
  border-color: var(--line-strong);
}

.style-card.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.style-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.style-card span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.generate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

/* ---------- Workspace layout ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 60px;
}

.rail {
  position: sticky;
  top: 80px;
}

/* ---------- Preview panel ---------- */

.preview {
  background: var(--navy);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.preview-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: #8ea3c2;
}

.stage {
  border: 1px dashed var(--navy-line);
  border-radius: var(--radius-sm);
  background: #0a1526;
  aspect-ratio: 9 / 16;
  max-height: 62vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 20px;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stage-empty {
  font-size: 13.5px;
  font-weight: 600;
  color: #b7c6dc;
}

.stage-empty span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #6f819c;
}

.preview-meta {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #b7c6dc;
}

.preview-meta strong {
  color: #fff;
}

.preview-actions {
  margin-top: 14px;
}

.preview-actions .btn-ghost {
  background: transparent;
  border-color: var(--navy-line);
  color: #fff;
}

.preview-actions .btn-ghost:hover {
  border-color: #3d5580;
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Progress ---------- */

.progress {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--navy-line);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.progress-percent {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: #8ea3c2;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: #1d3153;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.4s ease;
}

.progress-fill.is-error {
  background: var(--down);
}

.progress-steps {
  display: flex;
  gap: 16px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6f819c;
}

.progress-step::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b4269;
}

.progress-step.active {
  color: #fff;
}

.progress-step.active::before,
.progress-step.complete::before {
  background: var(--blue);
}

/* ---------- Landing ---------- */

.hero {
  padding: 76px 0 64px;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 20px auto 0;
  max-width: 17ch;
  font-size: clamp(34px, 5.2vw, 54px);
}

.hero p {
  margin: 16px auto 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.band {
  background: var(--surface-mute);
  border-block: 1px solid var(--line);
  padding: 56px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.step-kicker i {
  width: 22px;
  height: 1px;
  background: var(--blue-line);
}

.step h3 {
  font-size: 17px;
}

.step p {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.section {
  padding: 64px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 34px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.section-head p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.plan.featured {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan.featured .plan-name {
  color: #8ea3c2;
}

.plan-price {
  margin-top: 12px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-price span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.plan.featured .plan-price span {
  color: #8ea3c2;
}

.plan-for {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.plan.featured .plan-for {
  color: #b7c6dc;
}

.plan ul {
  list-style: none;
  margin: 20px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan li {
  display: flex;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text);
}

.plan.featured li {
  color: #dbe5f2;
}

.plan li::before {
  content: "✓";
  color: var(--blue);
  font-weight: 800;
  flex-shrink: 0;
}

.plan.featured li::before {
  color: #6ea4f5;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer-copy {
  margin-top: 2px;
  font-size: 12px;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 13px;
}

.footer-links a {
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }

  .steps,
  .pricing {
    grid-template-columns: 1fr;
  }

  .stage {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 32px);
  }

  .field-row,
  .style-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 16px;
  }

  .generate-row {
    flex-direction: column;
    align-items: stretch;
  }
}
