:root {
  --ink: #f8fbff;
  --muted: #a9b8c7;
  --deep: #03080d;
  --panel: rgba(8, 20, 31, 0.84);
  --panel-strong: rgba(7, 18, 28, 0.96);
  --line: rgba(255, 255, 255, 0.13);
  --gold: #f6c85f;
  --green: #20d09a;
  --cyan: #49c7ff;
  --red: #ff5f6d;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(73, 199, 255, 0.22), transparent 24rem),
    radial-gradient(circle at 12% 8%, rgba(32, 208, 154, 0.17), transparent 20rem),
    linear-gradient(140deg, #02060a 0%, #07121d 48%, #050b11 100%);
  font-family: Inter, Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-shell {
  overflow: hidden;
}

.hero-section {
  position: relative;
  min-height: 100svh;
  padding: 12px 14px 28px;
  display: grid;
  align-items: center;
  isolation: isolate;
}

.market-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 8, 13, 0.04), #03080d 96%),
    repeating-linear-gradient(110deg, transparent 0 92px, rgba(32, 208, 154, 0.05) 92px 94px);
}

.market-grid::before {
  content: "";
  position: absolute;
  inset: 9% -14% auto;
  height: 42%;
  background: linear-gradient(110deg, transparent 8%, rgba(32, 208, 154, 0.2) 38%, rgba(246, 200, 95, 0.14) 50%, transparent 72%);
  filter: blur(18px);
  transform: skewY(-8deg);
}

.live-alert {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto 12px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(246, 200, 95, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff4cf;
  background: rgba(6, 15, 22, 0.82);
  box-shadow: 0 12px 34px rgba(246, 200, 95, 0.13);
}

.live-alert span:last-child {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 900;
  animation: alertMove 2.4s ease-in-out infinite alternate;
}

.live-dot,
.pulse-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(32, 208, 154, 0.58);
  animation: pulse 1.6s infinite;
}

@keyframes alertMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(18px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(32, 208, 154, 0.58);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(32, 208, 154, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(32, 208, 154, 0);
  }
}

.hero-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 520px);
  gap: 26px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.market-pill,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 12px;
  max-width: 700px;
  font-size: clamp(3.1rem, 7.2vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0;
  font-weight: 900;
}

.hero-lead {
  max-width: 650px;
  margin-bottom: 16px;
  color: #d6e3ef;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.55;
}

.proof-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 12px;
}

.proof-row article {
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(160deg, rgba(32, 208, 154, 0.14), transparent 54%),
    rgba(255, 255, 255, 0.055);
}

.proof-row strong {
  display: block;
  color: var(--green);
  font-size: clamp(1.8rem, 4.4vw, 2.55rem);
  line-height: 1;
  font-weight: 900;
}

.proof-row span {
  display: block;
  margin-top: 8px;
  color: #c8d5e1;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 800;
}

.case-flash {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  background: rgba(246, 200, 95, 0.11);
}

.case-flash span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.case-flash strong {
  color: #fff4d3;
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-cta,
.secondary-cta,
.consult-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-cta,
.consult-card button {
  color: #04090d;
  background: linear-gradient(135deg, var(--gold), #fff3aa 50%, var(--green));
  box-shadow: 0 18px 44px rgba(32, 208, 154, 0.2);
}

.secondary-cta {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e6eff8;
  background: rgba(255, 255, 255, 0.055);
}

.analysis-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 35%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.analysis-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--gold), var(--red));
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-top: 8px;
}

.panel-header h2 {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
}

.confidence-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #08141e 0 54%, transparent 56%),
    conic-gradient(var(--green) calc(var(--score, 88) * 1%), rgba(255, 255, 255, 0.12) 0);
}

.confidence-ring span {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 900;
}

.confidence-ring small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

#heroChart {
  width: 100%;
  height: 300px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #03090f;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.signal-grid article,
.case-grid article,
.pain-grid article,
.model-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.signal-grid article {
  padding: 12px;
}

.signal-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.signal-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 0.92rem;
}

section:not(.hero-section) {
  padding: 64px 16px;
}

.section-heading {
  width: min(950px, 100%);
  margin: 0 auto 24px;
}

