:root {
  --orange: #E8622C;
  --orange-light: #F4926B;
  --orange-dark: #B94A22;
  --cream: #F7EFE6;
  --cream-deep: #EFE2D3;
  --ink: #2B2118;
  --ink-soft: #6B5E52;
  --panel-bg: rgba(255, 251, 246, 0.97);
  --shadow: 0 20px 60px rgba(43, 33, 24, 0.18);

  /* cork-board projects window */
  --wood-a: #6b4226;
  --wood-b: #4a2c18;
  --cork: #c6935e;
  --cork-deep: #a97844;
  --paper: #fffdf8;
  --sage: #8fa173;
  --sage-deep: #5f7248;
  --sage-tint: #e6ebdb;
  --dusty-blue: #7f9cb0;
  --dusty-blue-deep: #4f6b7d;
  --dusty-blue-tint: #e3eaee;
  --tan-tint: #f1e4cf;
  --orange-tint: #fbe3d6;
  --gold: #ce9a2e;
  --gold-hi: #f3da8c;
  --gold-lo: #8c6b1e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #FF5A00;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

/* ---------- 3D scene layer ---------- */
#scene-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: transparent;
}
#scene-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ---------- studio set (wall + floor behind the WebGL room) ---------- */
#studio {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* mostly-solid orange wall, with a barely-there studio key-light bloom
     across the upper middle so the environment reads as a lit 3D set */
  background:
    radial-gradient(ellipse 78% 62% at 50% 30%, #FF6410 0%, #FF5A00 66%, #FB5600 100%);
}
.studio-floor-clip {
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  bottom: 0;
  overflow: hidden;
}
.studio-floor-clip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 150px;
  z-index: 1;
  background: linear-gradient(to bottom, #FF5A00 0%, rgba(255, 90, 0, 0) 100%);
  pointer-events: none;
}
.studio-floor {
  position: absolute;
  left: -20%;
  width: 140%;
  top: 0;
  height: 280%;
  transform: perspective(1600px) rotateX(44deg);
  transform-origin: 50% 0;
  /* a cream pool sitting right under the room, fading outward into the wall
     orange. many closely-spaced stops so the falloff never bands into rings
     and never looks like a circle pasted behind the model. */
  background:
    radial-gradient(
      ellipse 44% 48% at 50% 18%,
      #FFF6EC 0%,
      #FFF3E6 9%,
      #FFECD6 18%,
      #FFE1C0 28%,
      #FFD1A6 38%,
      #FFC08A 47%,
      #FFAE70 56%,
      #FF9C57 65%,
      #FF8B41 74%,
      #FF7A2D 82%,
      #FF691A 90%,
      #FF5A00 100%
    );
}

/* ---------- loading veil ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #FF5A00;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loading-screen p {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFF6EB;
}
.loader-cube {
  width: 34px;
  height: 34px;
  background: #FFF6EB;
  border-radius: 6px;
  animation: spin 1.1s ease-in-out infinite;
}
@keyframes spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.7); }
}

/* ---------- hero / scroll spacer ---------- */
#hero-spacer {
  position: relative;
  height: 240vh;
  z-index: 2;
  pointer-events: none;
}
/* full-viewport layer: the name is pinned near the top, the scroll cue near
   the bottom, and the 3D room reads through the open middle. one opacity fade
   (set from script.js on #hero-text) carries both blocks out as you scroll in. */
#hero-text {
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.25s linear;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
}
.hero-top {
  position: absolute;
  top: clamp(34px, 6.5vh, 90px);
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 980px);
  text-align: center;
}
#hero-text h1 {
  margin: 0;
  font-size: clamp(2.9rem, 9vw, 6.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.98;
  color: #fff;
}
.hero-top .eyebrow {
  margin: 16px 0 0;
  font-size: clamp(10.5px, 1.15vw, 13.5px);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 244, 234, 0.82);
}
.hero-bottom {
  position: absolute;
  bottom: clamp(34px, 8vh, 78px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}
.hero-bottom .welcome {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--orange-dark);
}
.hero-bottom .hero-rule {
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, rgba(185, 74, 34, 0), var(--orange-dark) 45%, rgba(185, 74, 34, 0.12));
}
.hero-bottom .scroll {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--orange-dark);
  opacity: 0.9;
}

