:root {
  --color-bg: #050816;
  --color-bg-alt: #0b1221;
  --color-grid: rgba(139, 92, 246, 0.12);
  --color-surface: rgba(14, 20, 40, 0.88);
  --color-surface-strong: rgba(18, 26, 52, 0.94);
  --color-border: rgba(129, 140, 248, 0.35);
  --color-text: #e9edf8;
  --color-muted: #9aa4c8;
  --color-accent: #8b5cf6;
  --color-accent-strong: #22d3ee;
  --shadow-lg: 0 26px 64px rgba(9, 12, 34, 0.55);
  --shadow-md: 0 20px 46px rgba(8, 13, 32, 0.4);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 220ms ease;
  --container-max: 1440px;
  /* Horizontal page gutter, shared by the header and every section */
  --gutter: clamp(20px, 4.5vw, 96px);
  --color-cement: #c7c9cc;
  --skill-check: #0f5e29;
  --skill-header-height: 72px;

  /* Two families, per the "distinctive primary + readable secondary" rule.
     Space Grotesk carries headings, nav and CTAs; Inter carries body copy. */
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Card surfaces, themed in one place so sections stay seamless */
  --card-bg: rgba(17, 24, 48, 0.72);
  --card-border: rgba(129, 140, 248, 0.28);
  --card-shadow: 0 18px 40px rgba(6, 10, 28, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  /* Article guidance: body copy sits in the 16-20px band */
  font-size: 17px;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* One continuous page backdrop. No tiled texture and no blend modes, so
   sections never read as stacked rectangles. */
body {
  min-height: 100vh;
  background-image: radial-gradient(circle at 18% 12%, rgba(139, 92, 246, 0.22) 0%, rgba(5, 8, 22, 0) 55%),
    radial-gradient(circle at 84% 8%, rgba(34, 211, 238, 0.18) 0%, rgba(5, 8, 22, 0) 50%),
    linear-gradient(170deg, #050816 0%, #0a1020 45%, #0d1430 100%);
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  scroll-behavior: smooth;
}

/* Keep interactive elements on Roboto too (they don't inherit by default) */
button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  /* Generous side gutters so content never runs to the window edge */
  padding: 0 var(--gutter);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(18px);
  background: rgba(7, 11, 28, 0.82);
  border-bottom: 1px solid rgba(129, 140, 248, 0.28);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Match the page gutter instead of zeroing it out */
  padding: 12px var(--gutter);
}

.brand {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: clamp(30px, 2.6vw, 40px); /* fit nicely in header space */
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 0;
}

.site-nav {
  display: flex;
  align-items: center;
}


.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.theme-toggle {
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(16, 24, 48, 0.8);
  border-radius: 999px;
  padding: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent-strong);
  background: rgba(139, 92, 246, 0.24);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

:root[data-theme='light'] {
  --color-bg: #f5f7fb;
  --color-bg-alt: #ffffff;
  --color-surface: rgba(255, 255, 255, 0.96);
  --color-surface-strong: rgba(255, 255, 255, 0.98);
  --color-border: rgba(148, 163, 184, 0.28);
  --color-text: #0f172a;
  /* Revert muted text to original grey */
  --color-muted: #4b5563;
  --color-accent: #6366f1;
  --color-accent-strong: #0ea5e9;
}

:root[data-theme='light'] body {
  background-image: radial-gradient(circle at 18% 12%, rgba(99, 102, 241, 0.1) 0%, rgba(241, 245, 249, 0) 55%),
    radial-gradient(circle at 84% 8%, rgba(14, 165, 233, 0.12) 0%, rgba(241, 245, 249, 0) 52%),
    linear-gradient(170deg, #f8fafc 0%, #eef2ff 55%, #e6f1fb 100%);
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
}

:root[data-theme='light'] .site-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

:root[data-theme='light'] .hero-subhead {
  color: #4338ca;
}

:root[data-theme='light'] .hero-visual::before {
  background: transparent;
  opacity: 0;
}

:root[data-theme='light'] .hero-visual::after {
  background: radial-gradient(80% 60% at 70% 40%, rgba(99, 102, 241, 0.18) 0%, rgba(14, 165, 233, 0.12) 55%, transparent 80%);
}

:root[data-theme='light'] .resume-link {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

:root[data-theme='light'] .detail-meta {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

:root[data-theme='light'] .site-footer {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

:root[data-theme='light'] .site-nav-list {
  background: rgba(255, 255, 255, 0.95);
  border-left: 1px solid rgba(148, 163, 184, 0.28);
}

:root[data-theme='light'] .section-alt {
  background: transparent;
  backdrop-filter: none;
}

:root[data-theme='light'] {
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(148, 163, 184, 0.38);
  --card-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

:root[data-theme='light'] .skill-card,
:root[data-theme='light'] .contact-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
}

:root[data-theme='light'] .tag-chip {
  background: rgba(226, 232, 240, 0.88);
  border-color: rgba(148, 163, 184, 0.4);
  color: #4338ca;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}

:root[data-theme='light'] .button.secondary {
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
}

:root[data-theme='light'] .theme-toggle {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.28);
}
.site-nav-list {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav-list a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--transition);
}

.site-nav-list a:hover,
.site-nav-list a:focus,
.site-nav-list a.active {
  color: var(--color-text);
}

.resume-link {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(139, 92, 246, 0.18);
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Utility: keep text on one line */
.nowrap { white-space: nowrap; }

.section {
  padding: clamp(64px, 11vh, 110px) 0;
}

/* section-alt no longer paints its own panel: the page backdrop shows
   through every section so there are no visible seams between them. */
.section-alt {
  padding: clamp(64px, 11vh, 110px) 0;
  background: transparent;
  backdrop-filter: none;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--color-text);
  font-family: var(--font-display);
}

/* Display headings: Poppins, no drop shadow */
.display-algerian {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  text-transform: none;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

:root[data-theme='light'] .display-algerian {
  text-shadow: none;
}

.display-algerian-underline {
  /* Underlines removed per request */
  text-decoration: none;
}

h1 {
  /* reduce boldness for main heading */
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  font-weight: 600;
  /* 30-38px, inside the recommended 30-70px title band */
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  letter-spacing: -0.015em;
  text-align: center;
  margin-bottom: clamp(18px, 4vw, 32px);
}

h3 {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.005em;
}

p {
  line-height: 1.7;
  margin: 0 0 0.6rem;
}

/* CTAs and nav ride the display face for contrast against body copy */
.button,
.site-nav-list a,
.resume-link,
.project-cta,
.detail-back,
.eyebrow {
  font-family: var(--font-display);
}

.hero-subhead {
  /* 22-26px, the recommended subtitle band */
  font-size: clamp(1.35rem, 1.75vw, 1.6rem);
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-accent-strong);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.hero {
  position: relative;
  overflow: hidden;
  /* Sit the hero content lower so it clears the sticky header comfortably */
  padding: clamp(36px, 8vh, 92px) 0 clamp(36px, 6vh, 64px);
}

/* No decorative blob behind the hero: it read as a hard-edged arc against
   the page backdrop. The body gradient carries the colour on its own. */
.hero::before {
  content: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(16px, 2.8vw, 56px);
  grid-template-columns: minmax(280px, 1fr);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    /* Even split: copy on the left half, portrait on the right half */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

.hero-copy {
  display: grid;
  gap: 0.9rem; /* tighter spacing between hero paragraphs */
  max-width: none; /* fills its half of the grid */
  justify-items: start; /* keep hero text aligned consistently */
}

/* Name stays on one line within its half of the hero. The vw term is tuned
   so the longest line still fits the column; below 900px it may wrap. */
.hero-name {
  position: relative;
  z-index: 1;
  font-size: clamp(1.9rem, 2.65vw, 3.05rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  text-align: left;
  line-height: 1.12;
  margin: 0.15rem 0 0.45rem;
}

@media (min-width: 900px) {
  .hero-name {
    white-space: nowrap;
  }
}

.hero-copy .lead {
  font-size: clamp(1.12rem, 1.6vw, 1.34rem);
  color: var(--color-muted);
  line-height: 1.78;
  max-width: 100%;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  /* Fills its half of the hero grid */
  min-height: clamp(320px, 46vh, 560px);
  max-width: 100%;
  width: 100%;
  isolation: isolate;
  transform: none;
  border-radius: 18px;
  overflow: hidden;
}

@media (min-width: 960px) {
  .hero-visual {
    /* Centred in its half, portrait proportions so the photo isn't
       cropped down to a headshot */
    justify-self: center;
    transform: none;
    aspect-ratio: 4 / 5;
    max-width: min(100%, 460px);
    min-height: 0;
  }
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  mix-blend-mode: normal;
  opacity: 0;
  z-index: 2;
}

.hero-visual::after {
  content: none;
}

.hero-photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover; /* fill and cover available area */
  object-position: center top; /* keep composition towards top */
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  filter: saturate(1.02) contrast(1.02);
  z-index: 1;
  /* remove masking so original photo shows */
  -webkit-mask-image: none;
          mask-image: none;
}

.eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 600;
  color: var(--color-accent);
}

/* The credential line runs the full hero width instead of being squeezed
   into the text column, so it fills the space beside the portrait. */
.eyebrow-long {
  letter-spacing: 0.1em;
  font-size: clamp(0.74rem, 0.86vw, 0.92rem);
  line-height: 1.8;
  max-width: none;
  margin: 0 0 0.35rem;
}

.eyebrow-long .eyebrow-sep {
  color: var(--color-accent-strong);
  padding: 0 0.2rem;
}

.paragraph-stack {
  display: grid;
  gap: 6px; /* reduce spacing between paragraphs */
  max-width: none;
  width: 100%;
  color: var(--color-muted);
  line-height: 1.7;
}

/* Tighter spacing for About section specifically */
#about .paragraph-stack {
  gap: 6px;
}

.section-intro {
  font-size: 1.06rem;
  color: var(--color-muted);
  max-width: 820px;
  line-height: 1.75;
  margin: clamp(18px, 4vw, 30px) auto clamp(44px, 6vw, 58px);
  text-align: center;
}

/* Slightly increase description text in key sections */
#about .paragraph-stack p,
.timeline-card p,
.community-card p,
.contact-card p {
  /* Slight bump for section descriptions */
  font-size: clamp(1.06rem, 1.2vw, 1.18rem);
}

/* Further increase for requested sections only */
#about .paragraph-stack p,
.experience-card p,
.project-description,
.contact-card p {
  font-size: clamp(1.12rem, 1.25vw, 1.22rem);
}

main .section > .container,
main .section-alt > .container {
  display: grid;
  gap: clamp(24px, 3.2vw, 40px);
  justify-items: stretch;
}

.section .container > h2,
.section-alt .container > h2 {
  justify-content: center;
  text-align: center;
}

.skill-grid {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
  /* Four columns on large screens */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .skill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .skill-grid {
    grid-template-columns: 1fr;
  }
}

.skill-card {
  padding: clamp(28px, 2.2vw, 36px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: linear-gradient(165deg, rgba(18, 26, 52, 0.92), rgba(25, 22, 56, 0.85));
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-rows: var(--skill-header-height) 1fr;
  align-content: start;
  gap: clamp(18px, 2vw, 26px);
  /* Equal height for all skill cards with reduced bottom space */
  height: clamp(580px, 58vh, 640px);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: -55% auto auto -45%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22), transparent 65%);
  z-index: 0;
  transition: transform var(--transition), opacity var(--transition);
  opacity: 0.75;
}

.skill-card:hover::before {
  opacity: 1;
  transform: translate(12px, 10px);
}

.skill-card > * {
  position: relative;
  z-index: 1;
}

.skill-card h3 {
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  display: grid;
  align-content: center; /* center text within fixed header area */
  justify-items: center; /* center horizontally */
  text-align: center; /* center heading text */
  gap: 14px;
}

/* Decorative heading check icon for skill cards */
.skill-heading-deco {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  border: 2.5px solid var(--skill-check);
  box-shadow: 0 8px 18px rgba(14, 20, 40, 0.22);
}

.skill-heading-deco::after {
  content: '';
  position: absolute;
  left: 6.5px;
  top: 6px;
  width: 9px;
  height: 6px;
  border-right: 3px solid var(--skill-check);
  border-bottom: 3px solid var(--skill-check);
  transform: rotate(45deg);
  border-radius: 1px;
}

:root[data-theme='light'] {
  --skill-check: #0b5f2a;
}

.skill-category-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 12px rgba(14, 20, 40, 0.35));
}

.skill-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  /* Start from top; no scrollbars */
  align-content: start;
  /* Smaller breathing room at the bottom of every card */
  padding-bottom: clamp(8px, 1vh, 14px);
}

.skill-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(20, 28, 58, 0.88);
  border: 1px solid rgba(129, 140, 248, 0.24);
  box-shadow: 0 10px 24px rgba(5, 11, 32, 0.32);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  overflow: hidden;
  /* Normalize badge height for consistent rows */
  height: 56px;
}

