:root {
  color-scheme: dark;
  --page:      #0d1017;
  --surface:   #131722;
  --surface-2: #1a1f2e;
  --ink:       #ffffff;
  --ink-2:     #b9bdc9;
  --muted:     #787b86;
  --grid:      #1e222d;
  --axis:      #2c3140;
  --border:    rgba(255,255,255,0.10);

  --series-price: #3987e5;
  --series-ma:    #d95926;

  --buy:     #23b57f;
  --neutral: #d9a326;
  --sell:    #e05252;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  padding: 0 0 80px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ---------- the answer ---------- */

.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 68px 24px 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

.question {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 8px;
}

.answer {
  font-size: clamp(104px, 21vw, 210px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.88;
  margin: 0;
}
.answer.buy     { color: var(--buy); }
.answer.neutral { color: var(--neutral); }
.answer.sell    { color: var(--sell); }

.intro {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--ink-2);
  max-width: 560px;
  margin: 26px auto 0;
  line-height: 1.55;
}
.intro b { color: var(--ink); font-weight: 600; }

.layers {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 0;
  flex-wrap: wrap;
}
.layers button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 15px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.layers button:hover { color: var(--ink-2); border-color: rgba(255,255,255,0.22); }
.layers button[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.07);
}

.jump {
  display: flex;
  gap: 22px;
  justify-content: center;
  margin: 30px 0 0;
  flex-wrap: wrap;
}
.jump a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  padding-bottom: 2px;
}
.jump a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- the chart, edge to edge ---------- */

/* Pulled up under the hero so the answer sits over the empty top-left of the
   plot. The chart reserves that space in its own top margin. */
/* Pulled up less than the chart's own top margin, so the intro clears the plot
   with room to breathe rather than sitting on it. */
.bleed {
  position: relative;
  width: 100%;
  margin-top: -48px;
  z-index: 1;
}

.bleed svg { display: block; width: 100%; touch-action: pan-y; }

/* Sit over the chart's empty top corners rather than taking their own row. */
/* Offset past the negative pull on .bleed, so they land in the chart's empty
   top band rather than on the intro sitting above it. */
.chart-controls {
  position: absolute;
  top: 76px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 3;
}
.chart-controls.left { left: 18px; }
.chart-controls.right { right: 18px; justify-content: flex-end; }

.chart-controls.right button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(19,23,34,0.72);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color .15s, border-color .15s, background .15s;
}
.chart-controls.right button:hover { color: var(--ink-2); border-color: rgba(255,255,255,0.22); }
.chart-controls.right button[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.10);
}

.bleed-key {
  max-width: 820px;
  margin: 2px auto 0;
  padding: 0 24px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}
.bleed-key i { font-style: normal; color: var(--ink-2); }
.bleed-key .sw {
  display: inline-block; width: 14px; height: 3px; border-radius: 2px;
  vertical-align: middle; margin: 0 6px 2px 0;
}
.bleed-key .sw.dash {
  background: none !important;
  height: 0;
  border-top: 3px dashed var(--ink-2);
  border-radius: 0;
}
.bleed-key .chip {
  display: inline-block; width: 11px; height: 11px; border-radius: 3px;
  vertical-align: -1px; margin: 0 6px 0 0; background: rgba(35,181,127,0.34);
}
.bleed-key span + span { margin-left: 20px; }

.tip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  background: rgba(19,23,34,0.97);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  width: max-content;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  transition: opacity .12s;
  z-index: 5;
}
.tip .date { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.tip .row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tip .row i { font-style: normal; color: var(--ink-2); }
.tip .row b { font-weight: 600; min-width: 72px; display: inline-block; }
.tip .swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.tip .foot { color: var(--muted); font-size: 11.5px; margin-top: 6px; }

/* ---------- sections ---------- */

section { margin-top: 80px; scroll-margin-top: 24px; }

h2 {
  font-size: clamp(24px, 3.4vw, 33px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.18;
  margin: 0 0 8px;
}

.sub {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 26px;
  max-width: 620px;
  line-height: 1.6;
}

.fine {
  color: var(--muted);
  font-size: 13.5px;
  margin: 14px 0 0;
  max-width: 620px;
}

/* ---------- calculator ---------- */

.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

.calc-input { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 22px; }

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

.field input {
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  width: 180px;
}
.field input:focus-visible { outline: 2px solid var(--series-price); outline-offset: 1px; }

.group {
  display: inline-flex;
  background: rgba(19,23,34,0.72);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  backdrop-filter: blur(6px);
}
.group button {
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); background: transparent;
  border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer;
}
.calc .group { background: var(--surface-2); backdrop-filter: none; }
.calc .group button { font-size: 14px; padding: 8px 14px; color: var(--ink-2); }
.group button:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.group button[aria-pressed="true"] { background: rgba(255,255,255,0.13); color: var(--ink); }

.calc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.calc-table th {
  text-align: right;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border);
}
.calc-table th:first-child { text-align: left; }
.calc-table td {
  padding: 12px 10px; text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-variant-numeric: tabular-nums;
}
.calc-table td:first-child { text-align: left; color: var(--ink-2); }
.calc-table td.base { font-weight: 700; }
.calc-table td.bear { color: var(--muted); }
.calc-table td.bull { color: var(--ink-2); }
.calc-table tr:last-child td { border-bottom: 0; }

/* ---------- seasons ---------- */

.seasons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.season {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px 20px;
  overflow: hidden;
}

.season::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 82px;
  background: radial-gradient(120% 90% at 50% 0%, var(--tint) 0%, transparent 72%);
  opacity: 0.55;
  pointer-events: none;
}

.season.is-now { border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone); }
.season.is-now::before { opacity: 1; }

.season .art { position: relative; height: 58px; margin-bottom: 10px; }
.season .art svg { width: 100%; height: 100%; overflow: visible; }

.season .nm { position: relative; font-size: 17px; font-weight: 700; color: var(--tone); }
.season .ds { position: relative; font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }

.season .badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--page); background: var(--tone);
  border-radius: 20px; padding: 3px 8px;
}

/* ---------- footer ---------- */

.foot-note {
  margin-top: 80px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 860px) {
  .seasons { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .hero { padding-top: 44px; }

  /* No overlap at this width: the answer has no room to share with the plot,
     and two absolutely-positioned clusters would collide, so the controls drop
     into normal flow above the chart. */
  .bleed { margin-top: 18px; display: flex; flex-direction: column; }
  .chart-controls {
    position: static;
    justify-content: center;
    margin: 0 auto 10px;
    padding: 0 16px;
  }
  .chart-controls.left { order: -2; }
  .chart-controls.right { order: -1; margin-bottom: 16px; }
  .chart-controls.right button { padding: 5px 11px; font-size: 12.5px; }
  .group button { padding: 5px 10px; }
  .field input { width: 100%; }
  .calc-input { display: block; }
  .calc-input .field + .field { margin-top: 14px; }
  .calc-table { font-size: 13.5px; }
  .calc-table th, .calc-table td { padding-left: 5px; padding-right: 5px; }
  .bleed-key span { display: block; margin: 4px 0 0 !important; }
}

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