/* Fonts loaded via <link> in HTML — no @import needed */

/* ── Design tokens ── */
:root {
  --bg:          #f4ede3;
  --surface:     #ede6d8;
  --surface-2:   #e5ddd0;
  --text:        #1c1309;
  --muted:       #7a6852;
  --border:      rgba(28, 19, 9, 0.14);
  --border-solid: #d5ccbf;
  --btn-primary-bg: #1c1309;
  --btn-primary-fg: #f4ede3;
  --custom-cursor-accent: #4ee44e;
  --custom-cursor-background: #1c1309;
  --custom-cursor-font: 'Host Grotesk', system-ui, sans-serif;
  --custom-cursor-z-index: 9999;

  /* placeholder gradients for cards without images */
  --placeholder-a: linear-gradient(135deg, #e5ddd0 0%, #d8cfbf 100%);
  --placeholder-b: linear-gradient(135deg, #dfd8cc 0%, #cfc5b5 100%);

  /* typography */
  --font-serif:   'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-grotesk: 'Host Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

/* Remove tap highlight on all interactive elements */
a, button { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.05; }
p { margin: 0; }

/* ── Custom cursor ── */
@media (any-pointer: fine) {
  html.custom-cursor-enabled,
  html.custom-cursor-enabled *,
  html.custom-cursor-enabled *::before,
  html.custom-cursor-enabled *::after {
    cursor: none !important;
  }
}

.custom-cursor-dot,
.custom-cursor-label,
.custom-cursor-pen {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.custom-cursor-dot {
  z-index: var(--custom-cursor-z-index);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--custom-cursor-accent);
  transition: background 0.2s, opacity 0.15s;
}

.custom-cursor-label {
  z-index: calc(var(--custom-cursor-z-index) - 1);
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--custom-cursor-accent);
  color: var(--custom-cursor-background);
  font: 700 13px/1.2 var(--custom-cursor-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: background 0.2s, color 0.2s, opacity 0.15s;
}

.custom-cursor-pen {
  z-index: var(--custom-cursor-z-index);
  width: 22px;
  height: 22px;
  color: var(--custom-cursor-accent);
  opacity: 0;
  transition: color 0.2s, opacity 0.15s;
}

.custom-cursor-pen svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.custom-cursor-hover .custom-cursor-dot,
body.custom-cursor-pen-mode .custom-cursor-dot {
  opacity: 0;
}

body.custom-cursor-hover .custom-cursor-label,
body.custom-cursor-pen-mode .custom-cursor-pen {
  opacity: 1;
}

body.custom-cursor-pen-mode .custom-cursor-label {
  opacity: 0;
}

body.custom-cursor-contrast .custom-cursor-dot,
body.custom-cursor-contrast .custom-cursor-label {
  background: var(--custom-cursor-background);
  box-shadow: 0 0 0 1px var(--custom-cursor-accent);
}

body.custom-cursor-contrast .custom-cursor-label {
  color: var(--custom-cursor-accent);
}

body.custom-cursor-contrast .custom-cursor-pen {
  color: var(--custom-cursor-background);
  filter: drop-shadow(0 0 1px var(--custom-cursor-accent));
}

body.custom-cursor-clicking .custom-cursor-label,
body.custom-cursor-clicking .custom-cursor-pen {
  opacity: 0;
}

body.custom-cursor-clicking .custom-cursor-dot {
  opacity: 1;
}

/* ── Layout ── */
.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.section { padding: 6rem 0; }
.section-light { background: transparent; }
.section-dark  { background: var(--surface); }

/* ── Header / Nav ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 237, 227, 0.92);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  gap: 1rem;
}

.brand {
  font-family: var(--font-grotesk);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-grotesk);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.18s;
}

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

/* ── Buttons ── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  border-radius: 2px;
  border: 1px solid transparent;
  font-family: var(--font-grotesk);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
  touch-action: manipulation;
  min-height: 44px;
}

.button:hover { opacity: 0.82; }

.button-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-solid);
}

/* ── Eyebrow / Label ── */
.eyebrow {
  font-family: var(--font-grotesk);
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ── Hero ── */
.hero {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5.5vw, 6.5rem);
  max-width: 20ch;
  margin-top: 0.5rem;
  letter-spacing: -0.02em;
  font-weight: 400;
  line-height: 1.02;
  font-style: normal;
}

.hero-text {
  font-family: var(--font-body);
  color: var(--muted);
  max-width: 40ch;
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 3rem;
}

/* ── Section Headings ── */
.section-heading { margin-bottom: 4rem; }

.section-heading span {
  display: block;
  font-family: var(--font-grotesk);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 3.5vw, 4rem);
  max-width: 22ch;
  letter-spacing: -0.015em;
  font-weight: 400;
  line-height: 1.05;
}

/* ── About ── */
.about-content p {
  font-family: var(--font-body);
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 1.1rem;
  line-height: 1.85;
  font-size: 0.975rem;
}

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

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-grotesk);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--border-solid);
  padding: 0.28rem 0.7rem;
  border-radius: 2px;
}