.badge-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(34, 211, 238, 0.75));
  display: inline-flex;
  flex-shrink: 0;
}

.skill-badge:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent-strong);
  box-shadow: 0 16px 28px rgba(12, 30, 64, 0.55);
}

/* Official brand marks, shown as-is: no backing plate, no recolouring */
.skill-badge img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.skill-badge span {
  /* Slightly larger labels in Skills */
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  .skill-card {
    /* Let cards grow naturally on smaller screens */
    height: auto;
    min-height: unset;
    grid-template-rows: auto 1fr; /* allow header to grow on small screens */
  }
}

.skill-note {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.55;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 24, 50, 0.8);
  border: 1px solid rgba(129, 140, 248, 0.22);
}


.timeline-grid {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  width: 100%;
  align-items: stretch;
}

.timeline-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(129, 140, 248, 0.32);
  background: linear-gradient(160deg, rgba(16, 24, 52, 0.94), rgba(28, 28, 66, 0.82));
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.timeline-card::after {
  content: '';
  position: absolute;
  inset: auto -35% -40% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  z-index: -1;
}

.timeline-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.timeline-role {
  display: block;
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-top: 6px;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.detail-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.16));
  border: 1px solid rgba(129, 140, 248, 0.35);
  font-size: 0.85rem;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.detail-list {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.2rem;
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.detail-list li {
  position: relative;
  list-style: none;
}

.detail-list li::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(34, 211, 238, 0.7));
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.45);
}