/* ---------- bottom nav ---------- */
#bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 0);
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--panel-bg);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: auto;
}
#bottom-nav.hidden {
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
}
.nav-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--cream-deep); }
.nav-btn.active {
  background: var(--orange);
  color: #fff;
}
.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--orange);
  transition: color 0.25s ease;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-btn.active .nav-icon { color: #fff; }

/* ---- Contact's split button: main nav-btn + a caret that reveals links ---- */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-caret {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  margin-left: -2px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-caret svg { width: 15px; height: 15px; }
.nav-caret:hover, .nav-item.submenu-open .nav-caret { background: var(--cream-deep); color: var(--orange-dark); }
.nav-item.submenu-open .nav-caret { transform: rotate(180deg); }

.nav-submenu {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 6px);
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--panel-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.nav-submenu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--panel-bg);
}
.nav-item:hover .nav-submenu,
.nav-item.submenu-open .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}
.nav-submenu-item {
  appearance: none;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-submenu-item:hover { background: var(--cream-deep); color: var(--orange-dark); }
.nav-submenu-icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--orange); }
.nav-submenu-icon svg { width: 100%; height: 100%; }

/* ---------- content panel ---------- */
#content-panel {
  position: fixed;
  top: 50%;
  right: 32px;
  transform: translate(0, -50%);
  z-index: 15;
  width: min(88vw, 380px);
  max-height: 72vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#content-panel.hidden {
  opacity: 0;
  transform: translate(24px, -50%);
  pointer-events: none;
}
#panel-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
#panel-close:hover { color: var(--orange-dark); }
.panel-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}
#content-panel h2 {
  margin: 0 0 14px;
  font-size: 1.6rem;
  color: var(--ink);
}
#panel-body p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
#panel-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#panel-body li {
  padding: 12px 0;
  border-top: 1px solid var(--cream-deep);
  font-size: 14px;
  color: var(--ink);
}
#panel-body li:first-child { border-top: none; padding-top: 0; }
#panel-body li strong { display: block; margin-bottom: 3px; }
#panel-body li span { color: var(--ink-soft); font-size: 13px; }
#panel-body a {
  color: var(--orange-dark);
  font-weight: 600;
  text-decoration: none;
}
#panel-body a:hover { text-decoration: underline; }

/* ---------- contact dial-icon hover label ---------- */
#icon-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(43, 33, 24, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 16px));
  opacity: 0;
  transition: opacity 0.14s ease;
}
#icon-tip.visible { opacity: 1; }

/* ---------- contact dial highlight ring: snaps onto the hovered dial icon ---------- */
#dial-ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;           /* centre the ring on the projected icon point */
  border-radius: 50%;
  border: 2.5px solid #FF5A00;
  box-shadow:
    0 0 12px 2px rgba(255, 90, 0, 0.5),
    inset 0 0 6px rgba(255, 90, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;    /* just a soft on/off — no travel, no bounce */
}
#dial-ring.visible { opacity: 1; }

/* ---------- "about me" on the monitor: CRT power-on + window ---------- */
#tv-window {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 16;
  display: none;
  pointer-events: none;
  overflow: hidden;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#tv-window.showing { display: block; }

