/* ============================================================
   Joel Morgan — styles.css
   Single shared stylesheet for index.html and project.html
   To customize colors/fonts, edit the :root variables below.
   For content, edit content.js.
============================================================ */

/* ====================================================
   RESET & BASE
==================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors — DARK mode (default) */
  --bg:           #0c0c0d;
  --bg-card:      #111111;
  --bg-section:   #0e0e0e;
  --border:       rgba(255,255,255,0.07);
  --text:         #f0f0f0;
  --reverse-text: #ffffff;
  --muted:        #8e8471;
  --matte:        #3a3a3a;
  --soft:         rgba(190, 190, 190, 0.69);
  --accent:       #b4ff1d;
  --accent2:      #b4ff1d;
  --accent3:      #e5972a;
  --tension:      rgba(208, 208, 202, 0.788);

  /* Layout */
  --nav-h:  64px;
  --max-w:  1200px;  /* index grid width */
  --case-w: 780px;   /* project reading width */
  --ease:   cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Nav */
  --nav-bg:    rgba(8,8,8,0.55);
  --nav-title: rgba(240,240,240,0.75);

  /* Placeholders */
  --placeholder-bg:            linear-gradient(135deg, #141414 0%, #1c1c1c 100%);
  --placeholder-text:          #2a2a2a;
  --img-opacity:               0.75;
  --decision-placeholder:      linear-gradient(135deg, #111 0%, #181818 100%);
  --decision-placeholder-text: #1e1e1e;

  /* Progress bar — dark violet, complement of neon lime */
  --progress-start: #0c4100;
  --progress-end:   #b4ff1d;
}

/* Light / Clay mode */
[data-theme="light"] {
  --bg:           #e8e8e8;
  --bg-card:      #ffffff;
  --bg-section:   #d6d6d6;
  --border:       rgba(0,0,0,0.09);
  --text:         #1a1612;
  --reverse-text: #ffffff;
  --muted:        #000000;
  --matte:        #8a8a8a;
  --soft:         rgba(22, 22, 22, 0.85);
  --accent:       #ff5e00;
  --accent2:      #252525;
  --accent3:      #ff9500;
  --tension:      rgb(37, 37, 37);
  --nav-bg:       rgba(250, 250, 250, 0.55);
  --nav-title:    rgba(26,22,18,0.7);
  --placeholder-bg:            linear-gradient(135deg, #d8d1c8 0%, #cec6bc 100%);
  --placeholder-text:          #b8b0a6;
  --img-opacity:               0.9;
  --decision-placeholder:      linear-gradient(135deg, #d4cdc4 0%, #cac2b8 100%);
  --decision-placeholder-text: #b0a89e;

  /* Progress bar — dark rust → bright orange, parallel to dark-mode lime gradient */
  --progress-start: #ffac5a;
  --progress-end:   #ff4800;
}


html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ====================================================
   THEME TOGGLE
==================================================== */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(128, 128, 128, 0.01);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--text); border-color: var(--text); }
.theme-toggle * { pointer-events: none; }
.theme-toggle svg { overflow: visible; display: block; }
.theme-toggle .icon-moon { display: block; transform: translate(0.5px, -0.5px); }
.theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

/* ====================================================
   NAV
==================================================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  transition: transform 0.3s var(--ease), background 0.4s var(--ease), border-bottom 0.4s;
}

/* Hide nav (used on project detail page when scrolled) */
#nav.nav-hidden { transform: translateY(-100%); pointer-events: none; }

/* Centered main nav links */
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 28px;
  pointer-events: none;
}

.nav-link { pointer-events: auto; }

/* Index: fades in on scroll */
#nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* Dissolve the dividing line when subnav is open — nav + subnav read as one panel */
#nav.subnav-open {
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Project: always visible */
#nav.nav-solid {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

.nav-brand {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  background: rgba(128, 128, 128, 0.01);
}

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

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  flex-shrink: 0;
  color: var(--bg);
}

.nav-logo svg {
  width: 22px;  /* ← change this to resize the logo icon */
  height: 22px;
  opacity: 1;
}

/* Outlined logo variant — used on project page back-link */
.nav-logo-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.01);
  border: 1px solid var(--border);
  margin-right: 10px;
  flex-shrink: 0;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.nav-brand:hover .nav-logo-outline {
  border-color: var(--text);
  background: rgba(128, 128, 128, 0.08);
}

.nav-logo-outline svg {
  width: 18px;
  height: 18px;
}

.nav-logo-bare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 12px;
}