/* ── Project Cards (home featured) ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: 2px;
}

.project-card-with-img {
  padding: 0;
  overflow: hidden;
}

.project-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.project-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.project-card-body .tags { margin-bottom: 0.85rem; }

.project-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.project-card-body p {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.featured-cta {
  margin-top: 3.5rem;
  display: flex;
  justify-content: center;
}

/* ── Writing Section ── */
.writing-block { max-width: 48rem; }

.about-content-p {
  font-family: var(--font-body);
  color: var(--muted);
  line-height: 1.85;
  font-size: 0.975rem;
  margin-bottom: 2rem;
  max-width: 52ch;
}

/* ── Page Hero (interior pages) ── */
.page-hero {
  padding: 6rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5.5vw, 5.5rem);
  margin-top: 0.5rem;
  letter-spacing: -0.025em;
  font-weight: 400;
  line-height: 1;
}

.page-hero-text {
  font-family: var(--font-body);
  color: var(--muted);
  max-width: 52ch;
  margin: 1.25rem 0 0;
  font-size: 0.975rem;
  line-height: 1.8;
}

/* ── Work Page ── */
.work-section { padding-top: 0; }

.work-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.work-count {
  font-family: var(--font-grotesk);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.work-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.work-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-grotesk);
  padding: 0.35rem 1rem;
  border: 1px solid var(--border-solid);
  background: transparent;
  color: var(--muted);
  border-radius: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  touch-action: manipulation;
  min-height: 44px;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pill:hover {
  color: var(--text);
  border-color: var(--text);
}

.filter-pill.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.wk-card {
  background: var(--surface);
  border: 1px solid var(--border-solid);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.2s;
  text-decoration: none;
  display: block;
}

.wk-card:hover { border-color: var(--muted); }

.wk-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.wk-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.wk-card:hover .wk-card__image img { transform: scale(1.04); }

.wk-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wk-card__image--gradient-a { background: var(--placeholder-a); }
.wk-card__image--gradient-b { background: var(--placeholder-b); }

.wk-card__placeholder-label {
  font-family: var(--font-grotesk);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
}

.wk-card__body { padding: 1.75rem; }

