/* ==========================================================================
 *   DESIGN TOKENS — "Model Card" concept
 *   Shared tokens live in :root. Theme-specific colors are set per [data-theme].
 *   Default theme is dark (see html[data-theme] in index.html).
 *   ========================================================================== */
:root {
  --radius-sm: 4px;
  --radius-md: 8px;

  --font-display: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --content-max: 1370px;
  --on-signal: #241F20;
}

/* --- DARK THEME: Soft Charcoal + Coral + Mint --- */

[data-theme="dark"] {

  /* Background */
  --paper: #11131A;

  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.045);

  /* Typography */
  --ink: #F8F3F1;
  --ink-soft: #D4CCCA;
  --ink-faint: #918A89;

  /* Borders */
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Primary — Coral Pink */
  --signal: #f68787;
  --signal-dim: rgba(255, 157, 157, 0.13);
  --signal-line: rgba(255, 157, 157, 0.42);

  /* Positive — Mint */
  --good: #BBF1D2;
  --good-dim: rgba(187, 241, 210, 0.12);

  /* Information — Pale Lime */
  --info: #EEF8CD;
  --info-dim: rgba(238, 248, 205, 0.09);
  --info-line: rgba(238, 248, 205, 0.24);

  /* Footer */
  --footer-bg: #111011;
  --footer-text: #F8F3F1;
  --footer-muted: rgba(248, 243, 241, 0.60);
  --footer-border: rgba(248, 243, 241, 0.13);

  --footer-input-bg: rgba(248, 243, 241, 0.05);
  --footer-input-border: rgba(248, 243, 241, 0.16);

  /* Header */
  --header-bg: rgba(24, 23, 24, 0.90);

  /* No decorative background effects */
  --aurora-1: none;
  --aurora-2: none;
  --aurora-3: none;
  --aurora-4: none;

  --grid-line: transparent;

  --card-blur: none;
}

/* --- LIGHT THEME: Colorful Editorial --- */

[data-theme="light"] {

  --paper:  #f6f6f6;
  --surface: rgba(255, 249, 251, 0.78);
  --ink: #262342;
  --ink-soft: #514D68;
  --ink-faint: #817B94;

  --line: rgba(64, 61, 136, 0.14);
  --line-strong: rgba(64, 61, 136, 0.25);

  --signal: #007DCC;
  --signal-dim: rgba(0, 125, 204, 0.10);
  --signal-line: rgba(0, 125, 204, 0.38);

  --good: #AF719D;
  --good-dim: rgba(175, 113, 157, 0.13);

  --info: #403D88;
  --info-dim: rgba(64, 61, 136, 0.08);
  --info-line: rgba(64, 61, 136, 0.24);

  --footer-bg: #403D88;
  --footer-text: #FFF9FB;
  --footer-muted: rgba(255, 249, 251, 0.70);
  --footer-border: rgba(248, 178, 178, 0.25);

  --footer-input-bg: rgba(255, 255, 255, 0.08);
  --footer-input-border: rgba(255, 255, 255, 0.20);

  --header-bg: #EDE4EA;

  --grid-line: transparent;

  --aurora-1: none;
  --aurora-2: none;
  --aurora-3: none;
  --aurora-4: none;

  --card-blur: none;
}

/* ==========================================================================
 *   RESET & BASE
 *   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 20px; }

@media (max-width: 1100px) { html { font-size: 18px; } }
@media (max-width: 720px)  { html { font-size: 16px; } }
@media (max-width: 420px)  { html { font-size: 14.5px; } }

body,
.site-header,
.skill-card, .project-card, .log-card, .cert-card, .achievement-card,
.status-badge, .pill, .tech-tag, .focus-tags span, .interests-row span {
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

body {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--paper); }
a { color: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.section-inner { max-width: var(--content-max); margin: 0 auto; padding: 0 2.5rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
}

/* ==========================================================================
 *   HEADER
 *   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.1rem 2.5rem;

  display: flex;
  align-items: center;

  gap: 2rem;
}

.brand {
  flex-shrink: 0;

  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-tag { color: var(--ink-faint); font-weight: 400; }

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 1.6rem;

  flex: 1;
}
.main-nav a { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-soft); text-decoration: none; transition: color 0.2s var(--ease); white-space: nowrap; }
.main-nav a:hover { color: var(--signal); }
.main-nav a.nav-cta { color: var(--ink); border: 1px solid var(--line-strong); padding: 0.4rem 0.9rem; border-radius: var(--radius-sm); }
.main-nav a.nav-cta:hover { border-color: var(--signal); color: var(--signal); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  flex-shrink: 0;
}

.theme-toggle {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--signal); color: var(--signal); }

.theme-icon {
  position: absolute;
  font-size: 0.92rem;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.theme-icon--sun { opacity: 0; transform: translateY(8px) rotate(-40deg); }
.theme-icon--moon { opacity: 1; transform: translateY(0) rotate(0); }

[data-theme="light"] .theme-icon--sun { opacity: 1; transform: translateY(0) rotate(0); }
[data-theme="light"] .theme-icon--moon { opacity: 0; transform: translateY(-8px) rotate(40deg); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 34px; height: 34px; background: transparent;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle span { display: block; width: 16px; height: 1.5px; margin: 0 auto; background: var(--ink); transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
 *   HERO
 *   ========================================================================== */