.experience-grid {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  width: 100%;
  align-items: stretch;
}

.experience-card {
  padding: 40px 32px 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(15, 20, 42, 0.92), rgba(25, 28, 62, 0.88));
  border: 1px solid rgba(129, 140, 248, 0.32);
  box-shadow: 0 20px 46px rgba(8, 13, 34, 0.45);
  display: grid;
  gap: 20px;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.experience-card > * {
  position: relative;
  z-index: 1;
}

.experience-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.75), rgba(34, 211, 238, 0.6));
}

.experience-card::after {
  content: '';
  position: absolute;
  inset: auto -32% -45% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.24), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
}

.experience-card:hover::after {
  opacity: 1;
  transform: translate(-8px, -6px);
}

.experience-card h3 {
  margin: 0;
  font-size: 1.18rem;
  display: block; /* center the heading text */
  text-align: center;
}

.experience-card h3::after {
  content: none; /* remove trailing line */
  display: none;
}

.experience-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  justify-content: center; /* center meta chips */
  text-align: center;
}

.experience-meta span {
  background: rgba(20, 30, 56, 0.85);
  border: 1px solid rgba(129, 140, 248, 0.22);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center; /* center tag chips */
}

.tag-chip {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(24, 32, 62, 0.85);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: var(--color-accent);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

/* ---------------------------------------------------------------
   Experience: a chronological rail instead of equal-width columns.
   Each entry pairs a fixed meta column (role, org, dates) with the
   detail copy, so long and short roles still line up.
   --------------------------------------------------------------- */
.experience-timeline {
  position: relative;
  display: grid;
  gap: clamp(16px, 1.8vw, 26px);
  width: 100%;
  padding-left: clamp(0px, 2.2vw, 34px);
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-strong), transparent);
  opacity: 0.5;
}

