:root {
  --bg: #fdfcf9;
  --bg-muted: #f3f1eb;
  --text: #1c1c1c;
  --text-soft: #5a5a5a;
  --accent: #c2410c;
  --border: #e5e2da;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 4px 16px rgba(20, 20, 20, 0.05);
  --maxw: 960px;
  --space: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --bg-muted: #1c1c1c;
    --text: #eceae4;
    --text-soft: #a6a6a6;
    --accent: #fb923c;
    --border: #2a2a2a;
    --card: #1a1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

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

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section--muted {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.display {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
  font-weight: 650;
}

h3 {
  font-size: 1.15rem;
}

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

.lede {
  font-size: 1.15rem;
  color: var(--text-soft);
  margin-top: 0;
}

.section-sub {
  color: var(--text-soft);
  margin-top: -0.25rem;
  margin-bottom: 2rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 2rem;
  align-items: start;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow);
}

.link-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0;
  margin: 1.5rem 0 0;
}

.link-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.link-row a:hover {
  text-decoration: underline;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.quote-card,
.work-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin: 0;
}

/* Marquee (auto-scrolling endorsements) */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 1rem 0;
  /* Fade in/out at the edges for a polished look */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}

.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  /* Only animate once the JS clone has run, to avoid flashing a single set */
}

.marquee.marquee--ready .marquee-track {
  animation: marquee-scroll 45s linear infinite;
}

.marquee-track .quote-card {
  flex: 0 0 320px;
  max-width: 320px;
  min-height: 100%;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .marquee.marquee--ready .marquee-track {
    animation: none;
  }
}

.quote-card blockquote {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1rem;
}

.quote-card blockquote p {
  margin: 0;
}

.quote-card figcaption {
  display: flex;
  flex-direction: column;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.quote-card figcaption strong {
  color: var(--text);
}

.work-card h3 {
  margin-bottom: 0.5rem;
}

.work-card p {
  color: var(--text-soft);
  margin: 0 0 1rem;
}

/* Clickable work-card variant (used on the homepage portfolio grid) */
.work-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.work-card--link:hover,
.work-card--link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(20, 20, 20, 0.06), 0 10px 24px rgba(20, 20, 20, 0.08);
  outline: none;
}

.work-card--link h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.work-card--link .arrow {
  color: var(--accent);
  font-weight: 500;
  transition: transform 0.15s ease;
}

.work-card--link:hover .arrow,
.work-card--link:focus-visible .arrow {
  transform: translateX(3px);
}

/* Back link used on sub-pages */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

/* Portfolio — Power BI grid */
.pbi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.pbi-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pbi-card:hover,
.pbi-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(20, 20, 20, 0.06), 0 10px 24px rgba(20, 20, 20, 0.08);
  outline: none;
}

.pbi-card .thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 35%, transparent),
      color-mix(in srgb, var(--accent) 10%, transparent));
  border-bottom: 1px solid var(--border);
}

.pbi-card .thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pbi-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
}

.pbi-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.pbi-title .arrow {
  color: var(--accent);
  font-weight: 500;
  transition: transform 0.15s ease;
}

.pbi-card:hover .pbi-title .arrow,
.pbi-card:focus-visible .pbi-title .arrow {
  transform: translateX(3px);
}

.pbi-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.pill--accent {
  align-self: flex-start;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Modal */
body.no-scroll {
  overflow: hidden;
}

.pbi-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.pbi-modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1200px, 95vw);
  height: min(800px, 90vh);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.modal-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.pbi-modal iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg-muted);
}

@media (max-width: 640px) {
  .pbi-modal {
    padding: 0;
  }
  .modal-dialog {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pbi-card,
  .pbi-title .arrow {
    transition: none;
  }
}

/* Resume */
.resume-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

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

.btn-ghost {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  background: var(--card);
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.role {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.role:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.role-head h3 {
  margin: 0;
}

.role-org {
  color: var(--text-soft);
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
}

.role-dates {
  color: var(--text-soft);
  font-size: 0.9rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.role-points {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}

.role-points li {
  margin-bottom: 0.4rem;
  color: var(--text);
}

.role-points li::marker {
  color: var(--accent);
}

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

.skill-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.skill-group p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.plain-list li:last-child {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .back-link,
  .no-print {
    display: none !important;
  }
  .section {
    padding: 1rem 0;
    break-inside: avoid;
  }
  .section--muted {
    background: transparent;
    border: 0;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  a {
    color: #000;
    text-decoration: none;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-soft);
  text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .avatar {
    width: 96px;
    height: 96px;
    font-size: 1.75rem;
  }

  .nav a {
    margin-left: 0.9rem;
  }

  .section {
    padding: 3rem 0;
  }
}