.hero { padding: 9.5rem 2.5rem 4rem; }

.hero-inner {
  max-width: var(--content-max); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; align-items: center;
}

.hero-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.8rem, 5.6vw, 4.6rem); line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 0.7rem; min-height: 1em;
}

.hero-subhead { font-family: var(--font-mono); font-size: clamp(0.95rem, 1.6vw, 1.05rem); color: var(--signal); margin-bottom: 0.5rem; }

.hero-tagline {
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem;
  color: var(--ink-soft); margin-bottom: 1.2rem; max-width: 42ch;
}

.hero-abstract { font-size: 1.18rem; line-height: 1.75; color: var(--ink-soft); max-width: 56ch; margin-bottom: 1.5rem; }

.status-row { margin-bottom: 1.1rem; }
.status-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--good);
  background: var(--good-dim); border: 1px solid var(--signal-line);
  padding: 0.4rem 0.85rem; border-radius: var(--radius-sm);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex-shrink: 0; }

.focus-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.focus-tags::before {
  content: 'training on:';
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint);
  display: flex; align-items: center; margin-right: 0.15rem;
}
.focus-tags span {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--info);
  background: var(--info-dim); border: 1px solid var(--info-line);
  padding: 0.3rem 0.7rem; border-radius: var(--radius-sm);
}

.interests-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 2rem; }
.interests-row::before {
  content: 'also into:';
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint);
  display: flex; align-items: center; margin-right: 0.15rem;
}
.interests-row span {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-faint);
  border: 1px solid var(--line); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm);
}

.hero-actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 0.88rem; font-weight: 500;
  text-decoration: none; padding: 0.8rem 1.3rem; border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
  cursor: pointer;
}
.btn-primary:hover { background: var(--signal); border-color: var(--signal); transform: translateY(-2px); }

.btn-text { font-family: var(--font-mono); font-size: 0.88rem; color: var(--ink-soft); text-decoration: none; transition: color 0.2s var(--ease); background: none; border: none; cursor: pointer; }
.btn-text:hover { color: var(--signal); }

/* --- Hero figure --- */
.hero-figure { position: relative; }
.growth-svg { width: 100%; height: auto; overflow: visible; }
.axis-line { stroke: var(--line-strong); stroke-width: 1.5; }
.axis-arrow { fill: var(--line-strong); }
.curve-path { fill: none; stroke: var(--signal); stroke-width: 2.75; stroke-linecap: round; stroke-linejoin: round; }
.curve-dot { fill: var(--paper); stroke: var(--signal); stroke-width: 2.5; }
.curve-dot--now { fill: var(--signal); }

.fig-caption { display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.5rem; font-family: var(--font-mono); }
.fig-label { font-size: 0.82rem; color: var(--ink); font-weight: 500; }
.fig-note { font-size: 0.75rem; color: var(--ink-faint); }

.fig-milestones { display: flex; justify-content: space-between; margin-top: 0.6rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); gap: 0.4rem; }
.fig-milestones span { max-width: 25%; text-align: center; }
.fig-milestones span:first-child { text-align: left; }
.fig-milestones span:last-child { text-align: right; color: var(--signal); }

/* ==========================================================================
 *   KEY METRICS / STATS STRIP
 *   ========================================================================== */