@media (max-width: 820px) {
  .experience-timeline {
    padding-left: 0;
  }

  .experience-timeline::before {
    display: none;
  }
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 44px);
  padding: clamp(22px, 2.4vw, 32px) clamp(20px, 2.4vw, 36px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition), transform var(--transition);
}

.timeline-entry:hover {
  border-color: var(--color-accent-strong);
  transform: translateX(3px);
}

/* Node on the rail */
.timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(clamp(0px, 2.2vw, 34px) * -1 - 1px);
  top: 34px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent-strong);
  box-shadow: 0 0 0 4px var(--color-bg);
}

@media (max-width: 820px) {
  .timeline-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-entry::before {
    display: none;
  }
}

.timeline-entry-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.timeline-entry-meta h3 {
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  text-align: left;
}

.timeline-entry-org {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.timeline-entry-dates {
  display: inline-flex;
  align-items: center;
  align-self: start;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid var(--card-border);
  white-space: nowrap;
  justify-self: start;
}

.timeline-entry-body {
  display: grid;
  gap: 14px;
  align-content: start;
}

.timeline-entry-body > p {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.1vw, 1.08rem);
}

.timeline-entry-body .detail-list {
  margin: 0;
}

.timeline-entry-body .tag-list {
  justify-content: flex-start;
}

