:root {
  --bg: #fafcfd;
  --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: "Geist", ui-sans-serif, system-ui, 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-currently  { grid-area: education; }
.card-contact    { grid-area: contact; }

.midstack .card-clock { flex: 0 0 auto; }
.midstack .card-education { 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: "Geist Mono", ui-monospace, 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: "Geist Mono", ui-monospace, 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;
  flex: 1 1 auto;
  min-height: 0;
  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: "Geist Mono", ui-monospace, 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: "Geist Mono", ui-monospace, 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; }
.p8 { background: #F0B8D2; }

/* Projects */
.projects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  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: "Geist Mono", ui-monospace, 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: "Geist Mono", ui-monospace, 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;
}

/* Desktop side navigation (table of contents) — hidden until there's room */
.project-nav { display: none; }

@media (min-width: 1100px) {
  .project {
    display: grid;
    grid-template-columns: 188px minmax(0, 880px);
    column-gap: 52px;
    align-items: start;
    max-width: 1120px;
  }
  .project > section { grid-column: 2; }
  .project > section[id] { scroll-margin-top: 32px; }

  .project-nav {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 99;
    position: sticky;
    top: 32px;
    align-self: start;
  }

  .project-nav-title {
    display: block;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    opacity: 0.6;
    margin-bottom: 14px;
    padding-left: 16px;
  }

  .project-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
  }

  .project-nav a {
    display: block;
    padding: 7px 0 7px 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.35;
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  .project-nav a:hover { color: var(--text); }
  .project-nav a.active {
    color: var(--text);
    border-left-color: var(--text);
    font-weight: 500;
  }
}

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

.project-title {
  font-family: "Lora", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  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: "Geist Mono", ui-monospace, 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; }

/* Invoices page: square (no rounded corners) on every image. */
.project--flush .project-hero,
.project--flush .project-figure img,
.project--flush .shipped-media img { border-radius: 0; }

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

.section-lead {
  font-family: "Lora", Georgia, serif;
  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: "Geist Mono", ui-monospace, 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--italic { font-style: italic; }

.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%; position: relative; }

.carousel-caption {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #26262b;
  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;
}

/* Alternate the image to the right on even rows while keeping it the larger
   column, so the screenshot stays the same width down both sides. */
.shipped-row:nth-child(even) { grid-template-columns: 1fr 1.1fr; }
.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-media img.shipped-borderless { border: none; }

/* Tall portrait screenshots get cropped to a landscape frame (top-anchored) so
   their row height matches the other shipped screens. */
.shipped-media img.shipped-crop {
  aspect-ratio: 13 / 10;
  object-fit: cover;
  object-position: top center;
}

/* Shipped Design — full-width variant (CRM): each screenshot spans the full
   content column with its caption above, instead of the alternating
   two-column layout. Scoped to this modifier so Groups/Invoices are untouched. */
.shipped-rows--full .shipped-row {
  display: block;
}

.shipped-rows--full .shipped-row:nth-child(even) .shipped-media { order: initial; }

.shipped-rows--full .shipped-text {
  margin-bottom: 16px;
}

.shipped-rows--full .shipped-media img {
  border: none;
}

/* Low-fidelity wireframe sketches (inline SVG). Colours come from CSS classes
   using currentColor so the wireframes stay theme-aware (SVG presentation
   attributes can't read CSS variables). */
.lofi-svg { width: 100%; height: auto; display: block; color: var(--text); min-width: 640px; }
.lofi-frame { fill: var(--card); stroke: var(--accent-line); stroke-width: 1.5; }
.lofi-modal { fill: var(--card); stroke: currentColor; stroke-opacity: 0.4; stroke-width: 1.5; }
.lofi-bar { fill: currentColor; fill-opacity: 0.05; }
.lofi-block { fill: currentColor; fill-opacity: 0.10; }
.lofi-line { fill: currentColor; fill-opacity: 0.16; }
.lofi-dot { fill: currentColor; fill-opacity: 0.28; }
.lofi-ring { fill: none; stroke: currentColor; stroke-opacity: 0.18; stroke-width: 8; }
.lofi-accent { fill: none; stroke: currentColor; stroke-opacity: 0.45; stroke-dasharray: 5 4; stroke-width: 1.5; }
.lofi-cap {
  fill: currentColor;
  fill-opacity: 0.45;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.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;
}

/* Shipped Design — 2x2 feature grid: each card is a desktop screen with a
   mobile inset overlapping its bottom-right corner, plus title + caption. */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 28px;
  margin-top: 32px;
}

.feature-card {
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Right/bottom padding reserves a small overhang for the phone inset. */
.feature-shot {
  position: relative;
  padding: 0 18px 16px 0;
}

/* Desktop-only card: no phone inset, so the shot fills the cell evenly. */
.feature-card--solo .feature-shot { padding: 0; }

.feature-desktop {
  width: 100%;
  display: block;
  /* Crop every desktop shot to a consistent landscape frame, anchored to the
     top so the most important UI (summary cards, headers) always shows. */
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.feature-mobile {
  position: absolute;
  /* Hangs off the desktop frame's bottom-right corner for depth. */
  right: 0;
  bottom: 0;
  width: 26%;
  display: block;
  /* Tall phone captures get cropped to a believable phone shape, top-anchored
     so the inset reads as "the same screen, on mobile" rather than a sliver. */
  aspect-ratio: 9 / 17;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
  /* A page-coloured ring lifts the phone off the desktop shot. */
  border: 3px solid var(--bg);
  outline: 1px solid var(--border);
  background: var(--card);
}

.feature-cap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-title { font-size: 1.1rem; font-weight: 600; }

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

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

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

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

/* Jump straight to the Shipped Design section (lets recruiters skip the process write-up).
   Reuses the footer nav's .cta look for visual consistency. */
.skip-cta { margin-top: 20px; background: var(--card); }
[data-theme="dark"] .skip-cta { background: var(--bg); }
.skip-cta:hover .card-arrow { transform: translateY(2px); }

/* Empty slot for a screenshot that hasn't been dropped in yet */
.gallery-placeholder {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
}

.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;
}

/* Fluid variant: cards reflow to fit the width instead of snapping at fixed
   breakpoints. Used where the card count isn't a clean multiple of 4. */
.proud-grid.proud-grid--fluid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.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; }