.spec-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.spec-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 1.6rem 2.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 1.5rem;
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: var(--ink); }
.stat-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }

/* ==========================================================================
 *   SECTIONS (general)
 *   ========================================================================== */
.section { padding: 6rem 0; }
.section--tint { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ==========================================================================
 *   SKILLS
 *   ========================================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.6rem; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.skill-card:hover { border-color: var(--signal-line); }
.skill-card h3 { font-family: var(--font-mono); font-size: 0.92rem; color: var(--ink); margin-bottom: 1.1rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill { font-family: var(--font-mono); font-size: 0.88rem; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); }

/* ==========================================================================
 *   PROJECTS
 *   ========================================================================== */
/* ==========================================================================
   PROJECTS — CENTER-FOCUSED SHOWCASE CAROUSEL
   ========================================================================== */

.projects-carousel {
  position: relative;
  width: 100%;
  overflow: visible;
  padding: 1.5rem 0 0.5rem;
}

.projects-stage {
  position: relative;
  width: 100%;
  min-height: 720px;

  display: flex;
  align-items: center;
  justify-content: center;
}


/* --------------------------------------------------------------------------
   Base project card
   -------------------------------------------------------------------------- */

.project-card {
  position: absolute;
  top: 50%;
  left: 50%;

  width: min(1120px, 82vw);

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: var(--radius-md);

  padding: 1.5rem;

  opacity: 0;
  pointer-events: none;

  transform:
    translate(-50%, -50%)
    scale(0.72);

  transition:
    transform 0.6s var(--ease),
    opacity 0.5s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);

  will-change: transform, opacity;

  overflow: hidden;
}


/* --------------------------------------------------------------------------
   ACTIVE PROJECT
   -------------------------------------------------------------------------- */

.project-card.is-active {
  opacity: 1;
  pointer-events: auto;

  transform:
    translate(-50%, -50%)
    scale(1);

  z-index: 5;

  border-color: var(--signal-line);
}


/* --------------------------------------------------------------------------
   SIDE PROJECTS
   -------------------------------------------------------------------------- */

.project-card.is-prev,
.project-card.is-next {
  width: min(380px, 30vw);

  opacity: 0.35;
  pointer-events: auto;
  cursor: pointer;

  z-index: 3;

  padding: 0.9rem;
}

.project-card.is-prev {
  transform:
    translate(calc(-50% - 72%), -50%)
    scale(0.72);
}

.project-card.is-next {
  transform:
    translate(calc(-50% + 72%), -50%)
    scale(0.72);
}

.project-card.is-prev:hover,
.project-card.is-next:hover {
  opacity: 0.55;
}


/* --------------------------------------------------------------------------
   Hidden cards
   -------------------------------------------------------------------------- */

.project-card.is-hidden {
  opacity: 0;
  pointer-events: none;

  transform:
    translate(-50%, -50%)
    scale(0.6);

  z-index: 1;
}


/* ==========================================================================
   ACTIVE PROJECT CONTENT
   ========================================================================== */

.project-card.is-active {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(380px, 46%);

  gap: 2rem;

  align-items: center;
}


/* --------------------------------------------------------------------------
   Left information column
   -------------------------------------------------------------------------- */

.project-card.is-active .project-content {
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


/* --------------------------------------------------------------------------
   Right image
   -------------------------------------------------------------------------- */

.project-card.is-active .project-visual {
  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  border-radius: 12px;
  border: 1px solid var(--line);

  background: var(--paper);
}

.project-card.is-active .project-visual img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.6s var(--ease);
}

.project-card.is-active:hover .project-visual img {
  transform: scale(1.025);
}


/* ==========================================================================
   SIDE CARD CONTENT
   ========================================================================== */

/*
 * Side cards intentionally show much less information.
 * They're previews, not competing project descriptions.
 */

.project-card.is-prev .project-content,
.project-card.is-next .project-content {
  display: none;
}

.project-card.is-prev .project-visual,
.project-card.is-next .project-visual {
  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  border-radius: 10px;
  border: 1px solid var(--line);

  background: var(--paper);
}

.project-card.is-prev .project-visual img,
.project-card.is-next .project-visual img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.project-card.is-prev .project-preview-title,
.project-card.is-next .project-preview-title {
  display: block;

  margin-top: 0.65rem;

  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;

  color: var(--ink);
}


