:root {
  --bg: #E0DDCF;
  --card: #FFFFFF;
  --card-hover: #F1EFE6;
  --text: #2D232E;
  --muted: #474448;
  --border: rgba(45, 35, 46, 0.08);
  --accent-line: rgba(45, 35, 46, 0.3);
  --scroll: rgba(45, 35, 46, 0.2);
  --board-dot: rgba(45, 35, 46, 0.05);
}

[data-theme="dark"] {
  --bg: #15121A;
  --card: #2D232E;
  --card-hover: #3A2F3B;
  --text: #FFFFFF;
  --muted: #E0DDCF;
  --border: rgba(224, 221, 207, 0.1);
  --accent-line: rgba(224, 221, 207, 0.35);
  --scroll: rgba(224, 221, 207, 0.2);
  --board-dot: rgba(224, 221, 207, 0.045);
}

html { scroll-behavior: smooth; }
body { transition: background 0.3s ease, color 0.3s ease; }

/* Mobile section nav (hidden on desktop) */
.mobile-nav { display: none; }
.card, .cta { transition: background 0.3s ease, border-color 0.3s ease; }

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

body {
  background:
    radial-gradient(var(--board-dot) 1px, transparent 1.6px) 0 0 / 18px 18px,
    var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px;
}

/* Topbar */
.topbar {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1.4);
  transform-origin: 50% 30%;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.theme-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover { transform: scale(1.05); }

.theme-icon { line-height: 1; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }

.subcopy {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 40em;
}

.subcopy-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  margin: 0 0.45em;
}

/* Grid */
.grid {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 1.25fr);
  grid-auto-rows: minmax(140px, auto);
  gap: 16px;
  grid-template-areas:
    "experience experience midstack  projects"
    "skills     skills      midstack  projects"
    "recently   recently    education contact";
}

.card-experience { grid-area: experience; }
.midstack        { grid-area: midstack; display: flex; flex-direction: column; gap: 16px; }
.card-skills     { grid-area: skills; }
.card-recently   { grid-area: recently; }
.card-projects   { grid-area: projects; }
.card-education  { grid-area: education; }
.card-contact    { grid-area: contact; }

.midstack .card-clock { flex: 0 0 auto; }
.midstack .card-currently { flex: 1; }

/* Card base */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.7;
}

.head-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.45;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.head-link:hover { opacity: 0.9; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22C55E;
  position: relative;
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse-ring 2.4s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Experience */
.exp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  transition: -webkit-mask-image 0.2s ease, mask-image 0.2s ease;
}

.exp-list.at-bottom,
.exp-list.no-scroll {
  -webkit-mask-image: none;
  mask-image: none;
}

.exp-list::-webkit-scrollbar { width: 6px; }
.exp-list::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 3px;
}

.exp-role {
  font-size: 1.05rem;
  font-weight: 500;
}

.exp-sep {
  color: var(--muted);
  opacity: 0.5;
  margin: 0 4px;
  font-weight: 400;
}

.exp-company {
  color: var(--muted);
  font-weight: 400;
}

.exp-desc {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
  max-width: 38em;
}

/* Currently */
.currently-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-between;
}

.currently-list li { font-size: 1.05rem; }

.accent {
  font-weight: 400;
}

/* Digital sliding clock */
.clock-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.digital-clock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
}

.clock-group {
  display: flex;
  gap: 2px;
}

.clock-colon {
  font-size: 2.6rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.4;
  line-height: 1;
  padding-bottom: 6px;
}

.digit-reel {
  width: 0.7em;
  height: 1em;
  overflow: hidden;
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 1;
}

