/* =========================================================
   Mo Minoneshan — Quant Portfolio
   Design System
   ========================================================= */

:root {
  /* Colors */
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-dark: #0b1220;
  --bg-dark-soft: #111a2e;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent: #0f4c81;
  --accent-bright: #2563eb;
  --accent-soft: #dbeafe;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --code-bg: #0d1424;
  --success: #047857;
  --warn: #b45309;

  /* Typography */
  --font-sans: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
    Menlo, monospace;

  /* Layout */
  --container: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

code,
pre {
  font-family: var(--font-mono);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
}

.section-tight {
  padding: 48px 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.muted {
  color: var(--text-secondary);
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand .brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
}

.nav-links a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: 0.2s;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
}

.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--bg-dark);
  color: #fff;
}

.btn-primary:hover {
  background: #1a2540;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  margin: 0 0 20px;
  max-width: 18ch;
}

.hero .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 0 32px;
}

.hero .accent-line {
  color: var(--accent);
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 0;
}

.section-head .link-more {
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Cards / Projects ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.project-card h3 a {
  color: var(--text);
}

.project-card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-card .desc {
  color: var(--text-secondary);
  font-size: 14.5px;
  margin: 0 0 16px;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-chip {
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.15s;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

/* ---------- Research areas ---------- */
.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
}

/* ---------- Experience / timeline ---------- */
.timeline {
  display: grid;
  gap: 4px;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item .role {
  font-weight: 600;
}

.timeline-item .org {
  color: var(--text-secondary);
  font-size: 14.5px;
}

.timeline-item .when {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- Dark section ---------- */
.dark-section {
  background: var(--bg-dark);
  color: #e5e7eb;
}

.dark-section h2,
.dark-section h3 {
  color: #fff;
}

.dark-section .muted {
  color: #9ca3af;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer .foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.site-footer a {
  color: var(--text-secondary);
  margin-left: 16px;
}

.site-footer .foot-links a:first-child {
  margin-left: 0;
}

/* ---------- Prose (project landing / notes) ---------- */
.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 40px 0 14px;
}

.prose h3 {
  font-size: 1.2rem;
  margin: 28px 0 10px;
}

.prose p {
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  color: var(--text-secondary);
  padding-left: 22px;
  margin: 0 0 16px;
}

.prose li {
  margin: 6px 0;
}

/* ---------- Callout ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
}

.callout .callout-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 8px;
}

.callout.warn {
  border-left-color: var(--warn);
}
.callout.warn .callout-title {
  color: var(--warn);
}

/* ---------- Code blocks ---------- */
pre[class*="language-"],
.code-block {
  background: var(--code-bg) !important;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 18px 20px !important;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 20px 0;
  border: 1px solid #1e293b;
}

:not(pre) > code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.88em;
  color: var(--accent);
}

/* ---------- Tables ---------- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.doc-table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
}

.doc-table tr:hover td {
  background: var(--bg-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding: 56px 0 40px;
  }
}

/* ---------- Profile Section ---------- */
.profile-container {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 40px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.profile-info h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.5rem;
}

.profile-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.profile-bio {
  color: var(--text-muted);
  margin: 8px 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .profile-container {
    flex-direction: column;
    text-align: center;
    padding: 24px;
    gap: 16px;
  }

  .profile-photo {
    width: 100px;
    height: 100px;
  }

  .profile-info h2 {
    font-size: 1.25rem;
  }
}