/* ==========================================================================
   STATUS
   ========================================================================== */

.project-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;

  text-transform: uppercase;
  letter-spacing: 0.05em;

  color: var(--good);
  background: var(--good-dim);

  border: 1px solid var(--signal-line);

  padding: 0.2rem 0.55rem;

  border-radius: var(--radius-sm);

  display: inline-block;

  margin-bottom: 0.85rem;

  width: fit-content;
}


/* ==========================================================================
   HEADINGS
   ========================================================================== */

.project-head h3 {
  font-family: var(--font-display);
  font-weight: 600;

  font-size: clamp(1.45rem, 2vw, 1.9rem);

  line-height: 1.2;

  color: var(--ink);

  margin-bottom: 0.45rem;
}

.project-tagline {
  font-size: 1rem;

  color: var(--signal);

  font-weight: 500;

  line-height: 1.45;

  margin-bottom: 1.1rem;
}

.project-desc {
  font-size: 0.98rem;

  line-height: 1.65;

  color: var(--ink-soft);

  margin-bottom: 1.25rem;
}


/* ==========================================================================
   TECH
   ========================================================================== */

.tech-row {
  display: flex;
  flex-wrap: wrap;

  gap: 0.4rem;

  margin-bottom: 1.2rem;
}

.tech-tag {
  font-family: var(--font-mono);

  font-size: 0.76rem;

  color: var(--info);
  background: var(--info-dim);

  border: 1px solid var(--info-line);

  padding: 0.3rem 0.65rem;

  border-radius: var(--radius-sm);
}


/* ==========================================================================
   METRICS
   ========================================================================== */

.results-table {
  border-top: 1px solid var(--line);

  padding-top: 0.85rem;

  margin-bottom: 1.15rem;

  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(150px, 1fr));

  gap: 0.7rem 1.5rem;
}

.results-row {
  display: flex;
  flex-direction: column;

  gap: 0.15rem;

  font-size: 0.85rem;
}

.r-label {
  font-family: var(--font-mono);

  color: var(--ink-faint);

  text-transform: uppercase;

  font-size: 0.65rem;

  letter-spacing: 0.04em;
}

.r-value {
  font-family: var(--font-mono);

  color: var(--ink);

  font-weight: 600;

  font-size: 0.95rem;
}


/* ==========================================================================
   LINKS
   ========================================================================== */

.project-links {
  display: flex;

  align-items: center;

  gap: 1.5rem;

  margin-top: auto;

  flex-wrap: wrap;
}

.project-link {
  font-family: var(--font-mono);

  font-size: 0.85rem;

  color: var(--ink);

  text-decoration: none;

  transition:
    color 0.2s var(--ease);
}

.project-link:hover {
  color: var(--signal);
}