/* ---------------------------------------------------------------
   Projects: alternating feature rows. Bigger artwork, readable
   measure, and a left/right rhythm down the page.
   --------------------------------------------------------------- */
.project-feature-list {
  display: grid;
  gap: clamp(20px, 2.4vw, 36px);
  width: 100%;
}

a.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(20px, 2.8vw, 46px);
  align-items: center;
  padding: clamp(18px, 1.9vw, 26px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  color: inherit;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

a.project-feature:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent-strong);
  box-shadow: 0 24px 52px rgba(8, 47, 73, 0.28);
}

/* Flip every other row so the artwork alternates sides */
a.project-feature:nth-child(even) .project-feature-media {
  order: 2;
}

@media (max-width: 900px) {
  a.project-feature {
    grid-template-columns: minmax(0, 1fr);
  }

  a.project-feature:nth-child(even) .project-feature-media {
    order: 0;
  }
}

.project-feature-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 10;
}

.project-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-md);
  transition: transform var(--transition);
}

a.project-feature:hover .project-feature-media img {
  transform: scale(1.03);
}

.project-feature-body {
  display: grid;
  gap: 14px;
  align-content: center;
}

.project-feature-body h3 {
  margin: 0;
  font-size: clamp(1.25rem, 1.7vw, 1.6rem);
}

.project-feature-body .project-meta {
  margin: 0;
}

.project-feature-body .project-description {
  margin: 0;
  color: var(--color-muted);
}

.project-feature-body .project-highlights {
  margin: 0;
}

.project-gallery {
  display: grid;
  gap: clamp(18px, 2vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  width: 100%;
  align-items: stretch;
}

a.project-card {
  display: grid;
  gap: 20px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(17, 26, 54, 0.95), rgba(35, 23, 64, 0.8));
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow: var(--shadow-md);
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 100%;
}

a.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-accent-strong);
  box-shadow: 0 20px 55px rgba(8, 47, 73, 0.55);
}

a.project-card::before {
  content: '';
  position: absolute;
  inset: -40% auto auto -30%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  z-index: -1;
}

a.project-card:hover::before {
  opacity: 1;
  transform: translate(12px, 8px);
}

.project-thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  /* Ensure all project images share the same aspect ratio */
  aspect-ratio: 16 / 9;
}