.nav-logo-bare svg {
  width: 30px;
  height: 30px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 4px 8px 4px 2px;
  border-radius: 6px;
  margin-right: 8px;
  transition: color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

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

#footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-brand-sep {
  font-weight: 300;
  color: var(--muted);
  margin: 0 8px;
  opacity: 0.4;
}

.nav-brand-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 1px 6px;
  transition: border-color 0.4s ease;
}
.nav-brand-sub.badge-ready {
  border-color: var(--accent);
}

/* Centered project title */
.nav-project-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--nav-title);
  white-space: nowrap;
  pointer-events: none;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prev/Next arrows */
.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.nav-arrow:hover { color: var(--text); border-color: var(--text); }
.nav-arrow svg { overflow: visible; display: block; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  transition: color 0.2s, text-shadow 0.15s;
}

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

.nav-link.active {
  color: var(--text);
  font-weight: 700;
}

/* Smaller nav links for project page nav-right */
.nav-link-sm {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-link-sm:hover { color: var(--text); }

/* ====================================================
   SECONDARY NAV (subnav — drops below main nav in Work section)
==================================================== */
/* Subnav extends from top: 0 so it fills behind the main nav too —
   no seam, one uniform background. Main nav (z-index 100) sits on top. */
#subnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + 150px);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nav-h) 48px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  transform: translateY(-100%);
  transition: transform 0.36s var(--ease);
}

#subnav.subnav-visible { transform: translateY(0); pointer-events: auto; }

.subnav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: var(--max-w);
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.subnav-links::-webkit-scrollbar { display: none; }

/* Delay reveal until panel has cleared the main nav */
#subnav.subnav-visible .subnav-links {
  opacity: 1;
  transition-delay: 0.22s;
}

/* Thumbnail card */
.subnav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 0.2s;
}
.subnav-link:hover { opacity: 1; }
.subnav-links:hover .subnav-link { opacity: 0.45; }
.subnav-links:hover .subnav-link:hover { opacity: 1; }

.subnav-thumb {
  height: 40px;
  width: 80px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: var(--bg-card);
}

/* Logo variant — neutral bg, centered, don't crop */
.subnav-thumb.subnav-thumb--logo {
  object-fit: contain;
  padding: 0;
  background: transparent;
  border: none;
}

[data-theme="dark"] .subnav-thumb.subnav-thumb--logo {
  filter: invert(1);
}

.subnav-thumb-placeholder {
  height: 100px;
  width: 120px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.subnav-link-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  text-align: center;
  transition: color 0.2s;
}
.subnav-link:hover .subnav-link-label { color: var(--text); }
.subnav-link.active .subnav-link-label { color: var(--text); }

/* ====================================================
   PROJECT DETAIL — STICKY CONTEXT BAR
==================================================== */
#project-subnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  transition: transform 0.3s var(--ease);
}

/* Hide project subnav when main nav is visible */
#project-subnav.subnav-hidden { transform: translateY(-100%); pointer-events: none; }

#project-subnav.subnav-open {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}

.project-subnav-back {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: color 0.2s;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.project-subnav-back:hover { color: var(--text); border-color: var(--text); }

.project-subnav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--nav-title);
  white-space: nowrap;
  pointer-events: none;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-subnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ====================================================
   FADE-UP ANIMATION
==================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ====================================================
   INDEX — HERO
==================================================== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-h) 24px 32px;
  position: relative;
  overflow: hidden;
  max-width: none;
  width: 100%;
  margin: 0;
}

.hero-bg {
  position: absolute;
  top: -15%; bottom: -15%;
  left: 0; right: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  will-change: transform;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(8,8,8,0.08) 0%, rgba(8,8,8,0.4) 100%),
    linear-gradient(to top, rgb(17, 12, 26) 0%, rgba(18, 31, 34, 0.8) 100%);
}

[data-theme="light"] .hero-bg::after {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0) 100%, rgba(255, 255, 255, 0.82) 0%),
    linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(224,224,224,.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -80px;
}

.hero-eyebrow {
  text-transform: uppercase;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent2);
  margin-bottom: 16px;
}

#eyebrow-w1::after { content: '\00a0'; } /* space between words on desktop */

.hero-name {
  font-size: clamp(52px, 9vw, 120px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 34px;
}

.hero-tagline {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 500;
  color: var(--text);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 56px;
}

.hero-cta { display: none; }
.hero-cta:hover {}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  color: var(--muted);
  opacity: 0.6;
  animation: scrollbob 2.4s ease-in-out infinite;
  text-decoration: none;
}

.scroll-arrow {
  display: block;
}