/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.projects-nav {
  position: absolute;

  top: 50%;

  transform: translateY(-50%);

  z-index: 20;

  width: 46px;
  height: 46px;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid var(--line-strong);

  border-radius: 50%;

  background: var(--surface);

  color: var(--ink);

  font-family: var(--font-mono);

  font-size: 1.15rem;

  cursor: pointer;

  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.projects-nav:hover {
  border-color: var(--signal);

  color: var(--signal);

  transform:
    translateY(-50%)
    scale(1.08);
}

.projects-nav--prev {
  left: 0.75rem;
}

.projects-nav--next {
  right: 0.75rem;
}


/* ==========================================================================
   PAGINATION
   ========================================================================== */

.projects-pagination {
  display: flex;

  justify-content: center;

  margin-top: 0.65rem;

  font-family: var(--font-mono);

  font-size: 0.78rem;

  color: var(--ink-faint);
}


/* ==========================================================================
   CASE STUDY
   ========================================================================== */

.case-study {
  margin-bottom: 1.25rem;
}

.case-toggle {
  font-family: var(--font-mono);

  font-size: 0.85rem;

  color: var(--ink);

  background: var(--paper);

  border: 1px solid var(--line-strong);

  border-radius: var(--radius-sm);

  padding: 0.5rem 0.9rem;

  cursor: pointer;

  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.case-toggle:hover {
  border-color: var(--signal);

  color: var(--signal);
}

.case-body {
  margin-top: 1.25rem;

  padding-top: 1.25rem;

  border-top: 1px dashed var(--line);

  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(min(260px, 100%), 1fr));

  gap: 1.5rem 2rem;
}

.case-section h4 {
  font-family: var(--font-mono);

  font-size: 0.72rem;

  text-transform: uppercase;

  letter-spacing: 0.06em;

  color: var(--signal);

  margin-bottom: 0.5rem;
}

.case-section p,
.case-section ul {
  font-size: 0.9rem;

  color: var(--ink-soft);
}

.case-section ul {
  margin-left: 1.1rem;
}

.case-section li {
  margin-bottom: 0.35rem;
}

.case-section .mono-block {
  font-family: var(--font-mono);

  font-size: 0.78rem;

  line-height: 1.8;

  color: var(--ink-soft);

  background: var(--paper);

  border: 1px solid var(--line);

  border-radius: var(--radius-sm);

  padding: 0.9rem 1rem;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1050px) {

  .project-card {
    width: min(900px, 82vw);
  }

  .project-card.is-active {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(320px, 44%);

    gap: 1.5rem;
  }

  .project-card.is-prev {
    transform:
      translate(calc(-50% - 78%), -50%)
      scale(0.68);
  }

  .project-card.is-next {
    transform:
      translate(calc(-50% + 78%), -50%)
      scale(0.68);
  }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 720px) {

  .projects-stage {
    min-height: 720px;
  }

  .project-card {
    width: calc(100% - 3.5rem);

    padding: 1.1rem;
  }

  .project-card.is-active {
    display: flex;

    flex-direction: column;

    gap: 1.15rem;
  }

  .project-card.is-active .project-content {
    order: 2;
  }

  .project-card.is-active .project-visual {
    order: 1;

    width: 100%;

    aspect-ratio: 4 / 3;
  }

  /*
   * Side projects become narrow previews.
   */

  .project-card.is-prev,
  .project-card.is-next {
    width: 170px;

    padding: 0.65rem;

    opacity: 0.28;
  }

  .project-card.is-prev {
    transform:
      translate(calc(-50% - 92%), -50%)
      scale(0.68);
  }

  .project-card.is-next {
    transform:
      translate(calc(-50% + 92%), -50%)
      scale(0.68);
  }

  .project-card.is-prev .project-preview-title,
  .project-card.is-next .project-preview-title {
    font-size: 0.78rem;
  }

  .project-card.is-active .project-head h3 {
    font-size: 1.4rem;
  }

  .project-card.is-active .project-desc {
    font-size: 0.9rem;
  }

  .projects-nav {
    width: 40px;
    height: 40px;

    font-size: 1rem;
  }

  .projects-nav--prev {
    left: 0;
  }

  .projects-nav--next {
    right: 0;
  }

}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 480px) {

  .projects-stage {
    min-height: 700px;
  }

  .project-card {
    width: calc(100% - 2.75rem);

    padding: 0.95rem;
  }

  .project-card.is-prev,
  .project-card.is-next {
    width: 135px;
  }

  .project-card.is-prev {
    transform:
      translate(calc(-50% - 105%), -50%)
      scale(0.62);
  }

  .project-card.is-next {
    transform:
      translate(calc(-50% + 105%), -50%)
      scale(0.62);
  }

}

/* ==========================================================================
 *   EXPERIENCE / EDUCATION (log cards)
 *   ========================================================================== */
.log-list { display: flex; flex-direction: column; gap: 1.5rem; }
.log-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.75rem 2rem; transition: border-color 0.2s var(--ease); }
.log-card:hover { border-color: var(--line-strong); }
.log-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.85rem; }
.log-role { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.log-org { font-size: 0.92rem; color: var(--signal); font-weight: 500; }
.log-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); white-space: nowrap; }
.log-bullets { margin-left: 1.1rem; font-size: 1.02rem; color: var(--ink-soft); margin-bottom: 0.75rem; }
.log-bullets li { margin-bottom: 0.4rem; }
.log-desc { font-size: 1.02rem; color: var(--ink-soft); margin-bottom: 0.75rem; }
.log-achievements {
  margin-left: 1.1rem; font-size: 0.9rem; color: var(--good); margin-top: 0.5rem;
}
.log-achievements li { margin-bottom: 0.3rem; }
.log-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }

/* ==========================================================================
 *   CERTIFICATIONS
 *   ========================================================================== */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; }
.cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.cert-content {
  padding: 1.5rem 1.6rem;
}
.cert-card:hover { border-color: var(--signal-line); }
.cert-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.2rem; }
.cert-issuer { font-family: var(--font-mono); font-size: 0.78rem; color: var(--signal); margin-bottom: 0.9rem; }
.cert-skills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cert-skills span { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-faint); border: 1px solid var(--line); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); }
.cert-image {
  width: 100%;
  overflow: hidden;
}
.cert-image img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: white;
  display: block;
}

/* ==========================================================================
 *   ACHIEVEMENTS
 *   ========================================================================== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.75rem;
  align-items: stretch;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  height: 100%;

  gap: 1.35rem;

  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;

  overflow: hidden;
}

.achievement-content {
  display: flex;
  gap: 1.1rem;
}

.achievement-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--signal-dim);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.achievement-body {
  min-width: 0;
}

.achievement-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.achievement-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-left: 0.5rem;
}

.achievement-desc {
  font-size: 0.98rem;
  color: var(--ink-soft);
}


/* ==========================================================
   ACHIEVEMENT EVIDENCE / IMAGE
   ========================================================== */

/* ==========================================================
   ACHIEVEMENT EVIDENCE / IMAGE
   ========================================================== */

.achievement-media {
  margin-top: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 240px;

  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-md) - 2px);

  overflow: hidden;
  background: var(--paper);

  cursor: pointer;
  font: inherit;
  text-align: left;
}

.achievement-media img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  transition:
    transform 0.4s var(--ease),
    filter 0.4s var(--ease);
}

.achievement-media-label {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;

  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  padding: 0.35rem 0.65rem;

  background: rgba(0, 0, 0, 0.68);
  color: #fff;

  border-radius: var(--radius-sm);

  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  opacity: 0;
  transform: translateY(4px);

  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.achievement-media:hover img {
  transform: scale(1.025);
}

.achievement-media:hover .achievement-media-label,
.achievement-media:focus-visible .achievement-media-label {
  opacity: 1;
  transform: translateY(0);
}

.achievement-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;

  background: rgba(0, 0, 0, 0.82);

  opacity: 0;
  transition: opacity 0.25s var(--ease);

  cursor: zoom-out;
}

.achievement-viewer.is-visible {
  opacity: 1;
}

.achievement-viewer img {
  display: block;
  max-width: min(100%, 1100px);
  max-height: 90vh;
  object-fit: contain;

  border-radius: var(--radius-md);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  cursor: default;
}

.achievement-viewer-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;

  width: 42px;
  height: 42px;

  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;

  background: rgba(0,0,0,0.35);
  color: #fff;

  cursor: pointer;
  font-size: 1rem;
}

/* ==========================================================================
   MILESTONES — ENGINEERING JOURNEY
   ========================================================================== */

.milestone-carousel {
  position: relative;
  width: 100%;
  padding: 1rem 0 0.5rem;
}


/* ==========================================================================
   MILESTONE RAIL
   ========================================================================== */

.milestone-rail {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;

  padding: 2rem 1rem 1.5rem;

  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.milestone-rail::-webkit-scrollbar {
  height: 5px;
}

.milestone-rail::-webkit-scrollbar-track {
  background: transparent;
}

.milestone-rail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}


/* ==========================================================================
   TIMELINE LINE
   ========================================================================== */

.milestone-line {
  position: absolute;

  top: calc(2rem + 10px);
  left: 1rem;

  height: 2px;
  width: calc(100% - 2rem);

  min-width: calc(760px - 2rem);

  background: var(--line);
}


/* ==========================================================================
   NODES
   ========================================================================== */

.milestone-nodes {
  position: relative;

  display: flex;

  justify-content: space-between;

  min-width: 760px;

  gap: 1rem;
}