.project-thumb img {
  border-radius: var(--radius-md);
  transition: transform var(--transition);
  width: 100%;
  height: 100%;
  object-fit: cover; /* uniform alignment and crop */
  object-position: center;
}

a.project-card:hover .project-thumb img {
  transform: scale(1.03);
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.project-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.project-description {
  color: var(--color-muted);
  line-height: 1.6;
}

.project-highlights {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.2rem;
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.project-highlights li {
  list-style: none;
  position: relative;
}

.project-highlights li::before {
  content: '';
  position: absolute;
  left: -1.1rem;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(129, 140, 248, 0.3);
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.button-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.button span {
  display: inline-flex;
  align-items: center;
}

.button.primary,
.button.secondary {
  /* Unified light color for all buttons */
  background: rgba(99, 102, 241, 0.14);
  color: var(--color-accent);
  border-color: rgba(129, 140, 248, 0.28);
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent-strong);
}

.contact-card {
  display: grid;
  gap: clamp(32px, 4vw, 64px);
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: center;
  padding: clamp(32px, 3.4vw, 64px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(129, 140, 248, 0.3);
  background: linear-gradient(160deg, rgba(18, 26, 52, 0.94), rgba(32, 24, 68, 0.86));
  box-shadow: var(--shadow-md);
  width: 100%;
}

.contact-card p {
  color: var(--color-muted);
  line-height: 1.65;
}

.contact-actions {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.contact-actions .button {
  justify-content: flex-start;
}

.contact-meta {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  font-size: 0.95rem;
}

.contact-meta div {
  display: grid;
  gap: 4px;
}

.contact-meta dt {
  font-weight: 600;
  color: var(--color-text);
}

.contact-meta dd {
  margin: 0;
  color: var(--color-muted);
}

.contact-meta a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.signature-quote {
  margin: 36px 0 0;
  padding-left: 24px;
  border-left: 3px solid rgba(99, 102, 241, 0.65);
  color: var(--color-muted);
  font-style: italic;
  line-height: 1.6;
}

/* Centered "view more" row that sits under a section grid */
.section-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: clamp(6px, 1.4vw, 16px);
}

.section-cta .button {
  padding: 0.9rem 2.2rem;
}

.community-stack {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
  width: 100%;
}

.community-card {
  display: grid;
  gap: 18px;
  padding: 36px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(129, 140, 248, 0.3);
  background: linear-gradient(150deg, rgba(16, 26, 54, 0.94), rgba(28, 24, 66, 0.84));
  box-shadow: var(--shadow-md);
  width: 100%;
}

/* Link that opens an external site from inside a card */
.inline-link {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(129, 140, 248, 0.25);
  background: rgba(7, 11, 28, 0.9);
}

.site-footer p {
  margin: 0;
  color: var(--color-muted);
  text-align: center;
}

.detail-header {
  padding-top: 140px;
}

/* Listing pages (all experience / all projects) lead with a centered title */
.detail-header.page-header {
  padding-top: clamp(44px, 7vh, 84px);
}

.page-header h1 {
  text-align: center;
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  margin-bottom: 0;
}

.page-header .section-intro {
  margin-bottom: 0;
}

.detail-header.page-header + .section {
  padding-top: clamp(24px, 4vh, 48px);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.detail-hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
  margin-bottom: 64px;
}

.detail-summary {
  display: grid;
  gap: 16px;
  color: var(--color-muted);
  line-height: 1.7;
}

.detail-meta {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(18, 26, 52, 0.9), rgba(32, 24, 68, 0.82));
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow: var(--shadow-md);
}

.detail-meta dt {
  font-weight: 600;
  color: var(--color-text);
}

.detail-meta dd {
  margin: 0;
  color: var(--color-muted);
}

.detail-section {
  margin-bottom: 56px;
}

.detail-section h2 {
  margin-bottom: 18px;
}

.detail-section ul {
  padding-left: 20px;
  color: var(--color-muted);
  line-height: 1.7;
}

@media (max-width: 900px) {
  :root {
    --gutter: 6vw;
  }

  .site-nav-list {
    position: fixed;
    inset: 0 0 auto auto;
    width: min(74vw, 320px);
    flex-direction: column;
    background: rgba(7, 11, 28, 0.97);
    border-left: 1px solid rgba(139, 92, 246, 0.22);
    padding: 88px 24px 24px;
    gap: 1.25rem;
    transform: translateX(105%);
    transition: transform var(--transition);
    min-height: 100vh;
  }

  .site-nav-list[data-open='true'] {
    transform: translateX(0);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-actions {
    gap: 0.9rem;
  }

  .nav-actions .theme-toggle {
    flex-shrink: 0;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .contact-card {
    grid-template-columns: 1fr;
  }

  .section-intro {
    margin: 0 0 36px;
  }

  .community-card {
    padding: 28px;
  }

  .hero-visual {
    transform: none;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  h2::after {
    width: 4px;
  }

  .skill-card h3::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .experience-card h3::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}


:root[data-theme='light'] .skill-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

:root[data-theme='light'] .skill-badge {
  background: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

:root[data-theme='light'] .skill-badge span {
  color: #0f172a;
}

:root[data-theme='light'] .skill-note {
  color: #475569;
  background: rgba(226, 232, 240, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
}


:root[data-theme='light'] .skill-badge img {
  filter: none;
}

:root[data-theme='light'] .badge-dot {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(14, 165, 233, 0.68));
}

:root[data-theme='light'] .timeline-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
}

:root[data-theme='light'] .detail-pill {
  background: rgba(226, 232, 240, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #1f2937;
}

:root[data-theme='light'] .detail-list li::before {
  background: rgba(99, 102, 241, 0.9);
}

:root[data-theme='light'] .experience-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

:root[data-theme='light'] .experience-card::before {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.65), rgba(14, 165, 233, 0.5));
}

:root[data-theme='light'] .experience-meta span {
  background: rgba(226, 232, 240, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #1e293b;
}

:root[data-theme='light'] .tag-chip {
  background: rgba(226, 232, 240, 0.88);
  border-color: rgba(148, 163, 184, 0.4);
  color: #4338ca;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}

:root[data-theme='light'] .community-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

:root[data-theme='light'] .signature-quote {
  border-left-color: rgba(99, 102, 241, 0.45);
  color: #475569;
}

:root[data-theme='light'] .project-highlights li::before {
  background: rgba(99, 102, 241, 0.85);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
}


:root[data-theme='light'] .button.primary,
:root[data-theme='light'] .button.secondary {
  /* Same unified light color in light mode */
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.25);
}

:root[data-theme='light'] .resume-link {
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.28);
}

:root[data-theme='light'] .project-card {
  border-color: rgba(148, 163, 184, 0.28);
}

:root[data-theme='light'] .theme-icon {
  filter: none;
}


:root[data-theme='light'] .skill-badge:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}


/* ---------------------------------------------------------------
   Parallel alignment: body copy is justified so paragraphs share a
   straight left and right edge. Hyphenation prevents the word gaps
   that justification otherwise opens up on narrow columns.
   --------------------------------------------------------------- */
.paragraph-stack p,
.hero-copy .lead,
.section-intro,
.detail-summary p,
.detail-section p,
.detail-section li,
.detail-list li,
.project-description,
.project-highlights li,
.timeline-entry-body > p,
.timeline-card p,
.community-card p,
.contact-card p,
.experience-card p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Last line of a justified block should not be stretched */
.paragraph-stack p,
.detail-summary p,
.detail-section p {
  text-align-last: left;
}

/* Centred intros stay centred; justification would fight the centring */
.section-intro {
  text-align: center;
  hyphens: manual;
}

/* Short strings never benefit from justification */
.timeline-entry-org,
.experience-meta,
.project-meta,
.timeline-meta,
.contact-meta dd,
.eyebrow,
.hero-subhead {
  text-align: left;
  hyphens: manual;
}


/* ---------------------------------------------------------------
   Resume page: facts rail top-left, title + actions top-right,
   full-width PDF viewer beneath with an in-page expand toggle.
   --------------------------------------------------------------- */

/* Breadcrumb strip, sits directly under the sticky header */
.breadcrumb {
  border-bottom: 1px solid var(--card-border);
  background: transparent;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 14px 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted);
}

.breadcrumb li + li::before {
  content: '/';
  color: var(--color-muted);
  opacity: 0.6;
}

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

.breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb [aria-current='page'] {
  color: var(--color-text);
  font-weight: 500;
}

.resume-section {
  padding-top: clamp(26px, 3.5vh, 44px);
}

.resume-section > .container {
  display: grid;
  gap: clamp(22px, 2.6vw, 36px);
}

/* Title band spans the full width: heading left, actions right */
.resume-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(18px, 2.5vw, 40px);
  padding-bottom: clamp(18px, 2vw, 26px);
  border-bottom: 1px solid var(--card-border);
  width: 100%;
}

.resume-head-text {
  display: grid;
  gap: 10px;
  flex: 1 1 460px;
  min-width: 0;
}

.resume-head-text h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.resume-head-text p {
  margin: 0;
  max-width: 68ch;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  line-height: 1.65;
  text-align: left;
  hyphens: manual;
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 0 0 auto;
}

/* Rail beside the document, so neither column is left empty */
.resume-body {
  display: grid;
  grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
  align-items: start;
  width: 100%;
}

@media (max-width: 1000px) {
  .resume-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.resume-rail {
  display: grid;
  gap: clamp(14px, 1.6vw, 20px);
  align-content: start;
  position: sticky;
  top: 92px;
}

@media (max-width: 1000px) {
  .resume-rail {
    position: static;
  }
}

.resume-rail-card {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 2vw, 26px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.resume-rail-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.resume-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.resume-facts div {
  display: grid;
  gap: 3px;
}

.resume-facts dt {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.resume-facts dd {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--color-text);
}

.resume-tags {
  justify-content: flex-start;
}

/* Framed viewer, styled like an app window */
.resume-viewer {
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  width: 100%;
}

.resume-viewer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--card-border);
}

.resume-viewer-dots {
  display: inline-flex;
  gap: 6px;
}

.resume-viewer-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.5;
}

