:root {
  --bg: #f7f2e8;
  --panel: rgba(255, 250, 241, 0.9);
  --panel-strong: #fffaf0;
  --text: #1f1a17;
  --muted: #63584f;
  --line: rgba(61, 45, 31, 0.14);
  --accent: #b04a2f;
  --accent-soft: #f4d7c3;
  --accent-deep: #61291a;
  --good: #2d6a4f;
  --warn: #9d5c0d;
  --shadow: 0 24px 80px rgba(58, 35, 19, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(240, 207, 172, 0.8), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(213, 157, 118, 0.5), transparent 24%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 246, 232, 0.92), rgba(255, 252, 246, 0.98));
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 52rem;
  margin-top: 18px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
}

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

.hero a,
.metric-sub a,
.fund-link-card {
  color: var(--accent-deep);
}

.layout {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.panel {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.primary {
  background: linear-gradient(145deg, rgba(255, 248, 238, 0.98), rgba(251, 239, 227, 0.96));
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

.metric-grid,
.source-grid,
.fund-list {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fund-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-card,
.source-card,
.fund-link-card {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.fund-link-card {
  display: block;
  text-decoration: none;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.fund-link-card:hover,
.fund-link-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(97, 41, 26, 0.28);
  box-shadow: 0 16px 40px rgba(58, 35, 19, 0.14);
}

.fund-link-card h3 {
  margin-top: 8px;
  font-size: 1.28rem;
  line-height: 1.3;
}

.fund-link-code,
.fund-link-path {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-card.accent {
  background: linear-gradient(180deg, #fff5eb 0%, #ffe7d6 100%);
}

.metric-label,
.source-title {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-value,
.source-value {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-sub,
.source-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.formula-block {
  margin: 8px 0 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.92);
  color: var(--accent-deep);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    "SFMono-Regular",
    "Menlo",
    "Consolas",
    monospace;
}

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

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

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

th {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.caveats {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.loading-panel,
.error-panel {
  text-align: center;
}

@media (max-width: 820px) {
  .metric-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .panel,
  .hero {
    padding: 20px;
    border-radius: 20px;
  }
}