.milestone-node {
  position: relative;

  flex: 1;
  min-width: 90px;

  display: flex;
  flex-direction: column;
  align-items: center;

  background: none;
  border: none;

  color: var(--ink-faint);

  cursor: pointer;

  padding: 0;

  font-family: inherit;

  transition:
    color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.milestone-node:hover {
  color: var(--ink);
  transform: translateY(-2px);
}


/* ==========================================================================
   NODE DOT
   ========================================================================== */

.milestone-node-dot {
  position: relative;

  z-index: 2;

  width: 20px;
  height: 20px;

  margin-bottom: 0.75rem;

  border-radius: 50%;

  background: var(--paper);

  border: 2px solid var(--line-strong);

  box-shadow: 0 0 0 4px var(--paper);

  transition:
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.milestone-node:hover .milestone-node-dot {
  border-color: var(--signal);
  transform: scale(1.15);
}

.milestone-node.is-active {
  color: var(--ink);
}

.milestone-node.is-active .milestone-node-dot {
  background: var(--signal);
  border-color: var(--signal);

  box-shadow: 0 0 0 4px var(--paper);

  transform: scale(1.06);
}


/* ==========================================================================
   NODE LABELS
   ========================================================================== */

.milestone-node-date {
  font-family: var(--font-mono);

  font-size: 0.68rem;
  font-weight: 500;

  color: var(--ink-faint);

  margin-bottom: 0.25rem;

  white-space: nowrap;
}

.milestone-node.is-active .milestone-node-date {
  color: var(--signal);
}

.milestone-node-title {
  font-family: var(--font-display);

  font-size: 0.82rem;
  font-weight: 600;

  line-height: 1.25;

  text-align: center;

  max-width: 130px;

  color: inherit;
}


/* ==========================================================================
   DETAIL CARD
   ========================================================================== */

.milestone-detail {
  width: min(760px, 100%);

  margin: 1.25rem auto 0;

  padding: 1.5rem 1.7rem;

  background: var(--surface);


  border: 1px solid var(--line);

  border-radius: var(--radius-md);

  transition:
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.milestone-detail.is-changing {
  opacity: 0;
  transform: translateY(5px);
}

.milestone-detail:hover {
  border-color: var(--signal-line);
}


/* ==========================================================================
   DETAIL CONTENT
   ========================================================================== */

.milestone-detail-meta {
  display: flex;

  align-items: center;

  gap: 0.7rem;

  flex-wrap: wrap;

  margin-bottom: 0.65rem;
}

.milestone-detail-date {
  font-family: var(--font-mono);

  font-size: 0.72rem;

  color: var(--signal);

  text-transform: uppercase;

  letter-spacing: 0.05em;
}

.milestone-detail-type {
  font-family: var(--font-mono);

  font-size: 0.68rem;

  color: var(--info);

  background: var(--info-dim);

  border: 1px solid var(--info-line);

  padding: 0.2rem 0.55rem;

  border-radius: var(--radius-sm);

  text-transform: uppercase;

  letter-spacing: 0.04em;
}

.milestone-detail h3 {
  font-family: var(--font-display);

  font-size: clamp(1.3rem, 2.2vw, 1.7rem);

  font-weight: 600;

  line-height: 1.25;

  color: var(--ink);

  margin-bottom: 0.55rem;
}

.milestone-detail p {
  font-size: 0.95rem;

  line-height: 1.65;

  color: var(--ink-soft);

  max-width: 70ch;
}


/* ==========================================================================
   CONTROLS
   ========================================================================== */

.milestone-controls {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 1rem;

  margin-top: 1rem;
}

.milestone-nav {
  width: 38px;
  height: 38px;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid var(--line-strong);

  border-radius: 50%;

  background: var(--surface);

  color: var(--ink);

  font-family: var(--font-mono);

  font-size: 1rem;

  cursor: pointer;

  transition:
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    background-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.milestone-nav:hover:not(:disabled) {
  border-color: var(--signal);

  color: var(--signal);

  transform: scale(1.08);
}

.milestone-nav:disabled {
  opacity: 0.3;

  cursor: default;
}

.milestone-counter {
  min-width: 70px;

  text-align: center;

  font-family: var(--font-mono);

  font-size: 0.72rem;

  color: var(--ink-faint);

  letter-spacing: 0.04em;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 900px) {

  .milestone-nodes {
    min-width: 700px;
  }

  .milestone-detail {
    width: min(680px, 100%);
  }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 720px) {

  .milestone-carousel {
    padding-top: 0.5rem;
  }

  .milestone-rail {
    padding:
      1.5rem 0.75rem 1.25rem;
  }

  .milestone-line {
    top: calc(1.5rem + 10px);
    left: 0.75rem;

    width: calc(680px - 0.75rem);
    min-width: 0;

    right: auto;
  }

  .milestone-nodes {
    min-width: 680px;

    justify-content: flex-start;

    gap: 1.25rem;
  }

  .milestone-node {
    flex: 0 0 90px;
  }

  .milestone-node-title {
    font-size: 0.76rem;
  }

  .milestone-detail {
    padding: 1.25rem;

    margin-top: 1rem;
  }

  .milestone-detail h3 {
    font-size: 1.25rem;
  }

  .milestone-detail p {
    font-size: 0.9rem;
  }

}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

  .milestone-node,
  .milestone-node-dot,
  .milestone-detail,
  .milestone-nav {
    transition: none;
  }

}

/* ==========================================================================
 *   FOOTER / CONTACT
 *   ========================================================================== */
.footer { background: var(--footer-bg); color: var(--footer-text); padding: 5rem 0 0; }
.footer .eyebrow { color: var(--signal); }
.footer .section-title { color: var(--footer-text); margin-bottom: 1rem; }
.footer-sub { color: var(--footer-muted); font-size: 1rem; margin-bottom: 2rem; max-width: 40ch; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding-bottom: 4rem; }

.bibtex-card { background: var(--footer-input-bg); border: 1px solid var(--footer-border); border-radius: var(--radius-md); padding: 1.25rem 1.4rem; margin-bottom: 1.75rem; }
.bibtex-text { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.6; color: var(--footer-text); opacity: 0.85; white-space: pre-wrap; margin-bottom: 0.9rem; }
.btn-text--inverse { color: var(--footer-muted); }
.btn-text--inverse:hover { color: var(--signal); }

.contact-details { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--footer-muted); }
.contact-details a { text-decoration: none; color: inherit; transition: color 0.2s var(--ease); }
.contact-details a:hover { color: var(--signal); }

.social-links { display: flex; gap: 1.25rem; }
.social-links a { color: var(--footer-muted); font-size: 1.25rem; transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.social-links a:hover { color: var(--signal); transform: translateY(-2px); }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--footer-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group textarea {
  background: var(--footer-input-bg); border: 1px solid var(--footer-input-border); border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem; color: var(--footer-text); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.2s var(--ease); resize: vertical;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--footer-muted); opacity: 0.55; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--signal); }

.btn-submit { justify-content: center; background: var(--signal); border-color: var(--signal); color: var(--on-signal); font-weight: 600; }
.btn-submit:hover { background: var(--footer-text); border-color: var(--footer-text); color: var(--footer-bg); }
.btn-submit:disabled { opacity: 0.7; cursor: default; transform: none !important; }

.form-note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--footer-muted); text-align: center; margin-top: -0.3rem; }