.wk-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wk-card__year {
  font-family: var(--font-grotesk);
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.wk-card__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.wk-card__desc {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.75;
}

.work-empty {
  font-family: var(--font-grotesk);
  text-align: center;
  color: var(--muted);
  padding: 4rem 0;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

/* ── Hero Photo (index) ── */
.hero-photo {
  width: 100%;
  overflow: hidden;
  padding: 4rem 0;
  background: var(--surface);
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .hero-photo {
    padding: 0;
  }
  .hero-photo img {
    aspect-ratio: 4 / 3;
  }
}

/* ── Resume Tabs ── */
.resume-tabs { max-width: 800px; }

.resume-tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
}

.resume-tab-btn {
  font-family: var(--font-grotesk);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.9rem 2rem 0.9rem 0;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  margin-bottom: -1px;
}

.resume-tab-btn:hover { color: var(--text); }

.resume-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.resume-tab-panel { display: none; }
.resume-tab-panel.active { display: block; }

/* ── Resume Image ── */
.resume-image-section { padding-top: 0; padding-bottom: 2rem; }

.resume-image-frame {
  border: 1px solid var(--border-solid);
  border-radius: 2px;
  overflow: hidden;
  max-width: 860px;
}

.resume-image { width: 100%; display: block; }

/* ── Resume Page ── */
.resume-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.resume-section-wrapper { padding-top: 0; }

.resume-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 5rem;
  align-items: start;
}

.resume-block { margin-bottom: 3.5rem; }
.resume-block:last-child { margin-bottom: 0; }

.resume-block-title {
  font-family: var(--font-grotesk);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin: 0 0 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.resume-entry {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.resume-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.resume-entry-title {
  font-family: var(--font-grotesk);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.resume-entry-date {
  font-family: var(--font-grotesk);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.resume-entry-company {
  font-family: var(--font-body);
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.resume-entry-desc {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.75;
}

.resume-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.resume-skill {
  font-family: var(--font-grotesk);
  background: transparent;
  border: 1px solid var(--border-solid);
  border-radius: 2px;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cert-item:last-child { border-bottom: none; padding-bottom: 0; }

.cert-name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
}

.cert-issuer {
  font-family: var(--font-grotesk);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ── Project Gallery Pages ── */
.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 5rem;
}

.project-meta-item {}

.project-meta-item dt {
  font-family: var(--font-grotesk);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.project-meta-item dd {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
}

/* Gallery hero image */
.project-hero-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
  margin-bottom: 4rem;
}

/* Story sections (text + image alternating) */
.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 6rem;
}

.story-section--reverse { direction: rtl; }
.story-section--reverse > * { direction: ltr; }

.story-section--full {
  display: block;
  margin-bottom: 6rem;
}

.story-section__label {
  font-family: var(--font-grotesk);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.story-section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.story-section__text {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.85;
}

.story-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  border: 1px solid var(--border-solid);
  background: var(--surface-2);
}

/* Photo gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 6rem;
}

.gallery-grid--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.gallery-grid .gallery-item {
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--border-solid);
  background: var(--surface-2);
}

.gallery-item--tall { grid-row: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img { transform: scale(1.04); }

/* Slide deck grid */
.slide-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 6rem;
}

.slide-item {
  border: 1px solid var(--border-solid);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-2);
}

.slide-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface-2);
  display: block;
  transition: transform 0.4s ease;
}

.slide-item:hover img { transform: scale(1.03); }

.slide-item__caption {
  font-family: var(--font-grotesk);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--border-solid);
}

/* Video list */
.video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.video-item video {
  width: 100%;
  border-radius: 2px;
  border: 1px solid var(--border-solid);
  background: var(--surface-2);
  display: block;
}

.video-item__label {
  font-family: var(--font-grotesk);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ── Book viewer ── */
.book-viewer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.book-body {
  display: flex;
  align-items: stretch;
}

.book-track {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  height: clamp(300px, 62vh, 640px);
  cursor: grab;
}

.book-track::-webkit-scrollbar { display: none; }
.book-track.grabbing { cursor: grabbing; }

/* Two-page spread — snaps at spread level */
.book-spread {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: stretch;
  height: 100%;
}

.book-page {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5vw;
  height: 100%;
  user-select: none;
  position: relative;
}

/* Spine line between left and right page */
.book-spread .book-page:first-child::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: var(--border-solid);
}

.book-page img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.07),
    0 8px 28px rgba(0,0,0,0.11),
    0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--border-solid);
  border-radius: 1px;
  display: block;
  pointer-events: none;
}