@keyframes scrollbob {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.4; }
  50%       { transform: translateX(-50%) translateY(6px); opacity: 0.8; }
}

/* ====================================================
   INDEX — SECTIONS
==================================================== */
section {
  padding: 120px 48px;
}

/* ====================================================
   SECTION CARD STACK  (Work, Contact, Footer)
==================================================== */
.section-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 0;
}

.section-card {
  background: var(--bg-card);
  border-radius: 0;
  overflow: hidden;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

[data-theme="light"] .section-label {
  font-weight: 600;
}

/* ====================================================
   INDEX — WORK / PROJECTS GRID
==================================================== */
#work  { width: 100%; scroll-margin-top: var(--nav-h); text-align: center; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.project-card {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.08);
}

.project-card:first-child {
  grid-column: 1 / -1;
  aspect-ratio: 16/7;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.4s;
  opacity: var(--img-opacity);
}

.project-card:hover .project-img {
  transform: scale(1.04);
  opacity: 1;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: var(--placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--placeholder-text);
  font-size: 48px;
  font-weight: 300;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 40%, transparent 72%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 32px;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.project-card:hover .project-overlay { opacity: 1; }

.project-meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--reverse-text);
  margin-bottom: 8px;
}

.project-title {
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--reverse-text);
  margin-bottom: 8px;
}

.project-info-static { padding: 20px 0 4px; }

/* ====================================================
   INDEX — CONTACT
==================================================== */
#contact {
  text-align: center;
}

.contact-heading {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.contact-sub {
  font-size: 24px;
  color: var(--tension);
  margin: 0 auto 48px;
  max-width: 800px;
  text-align: center;
}

.contact-email {
  display: inline-block;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 48px;
  transition: border-color 0.2s;
}

.contact-email:hover { border-color: var(--accent); }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.contact-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

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

/* ====================================================
   INDEX — FOOTER
==================================================== */
footer {
  padding: 64px 48px 0;
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s;
}

.footer-brand-link:hover { color: var(--text); }

#footer-copy {
  font-size: 12px;
  color: var(--muted);
}

#footer-oneliner {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.5;
  font-style: italic;
}

/* ====================================================
   PROJECT — HERO
==================================================== */
.hero-image-wrap {
  width: 100%;
  height: 75vh;
  margin-top: 0;
  overflow: hidden;
  position: relative;
}

@keyframes heroZoom {
  from { transform: scale(1.04); }
  to   { transform: scale(1.0); }
}

.hero-image-wrap .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  display: block;
  will-change: transform;
  backface-visibility: hidden;
  /* Delay matches vt-in (280ms) so zoom starts after the page-transition fade completes */
  animation: heroZoom 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 260ms both;
}

/* Project page hero — logo overlay */
.hero-logo-overlay {
  position: absolute;
  bottom: 28px;
  right: 36px;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}

/* Project card — logo overlay */
.card-logo-overlay {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.35s var(--ease);
}
.project-card:hover .card-logo-overlay { opacity: 0.9; }

.hero-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 300;
  color: var(--placeholder-text);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 72px 48px 0;
}

.hero-title {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  margin-top: 2px;
}

[data-theme="light"] .hero-subtitle { color: var(--muted); }

.hero-positioning {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 300;
  font-style: italic;
  color: var(--soft);
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 48px;
}

.hero-meta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.meta-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-value {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--soft);
  text-transform: none;
  overflow-wrap: break-word;
}

/* ====================================================
   PROJECT — CASE SECTIONS
==================================================== */
.case-section {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 96px 48px 0;
}

.section-eyebrow {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  position: relative;
}

.section-eyebrow::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.section-body {
  font-size: 17px;
  font-weight: 400;
  color: var(--soft);
  line-height: 1.9;
}

.section-body p + p { margin-top: 1.6em; }

.section-lede {
  font-size: 21px;
  font-weight: 400;
  color: var(--tension);
  line-height: 1.55;
  margin-top: -20px;
  margin-bottom: 2em;
  position: relative;
}

.section-lede::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.eyebrow-num {
  display: block;
  color: inherit;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.image-caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 40px;
}

.tension {
  margin-top: 1.8em;
  padding-top: 1.8em;
  border-top: 1px solid var(--border);
  font-size: 23px;
  font-weight: 400;
  color: var(--tension);
  line-height: 1.6;
  position: relative;
}

.tension::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 1.8em;
  bottom: 0;
  width: 2px;
  background: var(--accent3);
  opacity: 1;
}