.footer-bottom { border-top: 1px solid var(--footer-border); padding: 1.5rem 2.5rem; text-align: center; font-family: var(--font-mono); font-size: 0.78rem; color: var(--footer-muted); }

/* ==========================================================================
 *   SCROLL REVEAL
 *   ========================================================================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
 *   RESPONSIVE
 *   ========================================================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; width: 100%; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease);
  }
  .main-nav.is-open { max-height: 420px; overflow-y: auto; }
  .main-nav a { padding: 1rem 1.75rem; border-top: 1px solid var(--line); }
  .main-nav a.nav-cta { border-radius: 0; border-left: none; border-right: none; }
  .commit { flex-direction: column; gap: 0.25rem; }
  .fig-milestones span { max-width: none; }

  /* Tighter side padding so content isn't squeezed on phones */
  .section-inner, .header-inner, .hero, .spec-inner { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero { padding-top: 8rem; padding-bottom: 3rem; }
  .footer-bottom { padding-left: 1.25rem; padding-right: 1.25rem; }

  .section { padding: 4rem 0; }

  .hero-name { word-break: break-word; }
  .hero-actions { gap: 1rem; }

  /* Shorter, better-proportioned thumbnails once cards go full-width */
  .project-image img { height: 210px; }

  .log-card, .cert-card, .skill-card { padding: 1.4rem 1.5rem; }
}

@media (max-width: 480px) {
  .status-badge { font-size: 0.76rem; padding: 0.35rem 0.7rem; }
  .focus-tags::before, .interests-row::before { display: none; }
  .fig-caption { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .log-date { white-space: normal; }
}

/* ==========================================================================
 *   REDUCED MOTION
 *   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}