/* Sidebar */
.book-sidebar {
  width: 118px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 0;
  overflow: hidden;
}

.book-chapter {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.25rem 0.85rem 0.25rem 0.75rem;
  flex: 1;
  cursor: pointer;
  min-height: 0;
  transition: background 0.15s;
}

.book-chapter:hover { background: var(--surface); }

.book-chapter__line {
  flex-shrink: 0;
  width: 2px;
  align-self: stretch;
  background: var(--border-solid);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
  min-height: 6px;
}

.book-chapter__fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--text);
  border-radius: 1px;
  transition: height 0.15s;
}

.book-chapter__name {
  font-family: var(--font-grotesk);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  line-height: 1.3;
  padding-top: 1px;
  transition: color 0.15s;
}

.book-chapter.active .book-chapter__name { color: var(--text); }

/* Controls */
.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.book-btn {
  background: transparent;
  border: 1px solid var(--border-solid);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.book-btn:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.book-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.book-counter {
  font-family: var(--font-grotesk);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  min-width: 6ch;
  text-align: center;
  font-weight: 500;
}

@media (max-width: 640px) {
  .book-sidebar { display: none; }
  .book-page { padding: 1.5rem 1.25rem; }
}

/* ── Deck Strip ── */
.deck-strip-wrapper {
  background: var(--surface);
  padding: 3rem 0;
}

.deck-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-solid) transparent;
  gap: 1rem;
  padding: 0 2rem 1rem;
  cursor: grab;
}

.deck-strip::-webkit-scrollbar { height: 3px; }
.deck-strip::-webkit-scrollbar-track { background: transparent; }
.deck-strip::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 2px; }
.deck-strip.grabbing { cursor: grabbing; }

.deck-strip__item {
  flex: 0 0 min(680px, 78vw);
  scroll-snap-align: start;
  border: 1px solid var(--border-solid);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-2);
}

.deck-strip__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface-2);
  display: block;
}

@media (max-width: 640px) {
  .deck-strip { padding: 0 1rem 1rem; gap: 0.75rem; }
  .deck-strip__item { flex: 0 0 85vw; }
}

/* ── Project Back Nav ── */
.project-back-nav {
  padding-top: 4rem;
  padding-bottom: 5rem;
}

@media (max-width: 640px) {
  .project-back-nav {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* ── Footer ── */
.site-footer {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-social a {
  font-family: var(--font-grotesk);
  color: var(--muted);
  transition: color 0.18s;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.footer-copy {
  font-family: var(--font-grotesk);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .project-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .resume-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .story-section,
  .story-section--reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 2rem;
    margin-bottom: 4rem;
  }

  .slide-deck { grid-template-columns: repeat(2, 1fr); }

  .hero h1 { font-size: clamp(2.5rem, 8vw, 4rem); }
}

@media (max-width: 640px) {
  /* Spacing */
  .hero { padding-top: 4rem; padding-bottom: 4rem; }
  .page-hero { padding: 4rem 0 2.5rem; }
  .section { padding: 3.5rem 0; }
  .section-heading { margin-bottom: 2.5rem; }
  .story-section { margin-bottom: 3rem; }
  .slide-deck { margin-bottom: 3rem; }
  .project-meta-row { gap: 1.25rem; margin-bottom: 3rem; }
  .wk-card__body { padding: 1.25rem; }

  /* Layout */
  .header-inner { flex-wrap: wrap; gap: 0.75rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .resume-page-header { flex-direction: column; align-items: flex-start; }
  .work-topbar { flex-direction: column; align-items: flex-start; }
  .gallery-grid { grid-template-columns: 1fr; }
  .slide-deck { grid-template-columns: 1fr; }

  /* Filter pills: horizontal scroll instead of wrapping to multiple lines */
  .work-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .work-filters::-webkit-scrollbar { display: none; }
}