/* ====================================================
   AT A GLANCE
==================================================== */
.at-a-glance {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 80px 24px 0;
}

.ata-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ata-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  margin-left: 24px;
  position: relative;
}

.ata-label::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.ata-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ata-list li {
  display: grid;
  grid-template-columns: 26% 1fr;
  gap: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.ata-list li:last-child { border-bottom: none; }

.ata-phase {
  grid-column: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
  padding-right: 32px;
}

.ata-text {
  grid-column: 2;
  font-size: 14px;
  line-height: 1.6;
  color: var(--soft);
  opacity: 1;
}

/* ====================================================
   SECTION MAP
==================================================== */
.section-map {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 90;
  opacity: 0;
  transition: opacity 0.5s;
}

.section-map.s-visible { opacity: 1; }

.smap-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.smap-dot-inner {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.4;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.smap-dot.visited .smap-dot-inner {
  background: var(--accent);
  opacity: 0.3;
}

.smap-dot.active .smap-dot-inner {
  background: var(--accent);
  transform: scale(1.6);
  opacity: 1;
}

.smap-label {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.smap-dot:hover .smap-label { opacity: 1; }

@media (max-width: 1100px) { .section-map { display: none; } }
@media (max-width: 768px)  {
  .at-a-glance { padding: 60px 24px 0; }
  .ata-list li { grid-template-columns: 1fr; gap: 4px; }
  .ata-phase   { grid-column: 1; }
  .ata-text    { grid-column: 1; }
}

/* ====================================================
   PROJECT — DECISIONS
==================================================== */
.decisions-wrap {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 96px 48px 0;
}

.decision {
  padding-top: 64px;
  margin-top: 64px;
  border-top: 1px solid var(--border);
}

.decision:first-child {
  padding-top: 0;
  margin-top: 32px;
  border-top: none;
}

.decision-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.decision-body {
  font-size: 16px;
  font-weight: 400;
  color: var(--soft);
  line-height: 1.9;
}

.decision-image {
  width: calc(100% + 96px);
  margin-left: -48px;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

.decision-image img { width: 100%; display: block; opacity: 1; }

.decision-image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.decision-image-pair img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

/* Images inside Problem / Synthesis / other case sections */
.section-media { margin-top: 48px; }
.section-media + .section-media { margin-top: 24px; }

.intro-image-wrap {
  max-width: var(--case-w);
  margin: 48px auto 0;
  padding: 0 48px;
  border-radius: 10px;
  overflow: hidden;
}

.intro-image-wrap img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

/* Interior section images (excluding hero) */
.section-body img {
  max-width: 100%;
  display: block;
  border-radius: 10px;
}

.decision-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--decision-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--decision-placeholder-text);
  font-size: 48px;
  font-weight: 300;
}

/* ====================================================
   CAROUSEL — reusable component
   Markup:
     .carousel > .carousel-track > .carousel-slide > img
     .carousel > .carousel-arrow.carousel-prev | .carousel-next
     .carousel > .carousel-dots > .carousel-dot
==================================================== */
.carousel {
  position: relative;
  width: calc(100% + 96px);
  margin-left: -48px;
  margin-top: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--placeholder-bg);
  transition: height 0.3s ease;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: block;
}
.carousel-slide img {
  width: 100%;
  display: block;
  opacity: 1;
}
.carousel-slide-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--decision-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--decision-placeholder-text);
  font-size: 48px;
  font-weight: 300;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.carousel-arrow:hover { background: rgba(0, 0, 0, 0.8); }
.carousel-arrow:focus-visible { opacity: 1; outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }
.carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
.carousel-prev { left: 56px; }
.carousel-next { right: 56px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
  /* pill backdrop so dots are legible over any slide content */
  width: fit-content;
  margin: 0 auto;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, width 0.2s ease, border-radius 0.2s ease;
}
.carousel-dot:hover { background: rgba(255, 255, 255, 0.7); }
.carousel-dot.active {
  background: rgba(255, 255, 255, 0.95);
  width: 22px;
  border-radius: 4px;
}

/* ====================================================
   PROJECT — OUTCOME
==================================================== */
.outcome-wrap {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 96px 48px 0;
}

.outcome-summary {
  font-size: 17px;
  font-weight: 400;
  color: var(--soft);
  line-height: 1.9;
  margin-bottom: 40px;
}

