:root {
  color-scheme: light;
  --ink: #1d2528;
  --muted: #697478;
  --line: #dce3e1;
  --surface: #f6f8f7;
  --panel: #ffffff;
  --accent: #177d72;
  --danger: #b7473e;
  --warning: #8a6a13;
  --violet: #5a5f9f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  padding: 28px 22px;
  background: #102022;
  color: #f7fbfa;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 720;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #d8efe9;
  color: #102022;
  font-size: 13px;
  font-weight: 800;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  color: #b8c9c6;
  text-decoration: none;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

nav a:hover,
nav a.active {
  color: #ffffff;
  border-color: #45b8a7;
  background: rgba(255, 255, 255, 0.06);
}

.rail-note {
  margin-top: auto;
  color: #9db0ad;
  font-size: 12px;
  line-height: 1.5;
}

main {
  margin-left: 272px;
}

.workspace {
  min-height: 100vh;
  padding: 42px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.compact {
  min-height: auto;
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}

.topbar,
.section-head,
.two-col {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  max-width: 820px;
  font-weight: 760;
  line-height: 1.02;
}

h1 {
  font-size: 58px;
}

h2 {
  font-size: 34px;
}

.body-copy {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
}

.ghost-button,
.primary-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 0 18px;
  font-weight: 720;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.primary-button {
  justify-self: end;
  background: var(--ink);
  color: #ffffff;
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
}

.metric {
  min-height: 146px;
  padding: 22px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.metric:last-child {
  border-right: 0;
}

.metric span,
.journal-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  font-size: 38px;
}

.metric small {
  color: var(--muted);
}

.metric.danger strong {
  color: var(--danger);
}

.metric.warning strong {
  color: var(--warning);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
}

.assumption {
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 7px 10px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--panel);
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--ink);
  color: #ffffff;
}

.chart {
  width: 100%;
  min-height: 260px;
}

.grid-line {
  stroke: #e5ebe9;
  stroke-width: 1;
}

.area {
  fill: url(#equityFill);
}

.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
}

.trade-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
}

.trade-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.trade-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.risk {
  font-weight: 800;
}

.risk.high {
  color: var(--danger);
}

.risk.medium {
  color: var(--warning);
}

.risk.low {
  color: var(--accent);
}

.calculator {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfc;
  padding: 13px 12px;
  color: var(--ink);
  font: inherit;
}

input[type="range"] {
  accent-color: var(--accent);
}

.result {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.journal-grid article {
  background: var(--panel);
  padding: 24px;
  border: 1px solid transparent;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.journal-grid article:hover,
.journal-grid article.active {
  transform: translateY(-2px);
  border-color: rgba(23, 125, 114, 0.4);
  background: #f9fcfb;
}

.journal-grid p {
  line-height: 1.65;
}

.replay {
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  display: grid;
  align-items: center;
}

.timeline {
  height: 300px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 14px;
  padding: 24px;
  background: #10191b;
}

.timeline span {
  display: block;
  background: #43b9a8;
  animation: rise 900ms ease both;
  transition:
    height 220ms ease,
    background 220ms ease;
}

.timeline span:nth-child(even) {
  background: #c7a23b;
}

.timeline span:nth-child(5) {
  background: #c95f54;
}

.final {
  background: #e7eeeb;
}

@keyframes rise {
  from {
    transform: scaleY(0.2);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .rail {
    position: static;
    width: auto;
  }

  main {
    margin-left: 0;
  }

  .workspace {
    padding: 28px;
  }

  h1 {
    font-size: 40px;
  }

  .metrics,
  .split,
  .two-col,
  .journal-grid,
  .replay {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    flex-direction: column;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .primary-button {
    justify-self: start;
  }
}