/* the horizontal turn-on light */
#tv-window .tv-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #fffdf5;
  box-shadow: 0 0 22px 7px rgba(255, 253, 240, 0.95), 0 0 60px 18px rgba(255, 240, 210, 0.55);
  transform: translateY(-50%) scaleX(0.015);
  opacity: 0;
}
/* full-screen white bloom */
#tv-window .tv-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}
/* the whole screen is the interface — a full-screen about page, not a window */
#tv-window .tv-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #16120e;
  color: #f6efe4;
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0.55);
  transform-origin: 50% 50%;
}
/* header bar spanning the full width of the display */
#tv-window .tv-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 1.05em 1.6em;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 236, 210, 0.14);
}
#tv-window .tv-titlebar span {
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: rgba(255, 236, 210, 0.32);
}
#tv-window .tv-titlebar em {
  margin-left: 0.7em;
  font-style: normal;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.62);
}
/* main content fills the rest of the display: orange left panel + text right */
#tv-window .tv-body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}
#tv-window .tv-photo {
  position: relative;
  flex: 0 0 38%;
  align-self: stretch;
  overflow: hidden;
  background: linear-gradient(158deg, #d5692e 0%, #b1531f 55%, #7f3c1c 100%);
  display: grid;
  place-items: center;
}
#tv-window .tv-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#tv-window .tv-photo-fallback {
  font-size: 3.6em;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 245, 234, 0.95);
}
#tv-window .tv-photo.no-photo img { display: none; }
#tv-window .tv-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4em 1.4em 1.1em;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), transparent);
}
#tv-window .tv-text {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.6em 2.1em;
  overflow: hidden;
}
#tv-window .tv-text h3 {
  margin: 0 0 0.55em;
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.015em;
}
#tv-window .tv-text p {
  margin: 0 0 0.7em;
  max-width: 30em;
  font-size: 0.9em;
  line-height: 1.5;
  color: rgba(246, 239, 228, 0.82);
}
#tv-window .tv-text a { color: #ffb27a; }
#tv-window .tv-foot {
  margin-top: auto;
  padding-top: 1.6em;
  font-size: 0.66em;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.38);
}
/* steady scanlines + soft vignette once it's on */
#tv-window .tv-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(125% 125% at 50% 45%, transparent 60%, rgba(0, 0, 0, 0.4) 100%),
    repeating-linear-gradient(rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px);
  opacity: 0;
}

#tv-window.on .tv-line {
  animation: tv-line 0.62s cubic-bezier(0.2, 0.9, 0.15, 1) forwards;
}
#tv-window.on .tv-flash {
  animation: tv-flash 0.6s ease-out 0.1s forwards;
}
#tv-window.on .tv-frame {
  animation: tv-frame-in 0.5s ease-out 0.36s forwards;
}
#tv-window.on .tv-scan {
  animation: tv-scan-in 0.9s ease-out 0.5s forwards;
}

@keyframes tv-line {
  0%   { opacity: 0; transform: translateY(-50%) scaleX(0.015) scaleY(1); }
  8%   { opacity: 1; transform: translateY(-50%) scaleX(0.015) scaleY(1); }
  38%  { opacity: 1; transform: translateY(-50%) scaleX(1) scaleY(1); }
  62%  { opacity: 1; transform: translateY(-50%) scaleX(1) scaleY(6); }
  100% { opacity: 0; transform: translateY(-50%) scaleX(1) scaleY(48); }
}
@keyframes tv-flash {
  0%   { opacity: 0; }
  22%  { opacity: 0.9; }
  100% { opacity: 0; }
}
@keyframes tv-frame-in {
  0%   { opacity: 0; transform: scaleY(0.55); filter: brightness(2.4); }
  55%  { opacity: 1; transform: scaleY(1.03); filter: brightness(1.5); }
  75%  { transform: scaleY(0.99); filter: brightness(0.85); }
  100% { opacity: 1; transform: scaleY(1); filter: brightness(1); }
}
@keyframes tv-scan-in {
  0%   { opacity: 0; background-position: 0 -60px, 0 0; }
  100% { opacity: 1; background-position: 0 0, 0 0; }
}

/* =====================================================================
   RÉSUMÉ BOOK — a premium open-book overlay triggered from the Résumé
   icon on the rotary dial. Left page is a permanent Table of Contents
   (active chapter highlighted); right page is the active chapter, with
   a light page-turn transition between chapters. backdrop-filter dims +
   blurs the 3D room behind it; no JS timers are needed for open/close —
   everything hangs off the single `.open` class.
   ===================================================================== */
#book-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 40px);
  backdrop-filter: blur(0px) brightness(1);
  -webkit-backdrop-filter: blur(0px) brightness(1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* pointer-events is delayed exactly like visibility — otherwise clicks
     during the fade-out fall through to the 3D room underneath (a click
     meant for a book link could land on a room hotspot mid-close) */
  transition: opacity 0.4s ease, visibility 0s linear 0.4s, pointer-events 0s linear 0.4s,
    backdrop-filter 0.45s ease, -webkit-backdrop-filter 0.45s ease;
}
#book-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(11px) brightness(0.55);
  -webkit-backdrop-filter: blur(11px) brightness(0.55);
  transition: opacity 0.3s ease, visibility 0s linear 0s, pointer-events 0s linear 0s,
    backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