.outcome-points {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.outcome-point {
  font-size: 14px;
  font-weight: 400;
  color: var(--soft);
  line-height: 1.7;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.outcome-point::before {
  content: '—';
  color: var(--muted);
  flex-shrink: 0;
  font-weight: 300;
}

/* ====================================================
   PROJECT — CASE TABLE
==================================================== */
.case-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
}

.case-table thead tr { border-bottom: 1px solid var(--border); }

.case-table th {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 14px;
  text-align: left;
}

.case-table th:first-child { width: 26%; }

.case-table td {
  font-size: 14px;
  font-weight: 400;
  color: var(--soft);
  line-height: 1.75;
  padding: 20px 20px 20px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.case-table td:first-child {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tension);
  padding-right: 32px;
  width: 26%;
}

/* Goals table (Business Goal / User Goal) — label style matches ata-phase */
.goals-table td:first-child,
.outcome-table td:first-child {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ====================================================
   PROJECT — NEXT PROJECT
==================================================== */
.next-wrap {
  max-width: var(--case-w);
  margin: 120px auto 0;
  padding: 64px 48px 120px;
  border-top: 1px solid var(--border);
}

.next-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.next-title {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text);
  transition: opacity 0.2s;
}

.next-title:hover { opacity: 0.5; }

/* ====================================================
   PROJECT — NOT FOUND
==================================================== */
.not-found {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  color: var(--muted);
}

/* ====================================================
   PASSWORD GATE
==================================================== */
.password-gate {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px;
}

.password-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.password-title {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 48px;
}

.password-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.password-input {
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 24px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  width: 220px;
  letter-spacing: 0.06em;
}

.password-input::placeholder { color: var(--muted); }

.password-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.password-btn:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .password-btn:hover { background: rgba(0,0,0,0.04); }

.password-error {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-height: 18px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.shake { animation: shake 0.35s ease-in-out; }

/* ====================================================
   RESPONSIVE
==================================================== */

/* Tablet — hide centered nav links before they crowd */
@media (max-width: 1024px) {
  .nav-links   { display: none; }
  .nav-link-sm { display: none; }
}

/* Section map: hide on anything touch-sized */
@media (max-width: 768px) {
  .section-map { display: none; }
}

@media (max-width: 768px) {
  /* ---- Nav ---- */
  #nav { padding: 0 24px; height: 60px; }
  #project-subnav { height: 60px; }
  .nav-project-title { display: none; }
  #subnav { display: none; }
  .nav-brand     { font-size: 14px; letter-spacing: 0.03em; }
  .nav-brand-sub { font-size: 14px; letter-spacing: 0.03em; }
  .nav-brand-sep { margin: 0 5px; }
  .nav-right     { gap: 14px; }

  /* ---- Project subnav ---- */
  #project-subnav { padding: 0 20px; }
  /* Theme toggle is accessible via hamburger menu on mobile — hide the icon in the subnav */
  #project-subnav .theme-toggle { display: none; }
  /* Read mode button removed from subnav on mobile — accessible via read time pill */
  #project-subnav .read-mode-btn { display: none; }
  /* Show project name — right side is now clear so title has room */
  .project-subnav-title { display: block; max-width: 60vw; font-size: 15px; }

  /* ---- Prev/next arrows replaced by swipe on mobile ---- */
  .nav-arrow { display: none; }

  /* ---- Touch targets: enlarge all interactive subnav elements ---- */
  .project-subnav-back,
  .read-mode-btn,
  .theme-toggle,
  .hamburger { min-width: 44px; min-height: 44px; }

  /* ---- Utility: line break visible only on mobile ---- */
  .mobile-br { display: block; }

  /* ---- Logo mark stays in normal flow on the left ---- */
  .nav-logo,
  .nav-logo-outline {
    position: static;
    transform: none;
  }

  /* ---- Index section cards — full width, text constrained to 70% width ---- */
  section { padding: 72px 15%; }
  .section-card { padding: 72px 15%; }
  .about-section { padding: 72px 15%; }
  /* ID overrides needed: #about is beaten by later 960px block; #hero has hardcoded px padding */
  #about { padding-left: 15%; padding-right: 15%; }
  #hero  { padding-left: 15%; padding-right: 15%; }
  /* Project tiles go full width — edge-to-edge */
  #work { padding-left: 0; padding-right: 0; }

  /* ---- Section card stack — full width, no side gap ---- */
  .section-stack { gap: 8px; padding: 0 0 12px; }

  /* ---- Hero (index) ---- */
  .hero-tagline { font-size: clamp(15px, 4.5vw, 18px); margin-bottom: 40px; }
  .hero-eyebrow { display: flex; flex-direction: column; align-items: center; gap: 4px; }
  #eyebrow-w1::after { content: none; }
  .hero-content { margin-top: -70px; }

  /* ---- Projects grid — single column tiles on mobile ---- */
  .projects-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 16px; }
  .project-card           { aspect-ratio: 4/3; border-radius: 10px; }
  .project-card:first-child { grid-column: auto; aspect-ratio: 4/3; }
  .project-overlay { opacity: 1; }
  #work { padding-left: 0; padding-right: 0; }

  /* ---- Contact ---- */
  .contact-sub { font-size: 17px; margin-bottom: 36px; }
  .contact-links { gap: 24px; flex-wrap: wrap; justify-content: center; }

  /* ---- Footer ---- */
  footer { padding: 40px 32px 0; }
  .footer-center { padding: 12px 0; }

  /* ---- Project detail page ---- */
  .hero-image-wrap { margin-top: 60px; height: 88vw; min-height: 340px; }
  .hero-text       { padding: 36px 40px 0; }
  .hero-title      { letter-spacing: -0.03em; }
  .hero-subtitle   { font-size: 11px; }
  .hero-meta       { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
  .case-section    { padding: 48px 40px 0; }
  .decisions-wrap  { padding: 48px 40px 0; }
  .outcome-wrap    { padding: 48px 40px 0; }
  .decision-title  { font-size: 20px; }
  .decision-image  { width: 100%; margin-left: 0; border-radius: 8px; }
  .carousel        { width: 100%; margin-left: 0; border-radius: 8px; }
  .carousel-prev   { left: 12px; }
  .carousel-next   { right: 12px; }
  /* Carousel arrows: always visible on touch, enlarged to meet 44px HIG */
  .carousel-arrow  { width: 44px; height: 44px; opacity: 1; background: rgba(0, 0, 0, 0.45); }
  /* Carousel dots: larger tap target on touch */
  .carousel-dot         { width: 10px; height: 10px; }
  .carousel-dot.active  { width: 28px; }
  .next-wrap       { padding: 40px 40px 72px; margin-top: 64px; }

  /* ---- At a glance ---- */
  .at-a-glance { padding: 48px 40px 0; }
  .ata-label   { font-size: 24px; margin-left: 0; }

  /* ---- Read time pill ---- */
  .read-time-pill-wrap { padding: 40px 40px 0; }

  /* ---- Section eyebrow + number sizes ---- */
  .section-eyebrow { font-size: 20px; }
  .eyebrow-num     { font-size: 22px; }

  /* ---- Section eyebrow left rule ---- */
  .section-eyebrow::before,
  .ata-label::before,
  .section-lede::before,
  .tension::before { left: -14px; }

  /* ---- Goals table — label column larger on mobile ---- */
  .case-table td:first-child { font-size: 14px; }

  /* ---- Outcome + Synthesis tables — stack like at-a-glance on mobile ---- */
  .outcome-table,
  .outcome-table tbody,
  .outcome-table tr,
  .outcome-table td,
  .synthesis-table,
  .synthesis-table tbody,
  .synthesis-table tr,
  .synthesis-table td { display: block; width: 100%; }
  .outcome-table thead,
  .synthesis-table thead { display: none; }
  .outcome-table td:first-child,
  .synthesis-table td:first-child {
    width: 100%;
    padding-bottom: 2px;
    padding-top: 16px;
    border-bottom: none;
  }
  .outcome-table td:last-child,
  .synthesis-table td:last-child {
    padding-top: 2px;
    padding-bottom: 16px;
  }

  /* ---- Hero logo — tighter to corner on mobile ---- */
  .hero-logo-overlay { bottom: 14px; right: 14px; }

  /* ---- Intro image — edge-to-edge on mobile ---- */
  .intro-image-wrap { padding: 0; border-radius: 0; }
  .intro-image-wrap img { border-radius: 0; }

  /* ---- Password gate ---- */
  .password-input { width: 100%; font-size: 16px; /* prevent iOS zoom */ }
  .password-form  { border-radius: 12px; flex-direction: column; }
  .password-btn   { border-left: none; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; padding: 14px; }
}

/* Small phones — additional tightening below 480px */
@media (max-width: 480px) {
  /* ---- Nav ---- */
  #nav             { padding: 0 20px; }
  #project-subnav  { padding: 0 20px; }

  /* ---- Index section cards ---- */
  section        { padding: 64px 15%; }
  .section-card  { padding: 64px 15%; }
  .about-section { padding: 64px 15%; }
  #about { padding-left: 15%; padding-right: 15%; }
  #hero  { padding-left: 15%; padding-right: 15%; }
  #work  { padding-left: 0; padding-right: 0; }
  .projects-grid { padding: 0 12px; gap: 8px; }

  /* ---- Hero image ---- */
  .hero-image-wrap { height: 82vw; min-height: 310px; }

  /* ---- Hero text ---- */
  .hero-text       { padding: 28px 32px 0; }
  .hero-meta       { grid-template-columns: 1fr 1fr; gap: 16px 12px; }

  /* ---- Case sections ---- */
  .case-section    { padding: 40px 32px 0; }
  .decisions-wrap  { padding: 40px 32px 0; }
  .outcome-wrap    { padding: 40px 32px 0; }
  .at-a-glance     { padding: 40px 32px 0; }
  .read-time-pill-wrap { padding: 32px 32px 0; }
  .next-wrap       { padding: 32px 32px 56px; }

  /* ---- Read mode spacing ---- */
  body.read-mode .case-section,
  body.read-mode .decisions-wrap,
  body.read-mode .outcome-wrap { padding-top: 32px; }
}


/* Mobile landscape — prevent hero from consuming entire viewport height */
@media (max-width: 900px) and (orientation: landscape) {
  #hero            { min-height: 100svh; }
  .hero-image-wrap { height: 55vw; min-height: 220px; }
  /* Reset the mobile negative pull-up so cipher text clears the nav */
  .hero-content    { margin-top: 0; }
}


/* ====================================================
   VIEW TRANSITIONS
==================================================== */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 200ms ease both vt-out; }
::view-transition-new(root) { animation: 280ms ease both vt-in; }

@keyframes vt-out { to   { opacity: 0; transform: translateY(-5px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(6px);  } }

/* MK screen shake — applied to <html> via JS */
@keyframes mkShake {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  15%     { transform: translate(-8px, 3px) rotate(-0.5deg); }
  30%     { transform: translate(8px,-3px) rotate( 0.5deg); }
  50%     { transform: translate(-6px, 2px) rotate(-0.3deg); }
  70%     { transform: translate(6px,-1px) rotate( 0.3deg); }
  85%     { transform: translate(-3px, 0px); }
}
html.mk-shake { animation: mkShake 0.45s ease !important; }


/* ====================================================
   SCROLL PROGRESS BAR (project page)
==================================================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(
    to right,
    var(--progress-start) 0%,
    color-mix(in srgb, var(--progress-end) 55%, transparent) 28%,
    var(--progress-end) 100%
  );
  z-index: 1001;
  pointer-events: none;
  transition: width 0.06s linear;
}


/* ====================================================
   LIGHTBOX
==================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox img {
  max-width: 88vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 16px;
  animation: none !important;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  color: rgba(255,255,255,0.55);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lightbox-close:hover { color: #ffffff; border-color: #ffffff; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: none;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  color: rgba(255,255,255,0.65);
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  z-index: 1;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #ffffff;
  border-color: #ffffff;
  background: rgba(255,255,255,0.08);
}


/* ====================================================
   HAMBURGER + MOBILE MENU
==================================================== */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ham-bar {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}

.ham-bar-1 { width: 22px; }
.ham-bar-2 { width: 14px; }

.hamburger.open .ham-bar-1 {
  transform: translateY(4.25px) rotate(45deg);
  width: 20px;
}
.hamburger.open .ham-bar-2 {
  transform: translateY(-4.25px) rotate(-45deg);
  width: 20px;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: color 0.2s, border-color 0.2s;
}
.mobile-menu.open .mobile-menu-close {
  animation: menuIn 0.35s ease 0.08s forwards;
}
.mobile-menu-close:hover { color: var(--text); border-color: var(--text); }
.mobile-menu-close * { pointer-events: none; }

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-link {
  font-size: clamp(32px, 10vw, 52px);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--muted);
  padding: 10px 0;
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: color 0.2s;
}

.mobile-menu.open .mobile-menu-link {
  animation: menuIn 0.35s ease forwards;
}
.mobile-menu.open .mobile-menu-link:nth-child(1) { animation-delay: 0.04s; }
.mobile-menu.open .mobile-menu-link:nth-child(2) { animation-delay: 0.09s; }
.mobile-menu.open .mobile-menu-link:nth-child(3) { animation-delay: 0.14s; }
.mobile-menu.open .mobile-menu-link:nth-child(4) { animation-delay: 0.19s; }

.mobile-menu-link:hover { color: var(--text); }

.mobile-menu-theme {
  margin-top: 36px;
  opacity: 0;
}
.mobile-menu.open .mobile-menu-theme {
  animation: menuIn 0.35s ease 0.25s forwards;
}

@keyframes menuIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .hamburger              { display: flex; }
  .nav-right .theme-toggle { display: none; }
}

