*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f6f0e8;
  --bg-alt: #efe2d4;
  --surface: #fff8f0;
  --ink: #1b1a17;
  --muted: #6d675f;
  --accent: #1f6f78;
  --accent-2: #e16b3a;
  --accent-3: #3d6e4e;
  --stroke: rgba(27, 26, 23, 0.12);
  --shadow: 0 20px 45px rgba(27, 26, 23, 0.15);
  --radius: 18px;
  --gradient-1: rgba(31, 111, 120, 0.18);
  --gradient-2: rgba(225, 107, 58, 0.22);
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-alt: #252525;
  --surface: #2a2a2a;
  --ink: #e8e6e3;
  --muted: #9a9590;
  --accent: #3ecf8e;
  --accent-2: #f5a623;
  --accent-3: #5cb85c;
  --stroke: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  --gradient-1: rgba(62, 207, 142, 0.15);
  --gradient-2: rgba(245, 166, 35, 0.15);
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(
      circle at top left,
      var(--gradient-1),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 20%,
      var(--gradient-2),
      transparent 50%
    ),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

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

img {
  max-width: 100%;
  display: block;
}

ul {
  margin: 0.6rem 0 0 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.25;
  z-index: -2;
}

.orb-1 {
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, #1f6f78 0%, transparent 65%);
}

.orb-2 {
  bottom: -140px;
  right: -120px;
  background: radial-gradient(circle, #e16b3a 0%, transparent 65%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(
      rgba(27, 26, 23, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(27, 26, 23, 0.04) 1px,
      transparent 1px
    );
  background-size: 120px 120px;
  opacity: 0.4;
  z-index: -3;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.4rem;
  border-bottom: 1px solid var(--stroke);
  background: var(--header-bg, rgba(246, 240, 232, 0.86));
  backdrop-filter: blur(10px);
  transition: background 0.3s;
}

[data-theme="dark"] .site-header {
  --header-bg: rgba(26, 26, 26, 0.9);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-alt);
}

.theme-toggle-icon {
  font-size: 1rem;
}

.logo {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  position: relative;
  padding-bottom: 0.3rem;
  font-weight: 500;
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.nav-count.hidden {
  display: none;
}

.site-nav a.active {
  color: var(--ink);
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2.4rem 5rem;
}

.section {
  margin-bottom: 3.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0 1rem;
  animation: rise 0.8s ease both;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.7rem, 5vw, 4.2rem);
  margin-bottom: 1rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.hero-panel h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 1rem;
}

.stat-grid {
  display: grid;
  gap: 0.8rem;
}

.similar-meta {
  margin-top: 0.8rem;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  color: var(--accent-3);
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 25px rgba(31, 111, 120, 0.35);
}

.button.ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

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

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button.favorite-action {
  border-color: var(--stroke);
  background: var(--surface);
  color: var(--ink);
}

.favorite-action.active {
  background: rgba(225, 107, 58, 0.18);
  border-color: rgba(225, 107, 58, 0.45);
  color: #b24a22;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  margin-top: 1.8rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
}

.card h3 {
  font-family: "Fraunces", serif;
  margin-top: 0.2rem;
}

.card p {
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.6;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.8rem;
}

.list {
  display: grid;
  gap: 1rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.tag {
  background: rgba(31, 111, 120, 0.12);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  background: rgba(225, 107, 58, 0.16);
  color: #b24a22;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: "Fraunces", serif;
  margin: 0;
}

.section-header p {
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.score-note {
  max-width: 320px;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.compare-controls {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.2rem;
}

.strategy-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.strategy-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.strategy-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  background: var(--bg-alt);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.strategy-checkbox.selected {
  border-color: var(--accent);
  background: rgba(31, 111, 120, 0.12);
}

.strategy-checkbox input {
  margin: 0;
}

.strategy-checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.compare-empty {
  margin-top: 1.5rem;
  background: var(--bg-alt);
  border: 1px dashed var(--stroke);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

.filter-group label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  display: block;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 0.9rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.table-card {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
  font-size: 0.9rem;
}

th {
  background: rgba(31, 111, 120, 0.06);
  font-weight: 600;
}

th button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}

tr:hover {
  background: rgba(31, 111, 120, 0.06);
}

.table-scroll {
  overflow-x: auto;
}

.correlation-card {
  overflow: hidden;
}

.correlation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 520px;
}

.correlation-table th,
.correlation-table td {
  padding: 0.4rem 0.5rem;
  text-align: center;
  border: 1px solid var(--stroke);
}

.correlation-table th {
  background: var(--bg-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.correlation-table .row-header {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-alt);
  text-align: left;
}

.correlation-table tr:hover {
  background: transparent;
}

.correlation-cell {
  font-weight: 600;
}

.link {
  color: var(--accent);
  font-weight: 600;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: 1.5rem;
}

.strategy-grid.list {
  grid-template-columns: 1fr;
}

.strategy-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
}

.favorite-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.favorite-toggle:hover {
  background: var(--bg-alt);
}

.favorite-toggle.active {
  background: rgba(225, 107, 58, 0.18);
  border-color: rgba(225, 107, 58, 0.45);
  color: #b24a22;
}

.favorite-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.favorite-inline.active {
  background: rgba(225, 107, 58, 0.18);
  border-color: rgba(225, 107, 58, 0.45);
  color: #b24a22;
}

.favorite-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.strategy-card h3 {
  margin: 0.6rem 0 0.4rem;
  font-family: "Fraunces", serif;
}

.strategy-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.portfolio-weights {
  display: grid;
  gap: 0.8rem;
}

.portfolio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--stroke);
}