#book {
  position: relative;
  width: min(96vw, 1180px);
  height: min(90vh, 740px);
  perspective: 2200px;
  transform: scale(0.85) rotateX(5deg);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
#book-overlay.open #book { transform: scale(1) rotateX(0deg); opacity: 1; }

/* the leather-toned frame is shared by the closed cover and the open spread,
   so the book reads as one consistent object through the whole animation */
#book-cover,
#book-inner {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(160deg, #6b4226 0%, #4a2c18 100%);
  box-shadow: 0 30px 80px rgba(30, 16, 6, 0.45), 0 8px 24px rgba(30, 16, 6, 0.3);
}

/* ---- closed cover: swings open on a left hinge like a real book ---- */
#book-cover {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 40px;
  transform-origin: left center;
  transform: rotateY(0deg);
  backface-visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.05s, opacity 0.25s ease 0.15s;
}
#book-overlay.open #book-cover {
  /* still a hand opening the cover, not a hinge snapping — just a quick one */
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s, opacity 0.3s ease 0.3s;
  transform: rotateY(-108deg);
  opacity: 0;
  pointer-events: none;
}
.book-cover-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 92px;
  background: var(--orange, #ff5a00);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.book-cover-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 236, 216, 0.6);
}
.book-cover-title {
  margin: 6px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #f7ede0;
}
.book-cover-sub {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 236, 216, 0.5);
}