/* ====================================================
   READ TIME PILL
==================================================== */
.read-time-pill-wrap {
  max-width: var(--case-w);
  margin: 0 auto;
  padding: 64px 48px 0;
}

.read-time-pill {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--accent2);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
  line-height: 1;
}

@media (max-width: 768px) {
  .read-time-pill-wrap { padding: 40px 24px 0; }
}

/* ====================================================
   READ MODE — TOGGLE BUTTON
==================================================== */
.read-mode-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.read-mode-btn:hover  { color: var(--text); border-color: var(--text); }
.read-mode-btn.active { color: var(--accent); border-color: var(--accent); }
.read-mode-btn * { pointer-events: none; }

/* ====================================================
   READ MODE — SECTION COLLAPSE
==================================================== */

/* Clickable headers in read mode */
body.read-mode .rm-header {
  cursor: pointer;
  user-select: none;
}
body.read-mode .rm-header:hover { color: var(--text); }

/* Expand / collapse indicator — chevron inside a circle, rotates 90° when open */
.rm-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  pointer-events: none;
  flex-shrink: 0;
  vertical-align: middle;
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
body.read-mode .rm-expand-icon          { opacity: 0.35; }
body.read-mode .rm-open .rm-expand-icon { opacity: 0.85; transform: rotate(90deg); }

