:root {
  --bg: #090d12;
  --bg-soft: #111823;
  --panel: rgba(13, 19, 28, 0.84);
  --panel-strong: rgba(10, 15, 22, 0.94);
  --line: rgba(184, 196, 216, 0.18);
  --line-strong: rgba(214, 224, 240, 0.28);
  --text: #edf2fb;
  --muted: #97a5bb;
  --gold: #d4a96d;
  --gold-soft: rgba(212, 169, 109, 0.18);
  --cyan: #79d6df;
  --cyan-soft: rgba(121, 214, 223, 0.18);
  --rose: #f2a0a8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sora", sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(121, 214, 223, 0.15), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(212, 169, 109, 0.18), transparent 24%),
    linear-gradient(160deg, #070b10 0%, #0d1420 45%, #06090e 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
}

.ambient-one {
  width: 260px;
  height: 260px;
  background: #0f6f7b;
  top: 6%;
  left: -80px;
}

.ambient-two {
  width: 280px;
  height: 280px;
  background: #8d5a22;
  right: -100px;
  bottom: 10%;
}

.page-shell {
  width: min(1360px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.reveal {
  animation: rise-in 0.7s ease both;
}

.hero {
  padding: 24px 28px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.hero-copy,
.workspace-grid > *,
.results-grid > *,
.summary-card {
  min-width: 0;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
}

.hero h1,
.section-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.3rem);
  line-height: 1.02;
  max-width: none;
  white-space: nowrap;
}

.hero-text,
.section-note,
.table-info,
.status-message,
.notes-list,
.scenario-facts,
.empty-state {
  color: var(--muted);
}

.hero-text {
  margin: 10px 0 0;
  max-width: 46ch;
  font-size: 0.86rem;
  line-height: 1.65;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-tags span,
.chart-legend span {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.76rem;
}

.workspace-grid,
.results-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.results-grid {
  grid-template-columns: 1fr;
}

.form-panel,
.note-panel,
.chart-panel,
.table-panel {
  padding: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 1.85vw, 2rem);
  line-height: 1.08;
}

.section-note,
.table-info,
.status-message {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.investment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 0.82rem;
  color: #d7dfeb;
}

.field input,
.field select,
.primary-button,
.secondary-button {
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
}

.field input,
.field select {
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(121, 214, 223, 0.6);
  box-shadow: 0 0 0 4px rgba(121, 214, 223, 0.12);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-button {
  grid-column: 1 / -1;
  padding: 14px 18px;
  color: #0a1017;
  font-weight: 700;
  background: linear-gradient(135deg, #e4bf8c 0%, #79d6df 100%);
  box-shadow: 0 18px 42px rgba(121, 214, 223, 0.18);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.secondary-button {
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.status-row {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-message.error {
  color: #ffb4bc;
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
  font-size: 0.84rem;
  line-height: 1.6;
}

.scenario-card {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(212, 169, 109, 0.08), rgba(121, 214, 223, 0.06)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scenario-title {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: #d7dfeb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scenario-facts {
  display: grid;
  gap: 12px;
}

.fact-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  font-size: 0.84rem;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fact-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fact-item strong {
  color: var(--text);
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.summary-panel {
  padding: 26px 28px 30px;
}

.summary-panel .section-head {
  margin-bottom: 20px;
}

.summary-panel .summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.summary-card {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 150px;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -35px -35px auto;
  width: 90px;
  height: 90px;
  background: var(--accent-glow, rgba(121, 214, 223, 0.14));
  border-radius: 50%;
  filter: blur(12px);
}

.summary-card .label {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-card .value {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.38rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.summary-card .caption {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #c8d4e4;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.chart-wrapper {
  position: relative;
  min-height: 410px;
}

.projection-chart {
  width: 100%;
  min-height: 410px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.95rem;
  padding: 20px;
}

.empty-state.hidden {
  display: none;
}

.table-shell {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--panel-strong);
  font-size: 0.77rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(12, 17, 24, 0.98);
  color: #dde7f5;
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: normal;
  vertical-align: top;
}

td {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

td strong {
  color: var(--text);
}

.empty-table {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
}

.axis-label,
.grid-label {
  font-family: "Sora", sans-serif;
  fill: rgba(232, 239, 249, 0.74);
  font-size: 10px;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-dasharray: 4 8;
}

.axis-line {
  stroke: rgba(255, 255, 255, 0.12);
}

.series-principal,
.series-total {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.series-principal {
  stroke: var(--gold);
}

.series-total {
  stroke: var(--cyan);
}

.series-area {
  fill: url(#growthGradient);
}

.point-dot {
  stroke-width: 4;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .hero,
  .workspace-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    white-space: normal;
  }

  .hero-tags,
  .chart-legend {
    justify-content: flex-start;
  }

  .summary-panel .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .table-shell {
    border: 0;
    background: transparent;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 14px;
  }

  tbody tr {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: var(--panel-strong);
  }

  td {
    display: grid;
    grid-template-columns: minmax(120px, 150px) 1fr;
    gap: 12px;
    padding: 10px 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .empty-table {
    display: block;
    padding: 22px 14px;
    text-align: center;
  }

  .empty-table::before {
    content: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 16px, 1360px);
    padding-top: 16px;
  }

  .hero,
  .form-panel,
  .note-panel,
  .summary-panel,
  .chart-panel,
  .table-panel {
    padding: 20px;
  }

  .investment-form,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .hero h1 {
    max-width: none;
  }

  .chart-wrapper,
  .projection-chart {
    min-height: 320px;
  }

  td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  td::before {
    margin-bottom: 2px;
  }
}