.resume-viewer-dots i:nth-child(2) {
  background: var(--color-accent-strong);
}

.resume-viewer-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Expand control, pinned to the right of the viewer bar */
.resume-expand {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.resume-expand:hover {
  border-color: var(--color-accent-strong);
  background: rgba(99, 102, 241, 0.2);
}

.resume-expand .icon-collapse {
  display: none;
}

/* Expanded: fills the viewport, still on the same page */
.resume-viewer.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 1200;
  border-radius: 0;
  border: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.resume-viewer.is-expanded .resume-frame {
  flex: 1;
  height: auto;
}

.resume-viewer.is-expanded .icon-expand {
  display: none;
}

.resume-viewer.is-expanded .icon-collapse {
  display: inline;
}

body.resume-expanded {
  overflow: hidden;
}

.resume-frame {
  display: block;
  width: 100%;
  height: clamp(680px, 128vh, 1400px);
  border: 0;
  background: #ffffff;
}

.resume-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--color-muted);
}

/* Charts and plots are shown whole rather than cropped to fill the frame,
   on a light plate so matplotlib/ggplot output keeps its white background. */
.project-feature-media.is-plot {
  background: #ffffff;
  padding: 10px;
}

.project-feature-media.is-plot img {
  object-fit: contain;
  background: #ffffff;
}

/* Dark theme: brand marks whose official colour is near-black (GitHub #181717,
   pandas #150458, NumPy #013243) disappear on a dark surface. Render them in
   the brand's official monochrome-on-dark variant instead of recolouring. */
:root[data-theme='dark'] img[src$="github.svg"],
:root[data-theme='dark'] img[src$="pandas.svg"],
:root[data-theme='dark'] img[src$="numpy.svg"] {
  filter: brightness(0) invert(1);
}