/* Collapse heavy content */
body.read-mode .section-body,
body.read-mode .section-media,
body.read-mode .case-table,
body.read-mode .tension,
body.read-mode .decision-body,
body.read-mode .decision-image,
body.read-mode .carousel,
body.read-mode .outcome-summary,
body.read-mode .ata-card,
body.read-mode .intro-image-wrap { display: none; }

/* Re-show on expanded sections */
body.read-mode .rm-open .section-body    { display: block; }
body.read-mode .rm-open .section-media   { display: block; }
body.read-mode .rm-open .case-table      { display: table; }
body.read-mode .rm-open .tension         { display: block; }
body.read-mode .rm-open .decision-body   { display: block; }
body.read-mode .rm-open .decision-image  { display: block; }
body.read-mode .rm-open .carousel        { display: block; }
body.read-mode .rm-open .outcome-summary { display: block; }
body.read-mode .rm-open .ata-card        { display: block; }
body.read-mode .rm-open .intro-image-wrap { display: block; }

/* Tighten spacing between collapsed sections in read mode */
body.read-mode .case-section,
body.read-mode .decisions-wrap,
body.read-mode .outcome-wrap { padding-top: 48px; }
body.read-mode .decision      { padding-top: 20px; margin-top: 20px; }
body.read-mode .decision:first-child { margin-top: 16px; }
body.read-mode .section-lede  { margin-bottom: 0; }
body.read-mode .at-a-glance   { padding-top: 40px; }