.portfolio-row:last-child {
  border-bottom: none;
}

.portfolio-input {
  width: 90px;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  text-align: right;
  font-size: 0.85rem;
}

.portfolio-total {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-weight: 600;
}

.portfolio-metrics-card h3 {
  margin-top: 0;
}

.portfolio-risk-body {
  height: 220px;
}

.risk-table-wrap {
  margin-top: 1rem;
}

.risk-table {
  font-size: 0.85rem;
}

.risk-table th:not(:first-child),
.risk-table td:not(:first-child) {
  text-align: right;
}

.risk-table .risk-label {
  font-weight: 600;
}

.risk-table td.positive {
  color: var(--accent);
  font-weight: 600;
}

.risk-table td.negative {
  color: #b24a22;
  font-weight: 600;
}

.category-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.category-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.category-card {
  padding: 1.6rem;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.category-list {
  display: grid;
  gap: 0.8rem;
}

.category-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px dashed var(--stroke);
}

.category-row:last-child {
  border-bottom: none;
}

.category-rank {
  width: 1.5rem;
  text-align: center;
  font-weight: 700;
  color: var(--accent);
}

.category-name .tag-row {
  margin-top: 0.4rem;
}

.category-score {
  text-align: right;
  min-width: 90px;
}

.strategy-header {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
}

.info-card {
  background: rgba(31, 111, 120, 0.08);
  border-radius: 14px;
  padding: 0.8rem 1rem;
}

.info-card span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.control-bar {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  display: grid;
  gap: 1rem;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.control-group {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.compare-panel {
  background: rgba(61, 110, 78, 0.08);
  border-radius: 14px;
  padding: 0.8rem 1rem;
}

.compare-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.compare-options label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.home-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.home-chart-grid .chart-card {
  min-height: 320px;
}

.home-chart-grid .chart-body {
  height: 220px;
}

@media (max-width: 900px) {
  .home-chart-grid {
    grid-template-columns: 1fr;
  }
}

/* Heatmap Styles */
.heatmap-card {
  overflow: hidden;
}

.heatmap-body {
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 500px;
}

.heatmap-table th,
.heatmap-table td {
  padding: 0.35rem 0.25rem;
  text-align: center;
  border: 1px solid var(--stroke);
}

.heatmap-table th {
  background: var(--bg-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.heatmap-table .year-cell {
  font-weight: 600;
  background: var(--bg-alt);
  position: sticky;
  left: 0;
  z-index: 1;
}

.heatmap-cell {
  font-weight: 500;
  min-width: 45px;
  transition: transform 0.15s;
}

.sensitivity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 420px;
}

.sensitivity-table th,
.sensitivity-table td {
  padding: 0.35rem 0.4rem;
  text-align: center;
  border: 1px solid var(--stroke);
}

.sensitivity-table th {
  background: var(--bg-alt);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.param-label {
  font-weight: 600;
  background: var(--bg-alt);
  position: sticky;
  left: 0;
  z-index: 1;
}

.sensitivity-cell {
  font-weight: 600;
  min-width: 48px;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 2;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.heatmap-cell.empty {
  color: var(--muted);
  background: transparent;
}

.heatmap-cell.annual {
  font-weight: 700;
  border-left: 2px solid var(--ink);
}

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

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.compare-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.compare-table td.best {
  color: var(--accent);
  font-weight: 600;
}

.compare-table td.worst {
  color: #b24a22;
  font-weight: 600;
}

.chart-body {
  position: relative;
  height: 280px;
}

.chart-body canvas {
  width: 100%;
  height: 100%;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tab-button {
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tab-content {
  display: none;
  margin-top: 1rem;
}

.tab-content.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.attribution-metrics {
  margin-top: 0.8rem;
}

.metric-tile {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 0.8rem;
  border: 1px solid var(--stroke);
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.metric-tile strong {
  font-size: 1.1rem;
}

.pseudocode details {
  background: #121212;
  color: #f7f4ef;
  border-radius: var(--radius);
  padding: 1rem;
}

.pseudocode summary {
  cursor: pointer;
  font-weight: 600;
}

.pseudocode pre {
  white-space: pre-wrap;
  font-family: "Space Grotesk", monospace;
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

.copy-button {
  margin-top: 0.8rem;
  background: var(--accent-2);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.note {
  background: rgba(31, 111, 120, 0.08);
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 2rem 2.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.footer-brand {
  font-family: "Fraunces", serif;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.85rem;
}

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

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

.content-page {
  max-width: 1040px;
  margin: 0 auto;
}

.content-hero {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.content-hero h2 {
  font-family: "Fraunces", serif;
  margin: 0.2rem 0 0.4rem;
}

.content-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.content-body {
  display: grid;
  gap: 2.2rem;
}

.content-article {
  display: grid;
  gap: 1.6rem;
}

.content-article p {
  line-height: 1.8;
  color: var(--muted);
  margin: 0.6rem 0;
}

.content-section h3 {
  margin-bottom: 0.4rem;
}

.content-disclaimer {
  border-top: 1px solid var(--stroke);
  padding-top: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.content-footer {
  margin-top: 1.5rem;
}

.article-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.article-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.article-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.article-figure {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1rem;
}

.article-figure svg {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(31, 111, 120, 0.25);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero,
  .split,
  .strategy-header {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 1rem 1.5rem;
  }

  .app {
    padding: 2rem 1.5rem 4rem;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 70px;
    right: 1.5rem;
    left: 1.5rem;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--stroke);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .category-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .category-score {
    text-align: left;
  }

  .favorite-inline {
    justify-self: start;
  }

  .portfolio-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .portfolio-input {
    width: 100%;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