/* ---- open spread: two cream pages inset from the leather frame ---- */
#book-inner {
  z-index: 2;
  display: flex;
  padding: 16px;
  gap: 2px;
}
#book-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 246, 235, 0.92);
  color: var(--ink, #2b2118);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
#book-close:hover { background: #fff; transform: scale(1.06); }

.book-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: calc(100% + 18px);
  background: var(--orange, #ff5a00);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% calc(100% - 2px), 0 calc(100% - 14px));
  z-index: 1;
  pointer-events: none;
}

.book-page {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  background: linear-gradient(155deg, #fbf5e9 0%, #f3e9d6 100%);
  overflow: hidden;
}
.book-page-left { border-radius: 12px 3px 3px 12px; box-shadow: inset -10px 0 22px -18px rgba(60, 38, 18, 0.55); }
.book-page-right { border-radius: 3px 12px 12px 3px; box-shadow: inset 10px 0 22px -18px rgba(60, 38, 18, 0.55); }

.book-page-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: clamp(22px, 3.6vw, 46px) clamp(20px, 3.4vw, 42px) 46px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#book-overlay.open .book-page-inner {
  /* pages only reveal once the cover has swung most of the way open */
  transition: opacity 0.35s ease 0.45s;
  opacity: 1;
}

.book-page-num {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(107, 66, 38, 0.55);
  pointer-events: none;
}

/* ---- left page: brand kicker + table of contents ---- */
.book-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(43, 33, 24, 0.55);
}
.book-rule { display: block; height: 1px; background: rgba(43, 33, 24, 0.16); margin-bottom: 22px; }
.book-eyebrow {
  margin: 0 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange, #ff5a00);
}
.book-toc-heading {
  margin: 0 0 22px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  color: var(--ink, #2b2118);
}

#book-toc { margin: 0; padding: 0; list-style: none; }
.book-toc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  margin: 0 -12px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.book-toc-row:hover { background: rgba(232, 98, 44, 0.08); }
.book-toc-row.active { background: rgba(232, 98, 44, 0.14); }
.book-toc-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(43, 33, 24, 0.22);
  color: rgba(43, 33, 24, 0.6);
}
.book-toc-row.active .book-toc-num {
  background: var(--orange, #ff5a00);
  border-color: var(--orange, #ff5a00);
  color: #fff;
}
.book-toc-body { flex: 1 1 auto; min-width: 0; }
.book-toc-title {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #2b2118);
}
.book-toc-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: rgba(43, 33, 24, 0.55);
}
.book-toc-chevron {
  flex: 0 0 auto;
  color: var(--orange, #ff5a00);
  font-size: 15px;
  opacity: 0.7;
}

/* ---- right page: chapter content, with a light page-turn on change ---- */
.book-page-right .book-page-inner { transform-origin: left center; backface-visibility: hidden; }
.book-page-right .book-page-inner.turn-out { opacity: 0 !important; transform: rotateY(-10deg) scale(0.98); transition: opacity 0.16s ease, transform 0.3s cubic-bezier(0.45, 0, 0.55, 1); }
.book-page-right .book-page-inner.turn-in { transform: rotateY(9deg) scale(0.98); transition: none; }

.book-breadcrumb {
  margin: 0 0 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(43, 33, 24, 0.4);
}
.book-chapter-kicker {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange, #ff5a00);
}
.book-chapter-title {
  margin: 0 0 12px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  color: var(--ink, #2b2118);
}
.book-chapter-lead { margin: 0 0 22px; }
.book-chapter-role { font-size: 14.5px; font-weight: 700; color: var(--ink, #2b2118); }
.book-chapter-org { margin: 3px 0 0; font-size: 13px; color: rgba(43, 33, 24, 0.62); }
.book-chapter-dates { margin: 3px 0 0; font-size: 12.5px; font-weight: 700; color: var(--orange-dark, #b94a22); }

/* ---- chapter photos: real project shots, framed like snapshots ---- */
.book-photos { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 26px; }
.book-photo {
  flex: 1 1 130px;
  max-width: 170px;
  margin: 0;
}
.book-photo img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(43, 33, 24, 0.22);
}
.book-photo figcaption {
  margin: 7px 2px 0;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink, #2b2118);
  text-align: center;
}

.book-sections { display: flex; flex-direction: column; gap: 18px; }
.book-section { padding-top: 14px; border-top: 1px solid rgba(43, 33, 24, 0.1); }
.book-section:first-child { border-top: none; padding-top: 0; }
.book-section h3 {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange, #ff5a00);
}
.book-section ul { margin: 0; padding: 0; list-style: none; }
.book-section li {
  position: relative;
  padding: 3px 0 3px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(43, 33, 24, 0.82);
}
.book-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange, #ff5a00);
}
.book-section li a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(232, 98, 44, 0.45);
  text-underline-offset: 2px;
}
.book-section li a:hover { color: var(--orange-dark, #b94a22); }

body.modal-open { overflow: hidden; }

@media (max-width: 760px) {
  #book { width: 100vw; height: 100vh; max-height: 100vh; }
  #book-cover, #book-inner { border-radius: 0; }
  #book-inner { flex-direction: column; padding: 10px; gap: 10px; }
  .book-page-left, .book-page-right { border-radius: 10px; flex: 0 0 auto; }
  .book-page-left { max-height: 42vh; }
  .book-page-right { flex: 1 1 auto; min-height: 0; }
  .book-ribbon { display: none; }
  .book-page-num { display: none; } /* the two-page spread's page numbers don't make sense on stacked scrolling cards */
  .book-page-inner { padding-bottom: 24px; }
}

@media (max-width: 520px) {
  .hero-top { top: 26px; width: 96vw; }
  #hero-text h1 { font-size: clamp(2.1rem, 12vw, 3rem); }
  .hero-top .eyebrow { letter-spacing: 0.2em; }
  .hero-bottom { bottom: clamp(20px, 6vh, 40px); }
}

@media (max-width: 720px) {
  #bottom-nav { bottom: 16px; gap: 2px; padding: 6px; max-width: 94vw; overflow-x: auto; }
  .nav-btn { padding: 10px 14px; font-size: 12.5px; }
  .nav-icon { width: 15px; height: 15px; }
  .nav-submenu { min-width: 170px; }
  #content-panel { right: 16px; left: 16px; width: auto; top: auto; bottom: 96px; transform: none; max-height: 46vh; }
  #content-panel.hidden { transform: translateY(16px); }
}

/* =====================================================================
   PROJECTS CORK BOARD — a full-screen pinboard overlay opened from the
   Projects nav, in the same family as the résumé book: a cream window
   frame, backdrop-filter dims the room behind it, and everything hangs
   off the single `.open` class (no JS timers needed for open/close).
   ===================================================================== */
#corkboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  backdrop-filter: blur(0px) brightness(1);
  -webkit-backdrop-filter: blur(0px) brightness(1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s, pointer-events 0s linear 0.45s,
    backdrop-filter 0.55s ease, -webkit-backdrop-filter 0.55s ease;
}
#corkboard-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(11px) brightness(0.55);
  -webkit-backdrop-filter: blur(11px) brightness(0.55);
  transition: opacity 0.45s ease, visibility 0s linear 0s, pointer-events 0s linear 0s,
    backdrop-filter 0.6s ease, -webkit-backdrop-filter 0.6s ease;
}

#corkboard {
  position: relative;
  width: min(98vw, 1640px);
  height: min(96vh, 980px);
  background: var(--cream);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(30, 16, 6, 0.45), 0 8px 24px rgba(30, 16, 6, 0.3);
  display: flex;
  flex-direction: column;
  padding: 22px 26px 26px;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
#corkboard-overlay.open #corkboard { transform: scale(1); opacity: 1; }

#corkboard-close {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 246, 235, 0.92);
  color: var(--ink, #2b2118);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
#corkboard-close:hover { background: #fff; color: var(--orange-dark); transform: scale(1.06); }

.cork-header { padding: 0 50px 12px 2px; }
.cork-header h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  line-height: 1;
  color: var(--ink);
}

.cork-board-frame {
  flex: 1;
  min-height: 0;
  border-radius: 22px;
  padding: 12px;
  background: linear-gradient(160deg, var(--wood-a) 0%, var(--wood-b) 100%);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4), 0 8px 18px rgba(43, 33, 24, 0.2);
}
.cork-board {
  position: relative;
  height: 100%;
  border-radius: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 36px 30px 22px;
  background-color: var(--cork);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 12% 18%, rgba(70, 40, 10, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 12%, rgba(70, 40, 10, 0.3) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 62%, rgba(255, 235, 200, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 74%, rgba(70, 40, 10, 0.3) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 55%, rgba(255, 235, 200, 0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 6% 80%, rgba(70, 40, 10, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 54% 30%, rgba(255, 235, 200, 0.2) 0 1.5px, transparent 3px),
    radial-gradient(ellipse 140% 60% at 50% 100%, rgba(35, 20, 8, 0.28), rgba(35, 20, 8, 0) 70%);
}
.cork-board::-webkit-scrollbar { width: 10px; }
.cork-board::-webkit-scrollbar-thumb { background: var(--cork-deep); border-radius: 6px; }
.cork-board::-webkit-scrollbar-track { background: transparent; }

.cork-sprig { position: absolute; opacity: 0.9; z-index: 0; }
.cork-sprig.a { top: 12px; left: 12px; width: 58px; transform: rotate(-8deg); }
.cork-sprig.b { bottom: 8px; right: 16px; width: 52px; transform: rotate(10deg) scaleX(-1); }

.cork-masonry { column-count: 3; column-gap: 30px; position: relative; z-index: 1; }
@media (min-width: 1000px) { .cork-masonry { column-count: 4; } }
@media (min-width: 1360px) { .cork-masonry { column-count: 5; } }

.cork-pin { position: relative; display: inline-block; width: 100%; break-inside: avoid; margin: 0 0 34px; }

.cork-thumbtack {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 17px;
  height: 17px;
  margin-left: -8.5px;
  border-radius: 50%;
  z-index: 3;
  background: radial-gradient(circle at 34% 28%, var(--gold-hi), var(--gold) 55%, var(--gold-lo) 100%);
  box-shadow: 0 3px 5px rgba(30, 18, 6, 0.5), inset 0 -1px 1px rgba(0, 0, 0, 0.3);
}

.cork-polaroid {
  position: relative;
  background: var(--paper);
  padding: 11px 11px 0;
  border-radius: 3px;
  box-shadow: 0 15px 28px rgba(43, 33, 24, 0.28), 0 2px 6px rgba(43, 33, 24, 0.2);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.35s ease;
}
.cork-pin:hover .cork-polaroid {
  transform: rotate(0deg) translateY(-6px) scale(1.035);
  box-shadow: 0 24px 42px rgba(43, 33, 24, 0.36);
}

.cork-photo {
  width: 100%;
  aspect-ratio: var(--ar, 1/1);
  border-radius: 2px;
  overflow: hidden;
  background: var(--tint, var(--cream-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}
.cork-photo svg { width: 62%; height: 62%; }
.cork-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cork-caption {
  margin: 11px 4px 15px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  text-align: center;
  line-height: 1.05;
}
.cork-caption:has(+ .cork-sub) { margin-bottom: 2px; }
.cork-sub {
  margin: 0 8px 17px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.35;
}

.cork-note-card {
  position: relative;
  padding: 24px 20px 22px;
  text-align: center;
  border-radius: 3px 14px 5px 16px;
  box-shadow: 0 13px 24px rgba(43, 33, 24, 0.26), 0 2px 5px rgba(43, 33, 24, 0.18);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cork-pin:hover .cork-note-card { transform: rotate(0deg) translateY(-4px); }
.cork-note-card .washi {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 54px;
  height: 18px;
  margin-left: -27px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: rotate(-2deg);
}
.cork-note-card p {
  margin: 0;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--ink);
}
.cork-note-card.tint-cream { background: var(--cream-deep); }
.cork-note-card.tint-sage { background: var(--sage-tint); }
.cork-note-card.tint-blue { background: var(--dusty-blue-tint); }
.cork-note-card.tint-orange { background: var(--orange-tint); }

/* a Polaroid that opens a case study lifts + straightens on hover as a
   "pick me up" cue, on top of the normal hover-tilt-to-flat behaviour */
.cork-pin[data-project] { cursor: pointer; }

/* phase 1 (JS-driven, on click): the polaroid lifts off the board and
   straightens before the case study expands out of it — !important beats
   the hover rule's specificity since the pointer is still over the card */
.cork-pin.lifting .cork-polaroid {
  transform: rotate(0deg) translateY(-14px) scale(1.06) !important;
  box-shadow: 0 30px 50px rgba(43, 33, 24, 0.4), 0 6px 14px rgba(43, 33, 24, 0.26) !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.22s ease !important;
}

/* =====================================================================
   PROJECT CASE STUDY — the lifted Polaroid expands into this. Sits above
   the cork board (which stays visible, dimmed) in the same cream/cork/
   Polaroid visual system. #project-detail-card is FLIP-animated by JS:
   transform is written inline, this file only owns its resting look.
   ===================================================================== */
#project-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vw, 34px);
  background: rgba(20, 12, 4, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* durations/delay match #project-detail-card's transform transition below,
     so the backdrop doesn't go visibility:hidden (hiding the card) before
     the card's own shrink-back-to-the-board animation has finished */
  transition: opacity 0.48s ease, visibility 0s linear 0.48s, pointer-events 0s linear 0.48s,
    background 0.48s ease, backdrop-filter 0.48s ease, -webkit-backdrop-filter 0.48s ease;
}
#project-detail-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(20, 12, 4, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity 0.3s ease, visibility 0s linear 0s, pointer-events 0s linear 0s,
    background 0.45s ease, backdrop-filter 0.45s ease, -webkit-backdrop-filter 0.45s ease;
}

#project-detail-card {
  position: relative;
  width: min(88vw, 1360px);
  height: min(88vh, 940px);
  background: var(--cream);
  border-radius: 26px;
  box-shadow: 0 40px 100px rgba(20, 12, 4, 0.5), 0 12px 30px rgba(20, 12, 4, 0.3);
  transform-origin: center center;
  overflow: hidden;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
/* JS toggles this off for the single instant frame that sets the FLIP
   starting transform, so that frame doesn't itself animate */
#project-detail-card.flip-instant { transition: none !important; }

#detail-close {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 246, 235, 0.92);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
#detail-close:hover { background: #fff; color: var(--orange-dark); transform: scale(1.06); }

/* a persistent footer bar (not part of the scrolling content) so long
   project titles truncate instead of colliding with each other or the
   header — prev on the left, next on the right, always in reach */
.detail-nav-btn {
  position: absolute;
  bottom: 0;
  z-index: 6;
  max-width: 46%;
  border: none;
  padding: 13px 22px;
  background: rgba(255, 246, 235, 0.94);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.detail-nav-btn:hover { background: #fff; color: var(--orange-dark); }
.detail-nav-btn.prev { left: 0; text-align: left; border-radius: 0 14px 0 0; }
.detail-nav-btn.next { right: 0; text-align: right; border-radius: 14px 0 0 0; }

.detail-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 74px clamp(24px, 4vw, 64px) 76px;
  transition: opacity 0.16s ease;
}
.detail-scroll::-webkit-scrollbar { width: 10px; }
.detail-scroll::-webkit-scrollbar-thumb { background: var(--cork-deep); border-radius: 6px; }
.detail-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---- header: name, category / status, one-line description ---- */
.detail-eyebrow {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-dark);
}
.detail-eyebrow .dot { opacity: 0.5; }
.detail-eyebrow .detail-status { color: var(--dusty-blue-deep); }
.detail-title {
  margin: 0 0 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.02;
  color: var(--ink);
}
.detail-tagline {
  margin: 0 0 18px;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.detail-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 40px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.detail-brand img { width: 20px; height: 20px; object-fit: contain; }
.detail-brand:hover { background: var(--orange); color: #fff; }

/* ---- hero: visual Polaroid stack (left) + info column (right) ---- */
.detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 40%) 1fr;
  gap: clamp(28px, 4vw, 56px);
  margin-bottom: 46px;
}

.detail-visual { position: relative; padding: 18px 10px 46px 30px; }

.detail-photo {
  background: var(--paper);
  padding: 10px 10px 0;
  border-radius: 3px;
  box-shadow: 0 16px 30px rgba(43, 33, 24, 0.26), 0 2px 6px rgba(43, 33, 24, 0.18);
}
.detail-photo-inner {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
  background: var(--tint, var(--cream-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-photo-inner svg { width: 62%; height: 62%; }
.detail-photo-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-photo-cap {
  margin: 8px 4px 10px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-align: center;
}

.detail-photo--hero {
  position: relative;
  z-index: 3;
  width: 78%;
  margin: 0 auto;
  transform: rotate(-2deg);
}
.detail-photo--stack {
  position: absolute;
  width: 52%;
  z-index: 1;
}
.detail-photo--stack.a { top: 0; left: 0; transform: rotate(-9deg); z-index: 2; }
.detail-photo--stack.b { bottom: 6px; right: 0; transform: rotate(8deg); }

/* ---- info column: The Project / My Role / Tools ---- */
.detail-info { display: flex; flex-direction: column; gap: 26px; padding-top: 4px; }
.detail-block h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}
.detail-block p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: rgba(43, 33, 24, 0.86);
}
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 600;
}
.detail-chip:nth-child(3n+2) { background: var(--sage-tint); }
.detail-chip:nth-child(3n+3) { background: var(--dusty-blue-tint); }

/* ---- auto-scrolling photo strip, in place of the old case-study block ---- */
.detail-marquee-wrap {
  overflow: hidden;
  padding: 28px 0;
  margin-bottom: 46px;
  border-top: 1px solid rgba(43, 33, 24, 0.12);
  border-bottom: 1px solid rgba(43, 33, 24, 0.12);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.detail-marquee-track {
  display: flex;
  width: max-content;
  gap: 18px;
  animation: detail-marquee-scroll 32s linear infinite;
}
.detail-marquee-wrap:hover .detail-marquee-track { animation-play-state: paused; }
.detail-marquee-item {
  flex: 0 0 auto;
  width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tint, var(--cream-deep));
  box-shadow: 0 10px 20px rgba(43, 33, 24, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-marquee-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-marquee-item svg { width: 56%; height: 56%; }
@keyframes detail-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- actions + prev/next footer ---- */
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.detail-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.detail-action:hover { background: var(--orange); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .cork-polaroid, .cork-note-card, #corkboard, #corkboard-close,
  #project-detail-card { transition: none; }
  .detail-marquee-track { animation: none; }
}

@media (max-width: 760px) {
  #corkboard { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; padding: 20px 16px 16px; }
  .cork-header { padding-right: 50px; }
  .cork-board-frame { border-radius: 16px; }
  .cork-masonry { column-count: 2; column-gap: 18px; }

  #project-detail-card { width: 100vw; height: 100vh; border-radius: 0; }
  .detail-scroll { padding: 64px 18px 68px; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-visual { padding: 10px 10% 40px; max-width: 320px; margin: 0 auto; }
  .detail-marquee-item { width: 150px; }
  .detail-nav-btn { max-width: 50%; font-size: 11.5px; padding: 12px 16px; }
}