.section-heading.compact h2,
.model-copy h2,
.consult-copy h2 {
  margin: 8px 0 0;
  font-size: clamp(1.85rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.case-grid,
.pain-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.case-grid article,
.pain-grid article {
  min-height: 190px;
  padding: 20px;
}

.case-grid article {
  background:
    linear-gradient(160deg, rgba(73, 199, 255, 0.12), transparent 54%),
    rgba(255, 255, 255, 0.055);
}

.case-grid span,
.card-index {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
}

.case-grid h3,
.pain-grid h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.case-grid p,
.pain-grid p,
.model-copy p,
.consult-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.proof-section,
.consult-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.model-section {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(310px, 0.95fr) minmax(0, 1.05fr);
  gap: 34px;
  align-items: center;
}

.model-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

#factorCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #061019;
}

.model-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.model-list div {
  display: grid;
  gap: 6px;
  padding: 15px;
}

.model-list strong {
  color: var(--gold);
}

.model-list span {
  color: #d2dde8;
  line-height: 1.5;
}

.consult-section {
  width: min(1120px, 100%);
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 28px;
  align-items: center;
}

.consult-copy p {
  max-width: 640px;
}

.consult-card {
  display: grid;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.consult-card label {
  color: #d2deeb;
  font-size: 0.84rem;
  font-weight: 900;
}

.consult-card input,
.consult-card select {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  outline: none;
  background: rgba(255, 255, 255, 0.07);
}

#tickerInput {
  text-transform: uppercase;
  font-weight: 900;
}

.consult-card input:focus,
.consult-card select:focus {
  border-color: rgba(73, 199, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(73, 199, 255, 0.12);
}

.consult-card select option {
  color: #071018;
}

.consult-card button {
  width: 100%;
  margin-top: 4px;
}

.consult-card small {
  color: var(--muted);
  line-height: 1.45;
}

.lead-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  max-width: 330px;
  border: 1px solid rgba(32, 208, 154, 0.4);
  border-radius: 8px;
  padding: 13px 15px;
  color: #e9fff7;
  background: rgba(4, 13, 20, 0.96);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
}

.lead-toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .hero-section {
    min-height: auto;
    align-items: start;
  }

  .hero-inner,
  .model-section,
  .consult-section {
    grid-template-columns: 1fr;
  }

  .case-grid,
  .pain-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-section {
    min-height: 100svh;
    padding: 10px 12px 22px;
  }

  .live-alert {
    margin-bottom: 10px;
    min-height: 34px;
    padding: 7px 10px;
  }

  .live-alert span:last-child {
    font-size: 0.74rem;
  }

  .hero-inner {
    gap: 14px;
  }

  h1 {
    margin-top: 10px;
    font-size: clamp(2.55rem, 13.5vw, 3.55rem);
    line-height: 0.94;
  }

  .hero-lead {
    margin-bottom: 10px;
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .proof-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0 8px;
  }

  .proof-row article {
    min-height: 82px;
    padding: 10px 8px;
  }

  .proof-row strong {
    font-size: 1.28rem;
  }

  .proof-row span {
    margin-top: 6px;
    font-size: 0.62rem;
  }

  .case-flash {
    padding: 10px 12px;
  }

  .case-flash strong {
    font-size: 0.88rem;
  }

  .hero-actions {
    margin-top: 12px;
  }

  .primary-cta,
  .secondary-cta {
    flex: 1 1 136px;
    min-height: 46px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .analysis-panel {
    padding: 14px;
  }

  .panel-header h2 {
    font-size: 2.25rem;
  }

  .confidence-ring {
    width: 72px;
    height: 72px;
  }

  .confidence-ring span {
    font-size: 1.25rem;
  }

  #heroChart {
    height: 210px;
    margin-top: 12px;
  }

  .signal-grid {
    gap: 6px;
  }

  .signal-grid article {
    padding: 9px 7px;
  }

  .signal-grid span {
    font-size: 0.62rem;
  }

  .signal-grid strong {
    font-size: 0.78rem;
  }

  section:not(.hero-section) {
    padding: 48px 14px;
  }

  .section-heading.compact h2,
  .model-copy h2,
  .consult-copy h2 {
    font-size: 1.85rem;
  }

  .case-grid article,
  .pain-grid article {
    min-height: auto;
    padding: 18px;
  }

  .model-visual {
    order: -1;
  }

  .consult-card {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.35rem;
  }

  .hero-lead {
    font-size: 0.9rem;
  }

  #heroChart {
    height: 190px;
  }

  .proof-row span {
    font-size: 0.58rem;
  }
}
