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

:root {
  --bg: #F7F5F0;
  --text: #111111;
  --text-muted: #888888;
  --text-mid: #555555;
  --accent: #C0432A;
  --stitch-red: #C72A25; /* brand red, pairs with images/corner.jpg */
  --border: #E0DDD7;
  --max-w: 800px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-variant-emoji: text; /* keep ↗ as a text arrow, not an emoji, on phones */
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────── */
nav:not(.sidebar-nav),
.hero,
.section,
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* ── Navigation ─────────────────────────── */
nav:not(.sidebar-nav) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 36px;
  padding-bottom: 36px;
}

.nav-logo {
  font-family: 'Pixelify Sans', 'Poppins', sans-serif;
  font-size: calc(26px * var(--fs-lg, 1));
  font-weight: 600;
  line-height: 1;
  color: var(--stitch-red);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: calc(13px * var(--fs, 1));
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

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

/* ── Hero ───────────────────────────────── */
.hero {
  padding-top: 88px;
  padding-bottom: 100px;
}

.hero h1 {
  font-size: calc(clamp(38px, 6.5vw, 60px) * var(--fs-lg, 1));
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 28px;
}

.hero-sub {
  font-size: calc(16px * var(--fs, 1));
  color: var(--text-mid);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-meta {
  display: flex;
  gap: 20px;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Section base ───────────────────────── */
.section {
  padding-top: 80px;
  padding-bottom: 80px;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 44px;
}

/* ── Project list ───────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}

.project-item:first-child {
  border-top: 1px solid var(--border);
}

.project-top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}

.project-num {
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  font-weight: 400;
  min-width: 20px;
  flex-shrink: 0;
}

.project-name {
  font-size: calc(19px * var(--fs, 1));
  font-weight: 500;
  letter-spacing: -0.02em;
  flex: 1;
  transition: color 0.15s ease;
}

.project-arrow {
  font-size: calc(15px * var(--fs, 1));
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.15s ease;
}

.project-item:hover .project-name {
  color: var(--stitch-red);
}

.project-item:hover .project-arrow {
  transform: translateX(5px);
  color: var(--stitch-red);
}

.project-tags {
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  margin-left: 36px;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.project-desc {
  font-size: calc(14px * var(--fs, 1));
  color: var(--text-mid);
  margin-left: 36px;
  max-width: 540px;
  line-height: 1.65;
}

/* ── About ──────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
}

.about-bio p {
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 18px;
}

.about-bio p em {
  color: var(--accent);
  font-style: italic;
}

.about-links {
  display: flex;
  flex-direction: column;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.about-links a {
  font-size: calc(14px * var(--fs, 1));
  color: var(--text);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  transition: color 0.15s ease;
}

.about-links a:hover {
  color: var(--stitch-red);
}

/* ── Detail blocks ──────────────────────── */
.detail-block {
  margin-bottom: 40px;
}

.detail-label {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.detail-block ul {
  list-style: none;
}

.detail-block ul li {
  font-size: calc(13px * var(--fs, 1));
  color: var(--text-mid);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

/* ── Footer ─────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-dot {
  font-size: calc(9px * var(--fs, 1));
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-right a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-right a:hover {
  color: var(--text);
}

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

  .nav-links {
    gap: 14px;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .hero h1 {
    font-size: calc(36px * var(--fs-lg, 1));
  }

  .hero-meta {
    flex-direction: column;
    gap: 8px;
  }

  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ════════════════════════════════════════════
   HOMEPAGE — SIDEBAR LAYOUT
════════════════════════════════════════════ */

body.home {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
}

/* Cross-stitch corner graphic, fixed to bottom-right of the viewport */
body.home::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  width: 180px;
  height: 199px;
  background: url("images/corner.jpg") no-repeat right bottom / contain;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: -1;
}

/* Back-to-top button: pixel diamond in stitch red */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 200px; /* sits just above the corner stitch graphic */
  z-index: 20;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top-diamond {
  fill: var(--stitch-red);
  transition: fill 0.15s ease;
}

/* Project pages have no corner graphic, so the button sits lower */
body.project .to-top { right: 28px; bottom: 28px; }

.to-top:hover { transform: translateY(-3px); }
.to-top:hover .to-top-diamond { fill: #9C1F1B; }

.to-top:focus-visible {
  outline: 2px solid var(--stitch-red);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top:hover { transition: none; transform: none; }
}

/* Sidebar */
.sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  overflow-y: auto;
  padding: 36px 28px 40px;
  border-right: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  z-index: 10;
}

.sidebar-name {
  font-family: 'Pixelify Sans', 'Poppins', sans-serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin-bottom: 18px;
  color: var(--stitch-red);
}

.sidebar-name a {
  color: inherit;
  text-decoration: none;
}

.sidebar-name a:hover { opacity: 0.7; }

.sidebar-role {
  font-size: calc(13px * var(--fs, 1));
  letter-spacing: 0.01em;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 2px;
}

.sidebar-location {
  font-size: calc(13px * var(--fs, 1));
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.sidebar-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.sidebar-nav-label {
  font-size: calc(13px * var(--fs, 1));
  line-height: 1;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.sidebar-nav {
  display: block;
}

.sidebar-nav a {
  display: block;
  position: relative;
  padding: 7px 0 7px 20px;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-arrow {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  display: block;
}

.sidebar-nav a:hover { color: var(--stitch-red); }

.sidebar-links {
  display: block;
}

.sidebar-links a {
  font-size: calc(12px * var(--fs, 1));
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 0;
  display: block;
  transition: color 0.15s;
}

.sidebar-links a:hover { color: var(--stitch-red); }

.sidebar-personal {
  font-size: calc(11px * var(--fs, 1));
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Main content */
.home-main {
  grid-column: 2;
  grid-row: 1;
  margin-left: 0;
  padding: 48px 52px 72px;
}

/* Project rows */
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 560px) 170px;
  gap: 32px;
  margin-bottom: 52px;
  text-decoration: none;
  color: inherit;
  align-items: start;
}

.project-row-img {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.project-row-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: opacity 0.2s ease;
}

.project-row:hover .project-row-img img { opacity: 0.86; }

.project-row-meta {
  font-family: 'Poppins', sans-serif;
  padding-top: 4px;
}

.prm-name {
  font-size: calc(12px * var(--fs, 1));
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
  margin-bottom: 14px;
  color: var(--text);
  transition: color 0.15s;
}

.project-row:hover .prm-name { color: var(--stitch-red); }

.prm-tags {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prm-tags span {
  font-size: calc(10px * var(--fs, 1));
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Home about */
.home-about {
  border-top: 1px solid var(--border);
  padding-top: 56px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.ha-label {
  font-family: 'Poppins', sans-serif;
  font-size: calc(9px * var(--fs, 1));
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.ha-bio p {
  font-family: 'Poppins', sans-serif;
  font-size: calc(15px * var(--fs, 1));
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 14px;
}

.ha-bio p em { color: var(--accent); font-style: italic; }

.ha-detail-label {
  font-family: 'Poppins', sans-serif;
  font-size: calc(9px * var(--fs, 1));
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 32px;
}

.ha-detail-label:first-child { margin-top: 0; }

.ha-detail ul { list-style: none; }

.ha-detail ul li {
  font-family: 'Poppins', sans-serif;
  font-size: calc(13px * var(--fs, 1));
  color: var(--text-mid);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

/* Home footer */
.home-footer {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: none;   /* override the generic footer width cap */
  margin: 0;
  padding: 24px 220px 44px 52px; /* right side clears the corner stitch graphic */
  border-top: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.home-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.home-footer a:hover { color: var(--text); }

.home-footer-right { display: flex; gap: 20px; }

@media (max-width: 900px) {
  body.home {
    display: block;
  }

  body.home::after {
    width: 110px;
    height: 122px;
  }

  .to-top { right: 14px; bottom: 130px; }
  body.project .to-top { right: 16px; bottom: 16px; }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px;
  }

  .sidebar-links { margin-top: 20px; }

  .home-main { padding: 28px 24px 60px; }

  .project-row {
    grid-template-columns: 1fr;
    margin-bottom: 48px;
  }

  .home-about {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-footer {
    padding: 24px 24px 140px; /* bottom clears the smaller corner graphic */
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ════════════════════════════════════════════
   ABOUT PAGE
════════════════════════════════════════════ */

.about-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 52px;
  align-items: start;
  margin-bottom: 64px;
}

.about-headshot {
  width: 100%;
  display: block;
  border-radius: 4px 40px 4px 40px;
  transform: rotate(-1.5deg);
}

.about-page-label {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.about-intro p {
  font-size: calc(15px * var(--fs, 1));
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 14px;
}

.about-intro p:last-child { margin-bottom: 0; }

.about-intro p em {
  color: var(--accent);
  font-style: italic;
}

.about-intro .about-lead {
  font-size: calc(20px * var(--fs, 1));
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 20px;
}

.about-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stitch-red);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: border-color 0.15s ease;
}

.about-cta:hover { border-bottom-width: 2px; }

.about-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.about-col-label {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-col ul {
  list-style: none;
}

.about-col ul li {
  font-size: calc(13px * var(--fs, 1));
  color: var(--text-mid);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.sidebar-link-active {
  color: var(--accent) !important;
}

@media (max-width: 900px) {
  .about-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .about-headshot {
    max-width: 240px;
  }

  .about-details {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ════════════════════════════════════════════
   PROJECT PAGES
════════════════════════════════════════════ */

body.project {
  --max-w: 1000px;
}

.project-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
}

.back-link {
  font-size: calc(11px * var(--fs, 1));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding-top: 44px;
  display: inline-block;
  transition: color 0.15s;
}

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

.project-tags-header {
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  margin-top: 44px;
}

.project-title-large {
  font-size: calc(clamp(36px, 6.5vw, 72px) * var(--fs-lg, 1));
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: 28px;
  color: var(--text);
}

.project-lead {
  font-size: calc(18px * var(--fs, 1));
  color: var(--text-mid);
  max-width: 640px;
  line-height: 1.72;
  margin-bottom: 52px;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.project-meta-grid > div {
  padding: 24px 0;
}

.project-meta-grid > div:not(:last-child) {
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.project-meta-grid > div:not(:first-child) {
  padding-left: 24px;
}

.meta-label {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.meta-value {
  font-size: calc(13px * var(--fs, 1));
  color: var(--text);
  line-height: 1.5;
}

.meta-value a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.meta-value a:hover {
  color: var(--stitch-red);
  border-color: var(--stitch-red);
}

.project-hero-img {
  width: calc(100% + 96px);
  margin-left: -48px;
  display: block;
  margin-top: 64px;
  border-radius: 0;
  border: none;
  background: var(--border);
}

/* ── Case study sections ──────────────────── */

.ps {
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: 72px;
  padding-top: 80px;
  padding-bottom: 80px;
  border-top: 1px solid var(--border);
  align-items: start;
}

.ps-side {
  grid-column: 1;
  position: sticky;
  top: 40px;
}

.ps-body {
  grid-column: 2;
}

.ps-label {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
  display: block;
  padding-top: 7px;
}

.ps-heading {
  font-size: calc(26px * var(--fs-lg, 1));
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  color: var(--text);
  line-height: 1.25;
}

.ps-subheading {
  font-size: calc(15px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 10px;
}

.ps-text {
  font-size: calc(15px * var(--fs, 1));
  color: var(--text-mid);
  line-height: 1.8;
}

.ps-text p { margin-bottom: 14px; }

.ps-text ul {
  padding-left: 18px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.ps-text ul li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.img-block { margin-top: 40px; }

/* Screen-recording videos */
.video-block { margin: 0; }
.video-block.img-block { margin-top: 40px; }

.video-block video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #eceae4;
}

/* ── Annotated screen viewer (Little Lemon) ── */
.screens {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  padding: 20px 20px 16px;
}

.screens-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.screens-tabs button {
  font: inherit;
  font-size: calc(11px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.screens-tabs button:hover { color: var(--stitch-red); border-color: var(--stitch-red); }

.screens-tabs button[aria-selected="true"] {
  background: var(--stitch-red);
  border-color: var(--stitch-red);
  color: #fff;
}

/* All screens share one grid cell so they can crossfade in place */
.screens-stage { display: grid; }

.screen {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.screen img {
  width: 100%;
  height: 520px;
  object-fit: contain;
  display: block;
}

.screen figcaption {
  margin-top: 14px;
  font-size: calc(13.5px * var(--fs, 1));
  line-height: 1.65;
  color: var(--text-mid);
  min-height: 3.3em;
}

.screen figcaption strong { color: var(--text); font-weight: 600; }

.screens-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.screens-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.screens-btn:hover { color: var(--stitch-red); border-color: var(--stitch-red); }

.screens-dots { display: flex; gap: 8px; }

.screens-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.screens-dot:hover { background: var(--text-muted); }
.screens-dot.is-active { background: var(--stitch-red); transform: scale(1.2); }

.screens-count {
  margin-left: auto;
  font-family: 'Pixelify Sans', 'Poppins', sans-serif;
  font-size: calc(14px * var(--fs, 1));
  color: var(--text-muted);
}

.screens [role="tab"]:focus-visible,
.screens-btn:focus-visible,
.screens-dot:focus-visible {
  outline: 2px solid var(--stitch-red);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .screens { padding: 14px 12px 12px; }
  .screen img { height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen { transition: none; transform: none; }
}

/* Row of three photos cropped to the same height */
.img-row-3--photos img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Medium, centered image (e.g. a tall annotated sheet or photo) */
.img-block--medium {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Smaller, centered image (e.g. a single phone sketch) */
.img-block--narrow {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.img-block img,
.img-row img,
.img-row-3 img {
  width: 100%;
  display: block;
  border-radius: 3px;
  background: #eceae4;
}

.img-caption {
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.img-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

/* ── Persona (Little Lemon brand colors) ── */
.persona {
  --ll-green: #495E57;
  --ll-yellow: #F4CE14;
  margin-top: 40px;
}

.persona-banner {
  display: grid;
  grid-template-columns: 190px 1fr;
  background: var(--ll-green);
  border-radius: 3px;
  overflow: hidden;
}

.persona-photo {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.persona-info {
  padding: 30px 32px 28px;
  color: #fff;
}

.persona-name {
  font-size: calc(34px * var(--fs-lg, 1));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.persona-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.45;
}

.persona-facts dt,
.persona-facts dd { display: inline; margin: 0; }

.persona-facts dt {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: calc(11px * var(--fs, 1));
  color: var(--ll-yellow);
}

.persona-quote {
  margin: 32px 0 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--stitch-red);
  font-size: calc(18px * var(--fs, 1));
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
}

.persona-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.persona-details h4 {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ll-green);
  margin-bottom: 8px;
}

.persona-details p {
  font-size: calc(13.5px * var(--fs, 1));
  line-height: 1.7;
  color: var(--text-mid);
}

@media (max-width: 700px) {
  .persona-banner { grid-template-columns: 1fr; }
  .persona-photo { height: 260px; min-height: 0; }
  .persona-info { padding: 24px 22px; }
  .persona-name { font-size: calc(28px * var(--fs-lg, 1)); }
  .persona-facts { grid-template-columns: 1fr; gap: 6px; }
  .persona-details { grid-template-columns: 1fr; gap: 20px; }
}

.img-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
}

.outcome-list {
  list-style: none;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.outcome-list li {
  font-size: calc(15px * var(--fs, 1));
  color: var(--text-mid);
  padding: 14px 0 14px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  line-height: 1.6;
}

.outcome-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  font-size: calc(8px * var(--fs, 1));
  color: var(--accent);
  top: 20px;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 60px;
  padding-bottom: 80px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  gap: 20px;
}

.pnav-link {
  text-decoration: none;
  color: var(--text);
  flex: 1;
}

.pnav-link.right { text-align: right; }

.pnav-dir {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.pnav-title {
  font-size: calc(18px * var(--fs, 1));
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.15s;
  color: var(--text);
  line-height: 1.3;
}

.pnav-link:hover .pnav-title { color: var(--stitch-red); }

@media (max-width: 700px) {
  .project-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .project-hero-img {
    width: calc(100% + 48px);
    margin-left: -24px;
  }

  .project-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .project-meta-grid > div:not(:last-child) {
    border-right: none;
    padding-right: 0;
  }

  .project-meta-grid > div:not(:first-child) {
    padding-left: 0;
  }

  .project-meta-grid > div {
    padding: 20px 0;
  }

  .project-meta-grid > div:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }

  /* With three items, let the last one span the full row */
  .project-meta-grid > div:nth-child(3):last-child {
    grid-column: 1 / -1;
  }

  .ps {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 20px;
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .ps-side {
    position: static;
    grid-column: 1;
  }

  .ps-body { grid-column: 1; }
  .ps-label { padding-top: 0; }

  .img-row,
  .img-row-3 { grid-template-columns: 1fr; }

  .project-nav {
    flex-direction: column;
    gap: 32px;
    padding-bottom: 60px;
  }

  .pnav-link.right { text-align: left; }
}

/* ════════════════════════════════════════════
   PROJECT PAGES — REFRESHED CASE STUDY LAYOUT
   Scannable building blocks shared by all five
   project pages.
════════════════════════════════════════════ */

body.project {
  --surface: #FFFFFF;
  --surface-soft: #FBFAF7;
  --red-tint: #FBEDEC;
  --radius: 6px;
}

/* ── Header ── */
.p-hero { padding-top: 40px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  font-size: calc(11px * var(--fs, 1));
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}

.p-hero .project-title-large { margin-bottom: 20px; }

.p-hero .project-lead {
  font-size: calc(19px * var(--fs, 1));
  line-height: 1.6;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 36px;
}

.p-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}

.p-meta > div {
  background: var(--surface-soft);
  padding: 16px 18px;
}

.p-meta dt {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.p-meta dd {
  margin: 0;
  font-size: calc(14px * var(--fs, 1));
  line-height: 1.45;
  color: var(--text);
}

.p-meta a { color: var(--stitch-red); text-decoration: none; }
.p-meta a:hover { text-decoration: underline; }

body.project .project-hero-img {
  width: 100%;
  margin-left: 0;
  margin-top: 40px;
  border-radius: var(--radius);
}

/* ── At a glance ── */
.glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}

.glance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  border-top: 3px solid var(--border);
}

.glance-card:last-child { border-top-color: var(--stitch-red); }

.glance-card h3 {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.glance-card:last-child h3 { color: var(--stitch-red); }

.glance-card p {
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.6;
  color: var(--text);
}

/* ── Key numbers ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat {
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.stat-num {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: calc(38px * var(--fs-lg, 1));
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--stitch-red);
  margin-bottom: 8px;
}

.stat-label {
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.45;
  color: var(--text-mid);
}

/* ── What I did: skill checklist ── */
.skills {
  margin-top: 56px;
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skills h2 {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.skills ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px 20px;
}

.skills li,
.checks li {
  position: relative;
  padding-left: 30px;
  font-size: calc(14px * var(--fs, 1));
  line-height: 1.5;
  color: var(--text);
}

/* Pixel checkmark in a red square */
.skills li::before,
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Crect width='9' height='9' fill='%23C72A25'/%3E%3Cpath fill='%23fff' d='M1 4h1v1H1Z M2 5h1v1H2Z M3 6h1v1H3Z M4 5h1v1H4Z M5 4h1v1H5Z M6 3h1v1H6Z M7 2h1v1H7Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Process steps (jump links) ── */
.steps {
  list-style: none;
  padding: 0;
  margin: 56px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  counter-reset: step;
}

.steps a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.steps a span {
  font-family: 'Poppins', sans-serif;
  font-size: calc(12px * var(--fs, 1));
  color: #fff;
  background: var(--stitch-red);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.steps a:hover { border-color: var(--stitch-red); color: var(--stitch-red); }

/* ── Sections ── */
.sec {
  padding-top: 88px;
  scroll-margin-top: 24px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stitch-red);
  margin-bottom: 12px;
}

.eyebrow b {
  font-family: 'Poppins', sans-serif;
  font-size: calc(15px * var(--fs, 1));
  letter-spacing: 0;
}

.sec-title {
  font-size: calc(clamp(24px, 3.2vw, 32px) * var(--fs-lg, 1));
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  max-width: 760px;
  margin-bottom: 14px;
}

.sec-intro {
  font-size: calc(16px * var(--fs, 1));
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 680px;
}

.sub-title {
  font-size: calc(17px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 44px 0 12px;
}

/* Bulleted key points with a small red pixel square */
.points {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  max-width: 700px;
}

.points li {
  position: relative;
  padding-left: 22px;
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.6;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--stitch-red);
}

.points strong { color: var(--text); font-weight: 600; }

/* ── Problem → fix table ── */
.fixes {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.fix {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: calc(14px * var(--fs, 1));
  line-height: 1.5;
}

.fix:first-child { border-top: 0; }

.fix-head {
  background: var(--surface-soft);
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 10px;
  padding-bottom: 10px;
}

.fix-head span:last-child { color: var(--stitch-red); }

.fix > :first-child { color: var(--text-mid); }
.fix > :last-child { color: var(--text); font-weight: 500; }

.fix-arrow {
  color: var(--stitch-red);
  font-weight: 600;
  text-align: center;
}

/* ── Generic card grids ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
}

.card-kicker {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stitch-red);
  margin-bottom: 8px;
}

.card h3 {
  font-size: calc(16px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 8px;
}

.card p,
.card li {
  font-size: calc(13.5px * var(--fs, 1));
  line-height: 1.6;
  color: var(--text-mid);
}

.card ul { padding-left: 16px; margin: 6px 0 0; }
.card li { margin-bottom: 4px; }

.card .big {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: calc(30px * var(--fs-lg, 1));
  color: var(--stitch-red);
  line-height: 1;
  margin: 4px 0 10px;
}

.card.is-picked {
  border-color: var(--stitch-red);
  box-shadow: 0 0 0 1px var(--stitch-red) inset;
}

.badge {
  display: inline-block;
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--red-tint);
  color: var(--stitch-red);
  margin-bottom: 10px;
}

.badge.is-muted { background: #EFEDE8; color: var(--text-muted); }

.verdict {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.5;
}

.verdict .plus { color: #2F7D4F; }
.verdict .minus { color: var(--text-muted); }

/* ── Callout ── */
.callout {
  margin-top: 28px;
  padding: 18px 22px;
  background: var(--red-tint);
  border-left: 3px solid var(--stitch-red);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.65;
  color: var(--text);
  max-width: 760px;
}

.callout strong { color: var(--stitch-red); }

/* ── Outcome checklist ── */
.checks {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 28px;
}

.checks a { color: var(--stitch-red); }

/* ── Side-by-side comparison (e.g. style options) ── */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.compare figure { margin: 0; }

.compare img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #eceae4;
}

.compare figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: calc(13px * var(--fs, 1));
  color: var(--text-mid);
}

.compare figcaption .badge { margin: 0; }

/* Tall page mockups: show the top, scroll inside on demand */
.tall-frame {
  max-height: 640px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #eceae4;
}

.tall-frame img { border: 0; border-radius: 0; }

/* ── Data table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: calc(14px * var(--fs, 1));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.data-table thead th {
  border-top: 0;
  background: var(--surface-soft);
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.data-table td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }
.data-table td { color: var(--text-mid); }

/* ── Journey map ── */
.journey {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.journey-scenario {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 18px;
  font-size: calc(15px * var(--fs, 1));
  color: var(--text);
}

.journey-scenario .badge { margin: 0; }

/* Feeling line above the stage columns */
.journey-feel {
  position: relative;
  height: 72px;
  margin: 0 0 10px;
  border-bottom: 1px dashed var(--border);
}

.journey-feel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.journey-feel polyline {
  fill: none;
  stroke: var(--stitch-red);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.feel-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--stitch-red);
  transform: translate(-50%, -50%);
}

.feel-label {
  position: absolute;
  left: 0;
  top: 0;
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stage .feel {
  display: inline-block;
  font-size: calc(11px * var(--fs, 1));
  font-weight: 600;
  color: var(--stitch-red);
  background: var(--red-tint);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 10px;
}

.journey-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stage {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.stage h4 {
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.stage h4 span {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
  color: var(--stitch-red);
  margin-bottom: 2px;
}

.stage dl { margin: 0; }

.stage dt {
  font-size: calc(9px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
}

.stage dt:first-child { margin-top: 0; }

.stage dd {
  margin: 3px 0 0;
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.5;
  color: var(--text-mid);
}

.stage dd q { font-style: italic; color: var(--text); }

.journey-out {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ── Card-type tiles (Incluso!) ── */
.cardtypes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.cardtype {
  border: 4px solid var(--ct, var(--border));
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 16px 14px;
}

.cardtype h3 {
  font-size: calc(16px * var(--fs, 1));
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.cardtype p { font-size: calc(13.5px * var(--fs, 1)); line-height: 1.55; color: var(--text-mid); }

.cardtype--persona { --ct: #4A67B5; }
.cardtype--challenge { --ct: #5BB463; }
.cardtype--solution { --ct: #D9418A; }

.cardtype-rule {
  margin-top: 14px;
  font-size: calc(15px * var(--fs, 1));
  color: var(--text);
}

.cardtype-rule strong { color: var(--stitch-red); }

/* ── Disclosure for extra detail ── */
.more {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.more summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  color: var(--stitch-red);
  display: flex;
  align-items: center;
  gap: 10px;
}

.more summary::-webkit-details-marker { display: none; }

.more summary::before {
  content: "+";
  font-family: 'Poppins', sans-serif;
  font-size: calc(18px * var(--fs, 1));
  line-height: 1;
}

.more[open] summary::before { content: "−"; }

.more > div { padding: 0 18px 18px; }

.more img { width: 100%; display: block; border-radius: 4px; }

/* ── Scroll reveal (only when JS is running) ── */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
  .js .reveal { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .glance { grid-template-columns: 1fr; }
  .journey-stages { grid-template-columns: 1fr 1fr; }
  .journey-feel { display: none; }
  .journey-out { grid-template-columns: 1fr; }
  .cardtypes { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .p-hero .project-lead { font-size: calc(17px * var(--fs, 1)); }
  .sec { padding-top: 64px; }
  .compare { grid-template-columns: 1fr; }
  .journey-stages { grid-template-columns: 1fr; }
  .journey { padding: 16px; }
  .fix { grid-template-columns: 1fr; gap: 4px; padding: 14px 16px; }
  .fix-arrow { text-align: left; transform: rotate(90deg); width: 14px; }
  .fix-head { display: none; }
  .skills { padding: 20px 18px; }
  .data-table td:first-child { white-space: normal; }
  .img-row-3--photos { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
}

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Grade bar chart (Equal Games) ── */
.bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  height: 170px;
  padding-top: 34px;
  margin-top: 6px;
  border-bottom: 1px solid var(--border);
}

.bar-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.bar {
  position: relative;
  width: 60%;
  max-width: 28px;
  height: calc(var(--v) / 7 * 100%);
  background: #D9D5CD;
  border-radius: 4px 4px 0 0;
  cursor: default;
  outline: none;
}

.bar-col.is-focus .bar { background: var(--stitch-red); }

.bar-x {
  position: absolute;
  bottom: -22px;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-muted);
}

/* Hover / focus tooltip, hit area wider than the bar */
.bar::before {
  content: "";
  position: absolute;
  inset: -6px -10px 0;
}

.bar::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: calc(11px * var(--fs, 1));
  color: #fff;
  background: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 2;
}

.bar:hover::after { opacity: 1; }


.bar-range {
  position: absolute;
  top: 0;
  right: 0;
  width: calc(4 / 7 * 100%);
  text-align: center;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-mid);
  border-bottom: 2px solid var(--stitch-red);
  padding-bottom: 4px;
}

.bar-range strong { color: var(--text); }

.bar-axis {
  margin-top: 28px;
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
  text-align: center;
}

/* ── Interview guide ── */
.guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.guide h4 {
  font-size: calc(10px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.guide ol { padding-left: 22px; margin: 0; }
.guide li { font-size: calc(13.5px * var(--fs, 1)); line-height: 1.55; color: var(--text-mid); margin-bottom: 6px; }
.guide ul { padding-left: 16px; margin-top: 6px; list-style: circle; }

@media (max-width: 640px) {
  .guide { grid-template-columns: 1fr; }
  .cards--chart { grid-template-columns: 1fr; }
}

.cards--chart { grid-template-columns: 2fr 1fr; align-items: stretch; }
@media (max-width: 640px) { .cards--chart { grid-template-columns: 1fr; } }

/* Small screens: let the project top bar wrap instead of crowding */
@media (max-width: 560px) {
  nav:not(.sidebar-nav) { flex-wrap: wrap; gap: 10px 16px; padding-top: 24px; padding-bottom: 20px; }
  .nav-links { gap: 16px; }
}

/* ════════════════════════════════════════════
   WARMER, MORE PERSONAL PASS
   Softens the case study layout: no stark white
   boxes, the site's own "/ tag" style, cross-stitch
   dividers and a personal sign-off.
════════════════════════════════════════════ */

body.project {
  --sand: #EFEAE0;
  --sand-line: #E2DCCF;
}

/* Tags: same "/ tag" style as the home page */
.chips { gap: 4px 16px; margin-bottom: 20px; }
.chip {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-size: calc(11px * var(--fs, 1));
  font-weight: 400;
  color: var(--text-muted);
}
.chip::before { content: "/ "; }

/* Details row: open columns with thin rules, no box */
.p-meta {
  background: none;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  gap: 0;
}
.p-meta > div { background: none; padding: 18px 20px 18px 0; }
.p-meta > div + div { padding-left: 20px; border-left: 1px solid var(--border); }

/* At a glance: three open columns, stitched dividers */
.glance { gap: 0; margin-top: 64px; }
.glance-card,
.glance-card:last-child {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0 28px;
}
.glance-card:first-child { padding-left: 0; }
.glance-card + .glance-card { border-left: 1px dashed rgba(199, 42, 37, 0.35); }
.glance-card p { font-size: calc(15.5px * var(--fs, 1)); }

/* Key numbers: no boxes, just big numbers */
.stats { gap: 24px; margin-top: 44px; }
.stat { border: 0; padding: 0; }

/* What I did: open list on a soft sand band */
.skills {
  background: var(--sand);
  border: 0;
  border-radius: 4px;
  padding: 24px 26px 20px;
}

/* Lighter checkmark: red pixel tick, no filled square */
.skills li::before,
.checks li::before {
  width: 16px;
  height: 16px;
  top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23C72A25' d='M0 4h2v1H0Z M1 5h2v1H1Z M2 6h2v1H2Z M3 5h2v1H3Z M4 4h2v1H4Z M5 3h2v1H5Z M6 2h2v1H6Z M7 1h1v1H7Z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.skills li, .checks li { padding-left: 26px; }

/* Process index: quiet text links instead of pills */
.steps { gap: 6px 22px; margin-top: 44px; }
.steps a {
  border: 0;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-mid);
  gap: 6px;
}
.steps a span {
  background: none;
  color: var(--stitch-red);
  width: auto;
  height: auto;
  font-weight: 600;
}
.steps a span::after { content: "."; }
.steps a:hover { color: var(--stitch-red); }

/* Cross-stitch row above each section, like the corner graphic */
.sec::before {
  content: "";
  display: block;
  width: 112px;
  height: 14px;
  margin-bottom: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23C72A25' d='M0 0h1v1H0Z M4 0h1v1H4Z M1 1h1v1H1Z M3 1h1v1H3Z M2 2h1v1H2Z M1 3h1v1H1Z M3 3h1v1H3Z M0 4h1v1H0Z M4 4h1v1H4Z'/%3E%3Cpath fill='%23222' d='M8 0h1v1H8Z M12 0h1v1H12Z M9 1h1v1H9Z M11 1h1v1H11Z M10 2h1v1H10Z M9 3h1v1H9Z M11 3h1v1H11Z M8 4h1v1H8Z M12 4h1v1H12Z'/%3E%3C/svg%3E") repeat-x left top / 32px 14px;
}

/* Cards: warm sand instead of white, no borders */
.card {
  background: var(--sand);
  border: 0;
  border-radius: 4px;
}
.card.is-picked {
  background: var(--red-tint);
  border: 0;
  box-shadow: none;
}
.verdict { border-top-color: var(--sand-line); }
.card.is-picked .verdict { border-top-color: rgba(199, 42, 37, 0.2); }

/* Problem → fix: open rows, no box */
.fixes {
  background: none;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.fix { padding-left: 0; padding-right: 0; }
.fix-head { background: none; }

/* Tables, disclosures, journey: open and warm */
.data-table { background: none; border: 0; border-radius: 0; }
.data-table thead th { background: none; border-bottom: 1px solid var(--border); }
.data-table td, .data-table th { padding-left: 0; }

.more {
  background: none;
  border: 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  border-radius: 0;
}
.more summary { padding-left: 0; padding-right: 0; }
.more > div { padding: 0 0 18px; }

.journey { background: none; border: 0; padding: 0; }
.stage { background: var(--sand); border: 0; border-radius: 4px; }

/* Screen viewer: let the screens sit on the page */
.screens {
  background: var(--sand);
  border: 0;
  border-radius: 4px;
}
.screens-controls { border-top-color: var(--sand-line); }
.screens-tabs button { background: transparent; }
.screens-btn { border-color: var(--sand-line); }

.cardtype { background: transparent; }

/* Gentler reveal */
.js .reveal { transform: translateY(10px); }

@media (max-width: 860px) {
  .glance-card,
  .glance-card:last-child { padding: 18px 0 0; }
  .glance-card + .glance-card { border-left: 0; border-top: 1px dashed rgba(199, 42, 37, 0.35); margin-top: 18px; }
  .p-meta > div + div { border-left: 0; padding-left: 0; }
  .p-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
}

/* Step index: number and label on one line */
.steps a span { display: inline; border-radius: 0; }

/* ── Image polish: consistent frames, taller viewer, click to enlarge ── */

/* Side-by-side images share one frame shape so heights and captions line up */
body.project .img-row img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--sand);
  border-radius: 4px;
}

/* More room for annotated screens */
body.project .screen img { height: 600px; }

/* Viewer without tabs (e.g. "Before" screenshots) */
.screens--plain { padding-top: 16px; }

.zoomable { cursor: zoom-in; transition: opacity 0.15s ease; }
.zoomable:hover { opacity: 0.92; }
.zoomable:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 3px; }

.zoom-hint {
  margin-top: 8px;
  font-size: calc(11px * var(--fs, 1));
  color: var(--text-muted);
}

html.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 21, 18, 0.9);
}

.lightbox[hidden] { display: none; }

.lightbox-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 64px 24px 40px;
  text-align: center;
}

.lightbox-scroll img {
  max-width: min(100%, 1600px);
  height: auto;
  border-radius: 4px;
  background: #fff;
  cursor: zoom-out;
}

.lightbox-caption {
  margin: 14px auto 0;
  max-width: 760px;
  font-size: calc(13px * var(--fs, 1));
  color: #E9E4DA;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: var(--stitch-red);
  color: #fff;
  cursor: pointer;
}

.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 700px) {
  body.project .screen img { height: 420px; }
  .lightbox-scroll { padding: 64px 10px 30px; }
}

/* Wide screenshots don't need the tall viewer */
body.project .screens--plain .screen img { height: 490px; }
@media (max-width: 700px) { body.project .screens--plain .screen img { height: 240px; } }

/* Rows of before/after thumbnails: same frame, aligned captions, click to enlarge */
body.project .img-row-3--thumbs img {
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--sand);
  border-radius: 4px;
  padding: 8px;
  box-sizing: border-box;
}

/* Back to the original viewer height */
body.project .screen img { height: 520px; }
@media (max-width: 700px) { body.project .screen img { height: 380px; } }

/* Slightly larger before/after thumbnails: row spans the full page width */
@media (min-width: 900px) {
  body.project .img-row-3--thumbs {
    width: calc(100% + 96px);
    margin-left: -48px;
    gap: 14px;
  }
}
body.project .img-row-3--thumbs img { padding: 5px; }

@media (min-width: 900px) { body.project .img-row-3--thumbs + .zoom-hint { margin-left: -48px; } }

/* ── Project call-to-action buttons (under the one-line pitch) ── */
.p-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: -12px 0 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 11px 18px;
  border-radius: 4px;
  background: var(--stitch-red);
  color: #fff;
  border: 1px solid var(--stitch-red);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover { background: #9C1F1B; border-color: #9C1F1B; }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover { background: transparent; color: var(--stitch-red); border-color: var(--stitch-red); }

.btn:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 3px; }

#prototype-video { scroll-margin-top: 24px; }

/* ── Resume page: embedded PDF ── */
.resume-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.resume-title {
  font-size: calc(28px * var(--fs-lg, 1));
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 6px;
}

.resume-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.resume-btn {
  display: inline-flex;
  align-items: center;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--stitch-red);
  border: 1px solid var(--stitch-red);
  color: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.resume-btn:hover { background: #9C1F1B; border-color: #9C1F1B; }

.resume-btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.resume-btn--ghost:hover { background: transparent; color: var(--stitch-red); border-color: var(--stitch-red); }

.resume-btn:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 3px; }

.resume-frame {
  background: #EFEAE0;
  border-radius: 4px;
  padding: 10px;
}

.resume-frame object {
  display: block;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 640px;
  border: 0;
  border-radius: 2px;
  background: #fff;
}

.resume-fallback {
  padding: 40px 24px;
  text-align: center;
  font-size: calc(14px * var(--fs, 1));
  color: var(--text-mid);
}

.resume-fallback p { margin-bottom: 16px; }

@media (max-width: 900px) {
  .resume-frame object { height: 80vh; min-height: 480px; }
}

/* ════════════════════════════════════════════
   MOBILE POLISH
════════════════════════════════════════════ */

/* Chart tooltips at the edges open inward so they never widen the page */
.bar-col:first-child .bar::after { left: 0; transform: none; }
.bar-col:nth-last-child(-n+3) .bar::after { left: auto; right: 0; transform: none; }

.resume-mobile-note { display: none; }

@media (max-width: 900px) {
  /* Home page: skip the long Work list (the project cards are right below)
     and lay the links out in one compact row */
  .page-index .sidebar > div:nth-of-type(2),
  .page-index .sidebar > hr:nth-of-type(2) { display: none; }

  .sidebar-links {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 8px 28px;
  }
  .sidebar-links a { margin: 0; }
  .sidebar-personal { grid-column: 1 / -1; margin-top: 4px; }

  /* Corner stitch graphic: sits at the end of the page instead of floating over text */
  body.home { position: relative; }
  body.home::after { position: absolute; }
  .to-top { bottom: 16px; }
}

@media (max-width: 700px) {
  /* Embedded PDFs are awkward on phones: offer the buttons instead */
  .resume-frame { display: none; }
  .resume-mobile-note {
    display: block;
    font-size: calc(14px * var(--fs, 1));
    line-height: 1.6;
    color: var(--text-mid);
    background: #EFEAE0;
    border-radius: 4px;
    padding: 16px 18px;
  }

  /* Small uppercase labels: at least 11px on phones */
  .eyebrow, .p-meta dt, .glance-card h3, .skills h2, .card-kicker,
  .fix-head, .data-table thead th, .stage dt, .badge, .persona-facts dt,
  .persona-details h4, .about-page-label, .about-col-label, .prm-tags span,
  .ha-label, .ha-detail-label, .meta-label, .pnav-dir, .feel-label,
  .sidebar-personal, .guide h4, .ps-label {
    font-size: calc(11px * var(--fs, 1));
  }

  /* Comfortable tap targets */
  .steps a { padding: 6px 0; }
  .sidebar-links a { padding: 4px 0; }
}

/* Tablets too: small uppercase labels at least 11px */
@media (max-width: 1024px) {
  .eyebrow, .p-meta dt, .glance-card h3, .skills h2, .card-kicker,
  .fix-head, .data-table thead th, .stage dt, .badge, .persona-facts dt,
  .persona-details h4, .about-page-label, .about-col-label, .prm-tags span,
  .ha-label, .ha-detail-label, .meta-label, .pnav-dir, .feel-label,
  .sidebar-personal, .guide h4, .ps-label { font-size: calc(11px * var(--fs, 1)); }
}

/* ════════════════════════════════════════════
   ACCESSIBILITY MENU
   Button bottom-left (the back-to-top diamond is bottom-right),
   sand panel, pixel icons, red accents.
════════════════════════════════════════════ */

.a11y-root {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 60;
  font-family: 'Poppins', sans-serif;
}

.a11y-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--stitch-red);
  cursor: pointer;
  box-shadow: 0 2px 0 #9C1F1B;
  transition: transform 0.15s ease, background 0.15s ease;
}

.a11y-btn:hover { background: #9C1F1B; transform: translateY(-2px); }
.a11y-btn[aria-expanded="true"] { background: #9C1F1B; }
.a11y-btn:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 3px; }

.a11y-panel {
  position: absolute;
  left: 0;
  bottom: 60px;
  width: 300px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: #EFEAE0;
  border: 1px solid #E2DCCF;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(40, 30, 20, 0.16);
  color: var(--text);
}

.a11y-panel[hidden] { display: none; }

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

.a11y-head h2 {
  font-family: 'Pixelify Sans', 'Poppins', sans-serif;
  font-size: calc(20px * var(--fs, 1));
  font-weight: 600;
  color: var(--stitch-red);
  letter-spacing: 0;
}

.a11y-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #E2DCCF;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.a11y-close:hover { color: var(--stitch-red); border-color: var(--stitch-red); }

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-top: 1px dashed #DCD5C6;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
}

.a11y-toggle { cursor: pointer; }

.a11y-label {
  display: block;
  font-size: calc(14px * var(--fs, 1));
  font-weight: 600;
  color: var(--text);
}

.a11y-hint {
  display: block;
  font-size: calc(12px * var(--fs, 1));
  color: var(--text-mid);
  margin-top: 1px;
}

/* Pixel-style switch */
.a11y-switch {
  flex-shrink: 0;
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 3px;
  background: #D9D3C6;
  transition: background 0.15s ease;
}

.a11y-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.15s ease;
}

.a11y-toggle[aria-pressed="true"] .a11y-switch { background: var(--stitch-red); }
.a11y-toggle[aria-pressed="true"] .a11y-switch::after { transform: translateX(18px); }
.a11y-toggle:hover .a11y-label { color: var(--stitch-red); }

.a11y-stepper { display: flex; align-items: center; gap: 8px; }

.a11y-step {
  min-width: 40px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #DCD5C6;
  border-radius: 4px;
  background: #F7F5F0;
  font: inherit;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.a11y-step:hover:not(:disabled) { color: var(--stitch-red); border-color: var(--stitch-red); }
.a11y-step:disabled { opacity: 0.4; cursor: default; }

.a11y-size-value {
  min-width: 44px;
  text-align: center;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  color: var(--stitch-red);
}

.a11y-reset {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid #DCD5C6;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
}

.a11y-reset:hover { color: var(--stitch-red); border-color: var(--stitch-red); }

.a11y-toggle:focus-visible,
.a11y-step:focus-visible,
.a11y-close:focus-visible,
.a11y-reset:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 2px; }

/* Keep page content clear of the button at the very bottom */
body { padding-bottom: 0; }
@media (max-width: 1200px) {
  footer, .home-footer { padding-bottom: 84px !important; }
}

@media (max-width: 700px) {
  .a11y-root { left: 16px; bottom: 16px; }
  .a11y-btn { width: 44px; height: 44px; }
  .a11y-panel { width: calc(100vw - 32px); max-width: 340px; bottom: 56px; }
}

/* ── The settings themselves ── */

/* Text size: only text grows (font sizes use --fs / --fs-lg); images and layout stay put */

/* High contrast: darker greys and lines */
html.a11y-contrast {
  --text: #000000;
  --text-mid: #1F1F1F;
  --text-muted: #3A3A3A;
  --border: #8F8A80;
  --stitch-red: #A3161B;
}
html.a11y-contrast .chip,
html.a11y-contrast .img-caption,
html.a11y-contrast .stat-label,
html.a11y-contrast .prm-tags span { color: #2A2A2A; }

/* Readable font: every piece of text, including the pixel-font name and headings */
html.a11y-font body,
html.a11y-font body *,
html.a11y-font body *::before,
html.a11y-font body *::after {
  font-family: 'Atkinson Hyperlegible', Verdana, sans-serif !important;
}

/* The pixel-font name and headings were tuned for that font; keep them neat in the readable one */
html.a11y-font .sidebar-name { letter-spacing: -0.01em; line-height: 1.05; }
html.a11y-font .nav-logo { letter-spacing: 0; }

/* Text spacing (WCAG 1.4.12 values) */
html.a11y-spacing body p,
html.a11y-spacing body li,
html.a11y-spacing body dd,
html.a11y-spacing body figcaption,
html.a11y-spacing body td,
html.a11y-spacing body blockquote {
  line-height: 1.9 !important;
  letter-spacing: 0.06em !important;
  word-spacing: 0.16em !important;
}
html.a11y-spacing body p { margin-bottom: 1.4em; }

/* Underline links */
html.a11y-links a:not(.btn):not(.resume-btn):not(.project-row):not(.nav-logo) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
html.a11y-links .project-row .prm-name { text-decoration: underline; text-underline-offset: 3px; }

/* Stop motion */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.a11y-motion .reveal { opacity: 1 !important; transform: none !important; }

/* Grids never force a minimum wider than the screen (matters at large text sizes on phones) */
.p-meta { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.skills ul { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.checks { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
@media (max-width: 860px) { .p-meta { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { html.a11y-zoomed .p-meta { grid-template-columns: 1fr; } html.a11y-zoomed .glance-card + .glance-card { margin-top: 18px; } }
html.a11y-zoomed table { max-width: 100%; }
html.a11y-zoomed .data-table td:first-child { white-space: normal; }

/* Tiny screens at large text sizes: let the top bar and footer wrap */
.footer-left, .footer-right, .home-footer-right { flex-wrap: wrap; }
@media (max-width: 420px) {
  html.a11y-zoomed .nav-logo { font-size: 20px; }
  html.a11y-zoomed .nav-links { flex-wrap: wrap; gap: 6px 14px; }
  html.a11y-zoomed footer { padding-left: 16px; padding-right: 16px; }
}

/* Safety net: enlarged text never makes the page scroll sideways */
html.a11y-zoomed, html.a11y-zoomed body { overflow-x: clip; }

/* ── Spotlight gallery: one large screenshot + previews ── */
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 32px;
  align-items: start;
}

.gallery-main { margin: 0; }

.gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #EFEAE0;
  border-radius: 4px;
  padding: 6px;
  box-sizing: border-box;
  display: block;
  transition: opacity 0.15s ease;
}

.gallery-main img.is-swapping { opacity: 0; }

.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 6px 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #EFEAE0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.gallery-thumb span {
  display: block;
  margin-top: 6px;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 600;
  color: var(--text-mid);
}

.gallery-thumb:hover img { opacity: 1; }
.gallery-thumb:hover span { color: var(--stitch-red); }

.gallery-thumb[aria-pressed="true"] { border-color: var(--stitch-red); background: var(--red-tint, #FBEDEC); }
.gallery-thumb[aria-pressed="true"] img { opacity: 1; }
.gallery-thumb[aria-pressed="true"] span { color: var(--stitch-red); }

.gallery-thumb:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 2px; }

/* Wider than the text column on desktop, like the old thumbnail row */
@media (min-width: 900px) {
  body.project .gallery { width: calc(100% + 96px); margin-left: -48px; }
  body.project .gallery + .zoom-hint { margin-left: -48px; }
}

@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-thumbs { flex-direction: row; gap: 8px; }
  .gallery-thumb { padding: 4px 4px 6px; }
  .gallery-thumb span { font-size: calc(11px * var(--fs, 1)); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-main img, .gallery-thumb, .gallery-thumb img { transition: none; }
}

/* Balance: previews stack to roughly the main image's height */
.gallery { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.gallery-thumb { position: relative; padding: 5px; }
.gallery-thumb span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(247, 245, 240, 0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
@media (max-width: 700px) {
  .gallery-thumb span { position: static; background: none; box-shadow: none; padding: 4px 2px 0; }
}

@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-thumbs { flex-direction: row; }
  .gallery-thumb { flex: 1 1 0; min-width: 0; }
}

.gallery-thumb span b { color: var(--stitch-red); font-weight: 700; }

/* ════════════════════════════════════════════
   GUIDED WALKTHROUGH (Little Lemon screens)
════════════════════════════════════════════ */
.flow { margin-top: 28px; }

.flow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

/* Segmented switch */
.flow-tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: #EFEAE0;
  border-radius: 999px;
}

.flow-tabs button {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font: inherit;
  font-size: calc(13px * var(--fs, 1));
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.flow-tabs button:hover { color: var(--stitch-red); }

.flow-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--stitch-red);
  box-shadow: 0 1px 3px rgba(40, 30, 20, 0.12);
}

.flow-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
}

.flow-play:hover { color: var(--stitch-red); border-color: var(--stitch-red); }
.flow-play .ic-play { display: none; }
.flow.is-paused .flow-play .ic-play { display: block; }
.flow.is-paused .flow-play .ic-pause { display: none; }

.flow-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 28px;
  align-items: center;
}

/* Steps */
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-steps li[hidden] { display: none; }

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

.flow-step:hover { background: #EFEAE0; }

.flow-num {
  font-size: calc(13px * var(--fs, 1));
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 2px;
  transition: color 0.2s ease;
}

.flow-text strong {
  display: block;
  font-size: calc(15px * var(--fs, 1));
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 3px;
  transition: color 0.2s ease;
}

.flow-text > span {
  display: block;
  font-size: calc(13.5px * var(--fs, 1));
  line-height: 1.55;
  color: var(--text-muted);
}

.flow-step.is-active { background: #EFEAE0; }
.flow-step.is-active .flow-num { color: var(--stitch-red); }
.flow-step.is-active .flow-text strong { color: var(--text); }
.flow-step.is-active .flow-text > span { color: var(--text-mid); }

/* Progress bar under the active step */
.flow-bar {
  position: absolute;
  left: 60px;
  right: 14px;
  bottom: 8px;
  height: 2px;
  background: transparent;
  border-radius: 2px;
  overflow: hidden;
}

.flow-step.is-active .flow-bar { background: #DDD6C8; }
.flow-bar i { display: block; height: 100%; width: 0; background: var(--stitch-red); }

.flow-step:focus-visible,
.flow-tabs button:focus-visible,
.flow-play:focus-visible { outline: 2px solid var(--stitch-red); outline-offset: 2px; }

/* Screen card */
.flow-stage {
  display: grid;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(40, 30, 20, 0.06), 0 12px 32px rgba(40, 30, 20, 0.08);
  padding: 20px;
}

.flow-shot {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.985);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

.flow-shot.is-active { opacity: 1; visibility: visible; transform: none; }

.flow-shot img {
  width: 100%;
  height: 480px;
  object-fit: contain;
  display: block;
}

@media (max-width: 760px) {
  .flow-body { grid-template-columns: 1fr; gap: 14px; }
  .flow-stage { order: -1; padding: 12px; }
  .flow-shot img { height: 360px; }
  .flow-top { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-shot { transition: none; transform: none; }
}

/* ── Incluso! annotated design sheet, split into sections ── */
.sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
}

.sheet-part {
  margin: 0;
  background: #EFEAE0;
  border-radius: 6px;
  padding: 12px 12px 14px;
}

.sheet-part--wide { grid-column: 1 / -1; }

.sheet-part figcaption {
  font-size: calc(11px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stitch-red);
  margin: 2px 4px 10px;
}

.sheet-part img {
  width: 100%;
  display: block;
  background: #fff;
  border-radius: 4px;
}

@media (min-width: 900px) {
  body.project .sheet { width: calc(100% + 96px); margin-left: -48px; }
  body.project .sheet + .zoom-hint { margin-left: -48px; }
}

@media (max-width: 700px) {
  .sheet { grid-template-columns: 1fr; gap: 12px; }
}

/* Links inside section intros */
.sec-intro a { color: var(--stitch-red); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sec-intro a:hover { text-decoration-thickness: 2px; }

/* ── Equal Games: four-round strip ── */
.rounds {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rounds li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #EFEAE0;
  border-radius: 6px;
  padding: 14px;
}

.rounds b {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--stitch-red);
  color: #fff;
  font-size: calc(12px * var(--fs, 1));
}

.rounds strong {
  display: block;
  font-size: calc(14px * var(--fs, 1));
  color: var(--text);
  margin-bottom: 2px;
}

.rounds span {
  font-size: calc(13px * var(--fs, 1));
  line-height: 1.5;
  color: var(--text-mid);
}

/* ── Quote cards ── */
.quotes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quote {
  margin: 0;
  padding: 20px 22px 18px;
  background: #EFEAE0;
  border-radius: 6px;
  border-left: 3px solid var(--stitch-red);
}

.quote blockquote {
  margin: 0 0 10px;
  font-size: calc(17px * var(--fs, 1));
  line-height: 1.5;
  font-style: italic;
  color: var(--text);
}

.quote figcaption {
  font-size: calc(12px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

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

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