/* ==========================================================================
   Christopher Mejo, Ph.D. — Executive Technical Portfolio Stylesheet
   ========================================================================== */

:root {
  --bg: #080c14;
  --bg-surface: #0f1623;
  --bg-elevated: #162032;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(56, 189, 248, 0.4);

  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-subtle: rgba(56, 189, 248, 0.1);
  --status-green: #10b981;

  --max-w: 56rem;
  --radius: 0.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-surface: #f8fafc;
  --bg-elevated: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #0284c7;

  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent: #0369a1;
  --accent-hover: #0284c7;
  --accent-subtle: rgba(3, 105, 161, 0.08);
  --status-green: #059669;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 80% 35% at 50% -8%, var(--accent-subtle), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.6;
  text-align: start;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  text-wrap: balance;
  color: var(--text);
}

p, li, dd {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -8rem;
  left: 1rem;
  background: var(--accent);
  color: #060911;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent);
}

.brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons & Icons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  min-height: 2.35rem;
  font-family: inherit;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 2.1rem;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: #060911;
  border-color: transparent;
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #060911;
  border-color: transparent;
}

[data-theme="light"] .btn-primary:hover {
  color: #ffffff;
}

.icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.icon-btn {
  padding: 0;
  width: 2.1rem;
  height: 2.1rem;
  min-height: 2.1rem;
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 8px var(--status-green);
}

.hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.35rem;
  letter-spacing: -0.01em;
}

.hero-lead {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 72ch;
  margin-bottom: 0.9rem;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.6rem 0 2.25rem;
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.metric dt {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.metric-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.metric-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 0.15rem;
}

/* Sections */
.section {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Selected Systems Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.card-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 600;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.card-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 0.9rem;
}

.card-metric {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

/* Timeline Roles */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
}

.role {
  padding-bottom: 1.85rem;
  border-bottom: 1px solid var(--border);
}

.role:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.role-title {
  display: inline;
  font-size: 1.05rem;
  font-weight: 700;
}

.role-company {
  font-size: 0.98rem;
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.35rem;
}

.role-company::before {
  content: "— ";
  color: var(--text-muted);
}

.role-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.role-bullets {
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 78ch;
}

.role-bullets li {
  margin-bottom: 0.4rem;
}

.role-bullets li:last-child {
  margin-bottom: 0;
}

.role-bullets strong {
  color: var(--text);
  font-weight: 600;
}

/* Credentials & Technical Stack */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem;
}

.cred-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cred-list li {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cred-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cred-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.cred-head strong {
  color: var(--text);
  font-weight: 700;
}

.cred-head span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cred-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.cred-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cred-head .badge-active {
  color: var(--status-green);
  font-weight: 600;
}

.stack-dl {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stack-dl dt {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.stack-dl dd {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Contact Box */
.contact-section {
  border-bottom: none;
}

.contact-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-copy {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 68ch;
  margin-top: 0.35rem;
}

.contact-actions {
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

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

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

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--status-green);
  color: #04130d;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 48rem) {
  .nav-links {
    display: none;
  }
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media print {
  .site-header, .hero-actions, .status-pill, .site-footer, .skip-link, .toast, .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  .section, .hero, .role, .card, .contact-box {
    border-color: #ccc !important;
    background: transparent !important;
    padding: 0.5rem 0 !important;
  }
  a {
    color: #000 !important;
    text-decoration: none !important;
  }
}