/* ====================================================
   ABOUT — inline home-page section
==================================================== */
.about-section {
  padding: 80px 48px;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 28px;
  /* border: 2px solid var(--accent); */
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* light/dark avatar swap */
.about-avatar .avatar-light { display: none; }
[data-theme="light"] .about-avatar .avatar-dark  { display: none; }
[data-theme="light"] .about-avatar .avatar-light { display: block; }

[data-theme="light"] .about-avatar {
  background: #e0e0d8;
}

.about-inline-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-inline-name {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 14px;
}

.about-inline-tag {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

/* Mobile line-break utility — hidden on desktop */
.mobile-br { display: none; }

[data-theme="light"] .about-inline-tag {
  color: var(--muted);
  font-weight: 600;
}

.about-inline-bio {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  color: var(--soft);
  line-height: 1.7;
}

[data-theme="light"] .about-inline-bio {
  font-weight: 400;
}

.about-inline-bio p + p {
  margin-top: 1.2em;
}

/* Single-column variant (no skills col) */
.about-inline-single {
  grid-template-columns: 1fr;
  max-width: 880px;
  text-align: center;
}

.about-inline-single .about-inline-bio {
  margin: 0 auto;
  max-width: 520px;
}

/* Skills column */
.skills-col-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-group-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  margin-bottom: 10px;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-chip {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 13px;
  border-radius: 100px;
  transition: color 0.2s, border-color 0.2s;
}

.skill-chip:hover {
  color: var(--text);
  border-color: var(--text);
}

@media (max-width: 960px) {
  .about-inline-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-section {
    padding: 64px 24px;
  }
}