/* Custom horizontal scroll indicator, shown by script.js only when a flow
   diagram overflows its container (i.e. on mobile). Signals that the diagram
   scrolls left-right and doubles as a draggable scrollbar. */
.flow-bar {
  display: none;
  width: 100%;
  height: 5px;
  margin: 12px 0 0;
  border-radius: 3px;
  background: var(--border);
}

.flow-bar-thumb {
  height: 100%;
  width: 40px;
  border-radius: 3px;
  background: var(--accent-line);
  cursor: grab;
  touch-action: none;
}

.flow-bar-thumb:active { cursor: grabbing; }

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

.flow-svg text { font-family: "Geist", 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); }

/* Coloured flow nodes (Invoices): tint each step with the site's pastel palette.
   Scoped to .flow-colored so the other pages' flow diagrams stay neutral.
   Labels switch to the dark pill ink so they read on the light fills. */
.flow-colored .flow-node { stroke: none; }
.flow-colored .flow-node-label { fill: #2D232E; }
.flow-colored .fn1 { fill: #F2A7A0; }
.flow-colored .fn2 { fill: #F6C896; }
.flow-colored .fn3 { fill: #F5E3A1; }
.flow-colored .fn4 { fill: #C2E8C4; }
.flow-colored .fn5 { fill: #B7D2F1; }

/* User-flow diagram (Invoices): two creation paths through to a paid invoice.
   Entry/action nodes adapt to the theme; status nodes use the app's badge
   colours with fixed dark ink so they read on the pastel fills in both modes. */
.uflow-svg { width: 100%; min-width: 660px; height: auto; display: block; }
.uflow-svg text { font-family: "Geist", sans-serif; }
.uf-node { fill: var(--card); stroke: var(--border); stroke-width: 1; }
.uf-entry { fill: var(--card-hover); stroke: var(--border); stroke-width: 1; }
.uf-label { fill: var(--text); font-size: 15px; font-weight: 600; }
.uf-arrow { stroke: var(--text); stroke-width: 1.6; fill: none; opacity: 0.55; stroke-linecap: round; }
.uf-stem { opacity: 0.4; }
.uf-arrowhead { fill: var(--text); opacity: 0.55; }
.uf-dot { fill: var(--accent-line); }
.uf-edge { fill: var(--muted); font-size: 12.5px; font-weight: 500; }
.uf-status { stroke: none; }
.uf-status-label { fill: #2D232E; font-size: 15px; font-weight: 600; }
.uf-draft { fill: #DDD6F5; }
.uf-open { fill: #B7D2F1; }
.uf-partial { fill: #F6C896; }
.uf-paid { fill: #C2E8C4; }

/* "Understanding the space" bubble diagram */
.space-svg { width: 100%; min-width: 620px; height: auto; display: block; }
.space-svg text { font-family: "Geist", 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; }

/* Footer nav buttons sit on the page background, so a --bg fill made them blend
   in. Give them a white (card) fill in light mode so they stand out; dark mode
   keeps its original page-coloured fill. */
.project-footer-nav .cta { background: var(--card); }
[data-theme="dark"] .project-footer-nav .cta { background: var(--bg); }

@media (max-width: 700px) {
  .process-steps, .process-steps.cols-2 { grid-template-columns: 1fr; }
  .project-gallery { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; gap: 40px; }
  .proud-grid { grid-template-columns: 1fr 1fr; }
  .shipped-row,
  .shipped-row:nth-child(even) { 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; }
}

/* Larger desktop: fix the top two grid rows so Experience/Projects keep a stable
   height instead of stretching with content. Without this, the left column
   (Experience + Skills) drives rows 1-2 tall, which stretches the spanning
   Currently card and spreads its items apart. The capped cards scroll their inner
   lists. Scoped to >=1280px, where the Skills pills still fit two rows; below that
   the columns are narrower (pills wrap to a third row) so the rows flow naturally. */
@media (min-width: 1280px) {
  .grid { grid-template-rows: 290px 180px auto; align-content: start; }
  /* The grid is flex:1 and fills the viewport; align-content:start packs the rows
     to the top so the bottom auto row sizes to its content instead of absorbing the
     leftover height. Let Life/Currently/Contact all stretch to the row height (driven
     by the tallest, Contact) so the three bottom cards line up at the same height. */
  .card-recently, .card-currently, .card-contact { align-self: stretch; }
}

/* 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";
  }

  /* On mobile the cards stack and the page scrolls. Disable the inner scroll
     areas (and their fade masks) on Experience/Projects so they flow with the
     page instead of trapping touch scrolling inside a nested scroll container. */
  .exp-list, .projects {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@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; }
}