.digit-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.digit-strip span {
  height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.clock-meridian {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  align-self: flex-start;
  margin-top: 0.5em;
  margin-left: 4px;
}

.weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.weather-icon { display: inline-flex; align-items: center; line-height: 1; }
.weather-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.weather-icon.sunny { color: #F5B731; }
.weather-icon.cool { color: #3B82F6; }

.card-clock .date {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Recently */
.recently-grid {
  display: flex;
  gap: 10px;
  flex: 1;
  align-items: stretch;
}

.recently-item {
  flex: 1;
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
  background-image: var(--img);
  background-size: cover;
  background-position: center;
  min-height: 90px;
  transition: filter 0.3s ease;
  filter: grayscale(0.15);
}

.recently-item:hover { filter: grayscale(0); }

.recently-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.recently-item:hover .recently-expand,
.recently-item:focus-visible .recently-expand {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox carousel */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  background: rgba(21, 18, 26, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox.open { display: flex; }

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(900px, 80vw);
}

.lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.lightbox-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

.lightbox-nav {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.05); }

/* Skills */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.pill {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #2D232E;
  transition: transform 0.2s ease;
}

.pill:hover { transform: translateY(-3px); }

.p1 { background: #F2A7A0; }
.p2 { background: #F6C896; }
.p3 { background: #F5E3A1; }
.p4 { background: #C2E8C4; }
.p5 { background: #BEE9E2; }
.p6 { background: #B7D2F1; }
.p7 { background: #D9CAF3; }

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
  transition: -webkit-mask-image 0.2s ease, mask-image 0.2s ease;
}

.projects.at-bottom,
.projects.no-scroll {
  -webkit-mask-image: none;
  mask-image: none;
}

.projects::-webkit-scrollbar { width: 6px; }
.projects::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 3px;
}

.project-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  padding: 14px 12px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.project-row:hover { background: var(--card-hover); }

.project-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFFFFF;
}

.logo1 { background: #D88C7A; }
.logo2 { background: #8FB0A9; }
.logo3 { background: #A89BC9; }
.logo4 { background: #C9A88F; }

.logo-img { background: transparent; padding: 0; overflow: hidden; }
.logo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.project-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-name {
  font-size: 1.02rem;
  font-weight: 600;
}

.project-year {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.6;
  white-space: nowrap;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.card-arrow {
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-row:hover .card-arrow,
.cta:hover .card-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Education */
.edu-school { font-size: 1.05rem; font-weight: 400; }
.edu-degree { font-size: 0.92rem; color: var(--muted); margin-top: 6px; }
.edu-focus  { font-size: 0.85rem; color: var(--muted); opacity: 0.7; margin-top: 6px; }

/* Contact CTAs */
.cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  margin-bottom: 10px;
  transition: background 0.2s ease;
}

.cta:hover { background: var(--card-hover); }

/* Footer */
.footer {
  max-width: 1400px;
  width: 100%;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.footer-dim {
  opacity: 0.4;
}

.footer-name {
  font-weight: 600;
  color: var(--text);
}

/* Project page */
.back-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--text);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.back-link:hover { opacity: 1; }

.project {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.project-intro { margin-bottom: 40px; }

.project-title {
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 14px;
}

.project-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 14px;
}

.project-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.project-meta li { display: flex; flex-direction: column; gap: 4px; }

.meta-key {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.7;
}

.meta-val { font-size: 0.95rem; font-weight: 500; }

.project-hero {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 56px;
}

.project-hero img { width: 100%; display: block; }

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

.section-lead {
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.4;
  margin-top: 16px;
}

.section-body {
  font-size: 1.02rem;
  color: var(--muted);
  margin-top: 16px;
}

.section-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-list li {
  position: relative;
  padding-left: 20px;
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.5;
}

.section-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-line);
}

.section-list li strong {
  color: var(--text);
  font-weight: 500;
}

/* Bulleted list inside a process step */
.step-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.step-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-line);
}

.step-list li strong { color: var(--text); font-weight: 500; }

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.process-steps.cols-2 { grid-template-columns: 1fr 1fr; }

.process-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

.step-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
}

.step-title { font-size: 1.05rem; font-weight: 600; margin-top: 10px; }

.step-desc { font-size: 0.92rem; color: var(--muted); margin-top: 8px; }

.project-figure { margin-top: 32px; }

.project-figure img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.figure-caption {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 10px;
}

.figure-caption a,
.section-body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Responsive Figma embed (zoom + pan inside the iframe) */
.project-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}

.project-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Taller embed when one frame shows all the mockups */
.project-embed-tall { aspect-ratio: 4 / 3; }

/* Image carousel */
.carousel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  outline: none;
}

.carousel-viewport { overflow: hidden; }

.carousel-track {
  display: flex;
  transition: transform 0.45s ease;
}

.carousel-slide { min-width: 100%; }

.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #f4f4f5;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-nav:hover { background: var(--card); }
.carousel-nav:disabled { opacity: 0.35; cursor: default; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.carousel-dot.active { background: #fff; }

/* Shipped Design — alternating feature rows (Option A) */
.shipped-rows {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 32px;
}

.shipped-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
}

.shipped-row:nth-child(even) .shipped-media { order: 2; }

.shipped-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.shipped-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
}

.shipped-desc {
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 10px;
}

.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.project-gallery img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.improvement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 24px;
}

.improvement-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.improvement-list li:last-child { border-bottom: 1px solid var(--border); }

.improvement-title { font-size: 1.05rem; font-weight: 600; }

.improvement-desc { font-size: 0.95rem; color: var(--muted); }

.improvement-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.improvement-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--muted);
}

.improvement-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "What I'm proud of" icon cards */
.proud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.proud-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.proud-card:hover {
  background: var(--card-hover);
  transform: translateY(-3px);
}

.proud-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-hover);
  color: var(--text);
}

.proud-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.proud-title { font-size: 1rem; font-weight: 600; }

.proud-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* Coloured icon chips — proud-grid (tinted background + saturated icon) */
.proud-card:nth-child(1) .proud-icon { background: #DBEAFE; color: #2563EB; }
.proud-card:nth-child(2) .proud-icon { background: #DCFCE7; color: #059669; }
.proud-card:nth-child(3) .proud-icon { background: #EDE9FE; color: #7C3AED; }
.proud-card:nth-child(4) .proud-icon { background: #FEF3C7; color: #D97706; }

/* Coloured post-launch icons (inline line icons) */
.improvement-list li:nth-child(1) .improvement-icon { color: #2563EB; }
.improvement-list li:nth-child(2) .improvement-icon { color: #DB2777; }
.improvement-list li:nth-child(3) .improvement-icon { color: #0D9488; }

/* Process flow diagram */
.process-flow { margin-top: 32px; }

.flow-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.flow-scroll::-webkit-scrollbar { display: none; }

.flow-svg {
  width: 100%;
  min-width: 620px;
  height: auto;
  display: block;
}

.flow-svg text { font-family: "Inter", sans-serif; }
.flow-node { fill: var(--card); stroke: var(--border); stroke-width: 1; }
.flow-node-label { fill: var(--text); font-size: 16px; font-weight: 600; }
.flow-arrow { stroke: var(--text); stroke-width: 1.6; fill: none; opacity: 0.55; }
.flow-arrowhead { fill: var(--text); opacity: 0.55; }
.flow-loop { stroke: var(--accent-line); stroke-width: 1.6; fill: none; stroke-dasharray: 5 6; }
.flow-loop-label { fill: var(--muted); font-size: 13px; font-style: italic; }
.flow-loophead { fill: var(--accent-line); }

/* "Understanding the space" bubble diagram */
.space-svg { width: 100%; min-width: 620px; height: auto; display: block; }
.space-svg text { font-family: "Inter", sans-serif; }
.space-line { stroke: var(--accent-line); stroke-width: 1.5; fill: none; }
.space-hub { fill: var(--text); }
.space-hub-label { fill: var(--bg); font-size: 20px; font-weight: 700; }
.space-bubble-label { fill: #2D232E; font-size: 14.5px; font-weight: 500; }

/* CRM lifecycle diagram */
.crm-container { fill: var(--card); stroke: var(--border); }
.crm-inner-label { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
.crm-stage-label { fill: #2D232E; font-size: 16px; font-weight: 600; }
.crm-hub-label { fill: var(--bg); font-size: 16px; font-weight: 700; }
.crm-chip-label { fill: #2D232E; font-size: 13px; font-weight: 500; }

.project-footer-nav {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.project-footer-nav .cta { flex: 1; margin-bottom: 0; }

@media (max-width: 700px) {
  .process-steps, .process-steps.cols-2 { grid-template-columns: 1fr; }
  .project-gallery { grid-template-columns: 1fr; }
  .proud-grid { grid-template-columns: 1fr 1fr; }
  .shipped-row { grid-template-columns: 1fr; gap: 16px; }
  .shipped-row:nth-child(even) .shipped-media { order: 0; }
  .project-title { font-size: 2rem; }
  .project-footer-nav { flex-direction: column; }
}

/* Smaller desktop: shrink the clock so it doesn't overflow the narrow grid column
   (only while the 4-column desktop grid is active, i.e. above the 900px breakpoint) */
@media (min-width: 901px) and (max-width: 1340px) {
  .digit-reel { font-size: 2.4rem; }
  .clock-colon { font-size: 1.9rem; }
  .clock-meridian { font-size: 0.85rem; }
}

@media (min-width: 901px) and (max-width: 1150px) {
  .digit-reel { font-size: 1.9rem; }
  .clock-colon { font-size: 1.5rem; }
  .clock-meridian { font-size: 0.8rem; }
}

@media (min-width: 901px) and (max-width: 1000px) {
  .digit-reel { font-size: 1.5rem; }
  .clock-colon { font-size: 1.2rem; }
  .clock-meridian { font-size: 0.72rem; }
}

/* Responsive */
@media (max-width: 900px) {
  body { padding: 20px; }

  .mobile-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -20px -20px 16px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav-links {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
  .mobile-nav-links::-webkit-scrollbar { display: none; }

  .mobile-nav-links a {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
  }
  .mobile-nav-links a:hover { color: var(--text); }
  .mobile-nav-links a.active {
    color: var(--text);
    background: var(--card);
  }

  .card-experience, .card-skills, .card-recently, .card-projects,
  .card-education, .card-contact { scroll-margin-top: 74px; }

  .grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "experience experience"
      "midstack   midstack"
      "skills     skills"
      "recently   recently"
      "education   contact"
      "projects   projects";
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "experience"
      "projects"
      "skills"
      "education"
      "clock"
      "currently"
      "recently"
      "contact";
  }
  .midstack { display: contents; }
  .card-clock { grid-area: clock; }
  .card-currently { grid-area: currently; }
  .proud-grid { grid-template-columns: 1fr; }
}

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