:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-soft: #f5f2eb;
  --border: #e7e2d8;
  --border-strong: #d8d1c4;
  --ink: #18181b;
  --ink-2: #4b5563;
  --ink-muted: #71717a;

  --pos: #047857;
  --pos-bg: #ecfdf5;
  --pos-border: #a7f3d0;

  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;

  --amber: #d97706;
  --slate: #64748b;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px rgba(24, 24, 27, 0.04);
  --shadow-hover: 0 4px 10px rgba(24, 24, 27, 0.06), 0 14px 32px rgba(79, 70, 229, 0.08);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(880px 420px at 14% -8%, rgba(99, 102, 241, 0.09), transparent 60%),
    radial-gradient(760px 380px at 88% -6%, rgba(16, 185, 129, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
}

.pill-accent {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.pill-pos {
  background: var(--pos-bg);
  border-color: var(--pos-border);
  color: var(--pos);
}

.pill-soft {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--ink-2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10b981;
  display: inline-block;
}

/* Top nav */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.nav-links a {
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

/* Intro / Hero */
.hero {
  margin-bottom: 44px;
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.hero-tagline {
  margin: 14px 0 0;
  max-width: 58ch;
  font-size: 1.06rem;
  color: var(--ink-2);
}

/* Sections */
.section {
  margin-top: 12px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* Project grid & card */
.projects-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr);
  gap: 24px;
  align-items: center;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-border);
  outline: none;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.project-title {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.project-blurb {
  margin: 8px 0 18px;
  color: var(--ink-2);
  font-size: 0.96rem;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.project-cta .arrow {
  transition: transform 0.16s ease;
}

.project-card:hover .project-cta .arrow {
  transform: translateX(3px);
}

/* Mini visual preview inside scorecard card */
.mini-preview {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.mini-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}

.mini-row.is-you {
  color: var(--ink);
  font-weight: 700;
}

.mini-track {
  height: 9px;
  border-radius: 999px;
  background: #e5e0d5;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  border-radius: 999px;
}

.mini-fill.you {
  width: 84%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.mini-fill.sp500 {
  width: 54%;
  background: var(--slate);
}

.mini-fill.buffett {
  width: 46%;
  background: var(--amber);
}

.mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.mini-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  color: var(--pos);
}

/* 404 layout */
.not-found-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 40px;
}

.not-found-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}

.not-found-code {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 14px 0 10px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.not-found-card h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.not-found-card p {
  margin: 0 0 24px;
  color: var(--ink-2);
  font-size: 0.96rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-secondary {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background: #ece7dc;
}

/* Footer */
.footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

@media (max-width: 720px) {
  .page {
    padding: 28px 16px 48px;
  }

  .topbar {
    margin-bottom: 32px;
  }

  .project-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    gap: 18px;
  }

  .not-found-card {
    padding: 28px 20px;
  }
}
