/* =========================================================
   RUSHABH PORTFOLIO — 3D HINGED SKETCHBOOK
   Closed Cover & Open Spread States
   Inter & Caveat Typography, Responsive Geometry
   ========================================================= */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-variable.woff2') format('woff2'), url('fonts/Inter-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('fonts/Caveat-variable.woff2') format('woff2'), url('fonts/Caveat-variable.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand Palette */
  --color-blue: #0647fa;
  --color-lime: #bdff00;
  --color-paper: #fff0d7;
  --color-ink: #080807;
  --color-white: #fffefa;

  /* Spread & Single Page Geometry (calculated by layout engine) */
  --spread-width: 1180px;
  --spread-height: 738px;
  --spread-aspect-ratio: 1586 / 992;
  --page-width: 590px;
  --page-height: 738px;
  --book-width: 590px;
  --book-height: 738px;
  --book-rotation: -4deg;

  /* Closed Cover Component Anchor Positions */
  --role-left: 12%;
  --role-top: 7%;
  --role-width: 30%;
  --role-rotation: -9deg;

  --portrait-left: 52%;
  --portrait-top: 17%;
  --portrait-width: 26%;
  --portrait-rotation: 5deg;

  --intro-left: 13%;
  --intro-top: 33%;
  --intro-width: 82%;

  --cursor-left: 11%;
  --cursor-top: 75%;
  --cursor-width: 36%;
  --cursor-rotation: 1deg;

  --grid-right: 3.8%;
  --grid-bottom: 4%;
  --grid-width: 58%;
  --grid-height: 35%;
  --grid-cell-size: 4.6cqw;

  --open-right: 6%;
  --open-bottom: 10%;
  --open-width: 44%;

  /* Stacking Context Levels */
  --z-spread-shadow: 1;
  --z-spread-base: 2;
  --z-right-page: 5;
  --z-cast-shadow: 8;
  --z-hinged-cover: 15;
  --z-id-tag: 10; /* behind the hinged cover (15) so the tag looks clipped on from inside the book */
  --z-scene-controls: 30;
  --z-active-drag: 50;

  /* Shadows */
  --book-shadow: 16px 28px 24px rgba(0, 21, 84, 0.48);
  --id-shadow: 6px 12px 10px rgba(0, 17, 59, 0.42);
  --sticker-shadow: 0 4px 6px rgba(103, 95, 75, 0.22);
}

/* Reset & Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  color: var(--color-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-blue);
  background-image: url('assets/sketchbook/cobalt-soft-paper-4k.webp');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  min-height: 100svh;
  /* clip (not hidden/auto) so body isn't a scroll container and position: sticky follows the page */
  overflow-x: clip;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#appRoot {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Interactive elements base */
button,
a {
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-lime);
  outline-offset: 5px;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

/* Sticky (not fixed) so it keeps its place in the hero layout; Header.js toggles the states below */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: clamp(16px, 2.8vh, 28px) clamp(24px, 4.8vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--color-white);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    padding 0.3s ease;
}

/* Past the hero: a slimmer cobalt band so the white links read over the light sections */
.site-header.is-floating {
  padding-top: 12px;
  padding-bottom: 12px;
  background-color: var(--color-blue);
  background-image: url('assets/sketchbook/cobalt-soft-paper-4k.webp');
  background-size: cover;
  background-position: center top;
  box-shadow: 0 6px 20px rgba(6, 30, 110, 0.18);
}

/* Scrolling down: slide fully out of view (including the shadow) */
.site-header.is-hidden {
  transform: translateY(calc(-100% - 24px));
}

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

.wordmark {
  font-size: clamp(26px, 2.2vw, 32px);
  font-weight: 750;
  letter-spacing: -0.055em;
  color: var(--color-white);
  text-decoration: none;
  line-height: 1;
  user-select: none;
}

.wordmark span {
  color: var(--color-lime);
  margin-left: 0.5px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 38px);
}

.nav-item {
  position: relative;
  padding: 8px 0;
  color: var(--color-white);
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 480;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
  opacity: 0.88;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-lime);
  border-radius: 1px;
}

/* =========================================================
   BACKGROUND CRAWLER VIDEO
   ========================================================= */

.crawler-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center bottom;
  transform: scale(1.08);
  transform-origin: center bottom;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.4s ease;
}

body.is-book-open .crawler-video,
.book-stage.is-open ~ .crawler-video {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   MAIN STAGE & PERSPECTIVE SCENE
   ========================================================= */

.main-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(16px, 2.5vh, 28px) clamp(16px, 3.5vw, 48px) clamp(20px, 3vh, 36px);
  min-height: auto;
  position: relative;
  z-index: 10;
  overflow: visible;
}

.book-scene-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  perspective: 1600px;
  -webkit-perspective: 1600px;
}

.book-stage {
  position: relative;
  width: var(--spread-width);
  height: var(--spread-height);
  container-type: inline-size;
  transform-origin: center center;
  overflow: visible;
  will-change: transform;
}

/* =========================================================
   BOOK SPREAD & 3D GEOMETRY
   Local coordinates: spine is at x = 50%
   Closed: shifted left by -25% (centering the [50%, 100%] right half) and tilted -4deg
   Open: centered at 0% and upright at 0deg
   ========================================================= */

.book-spread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 1.1s cubic-bezier(0.32, 0, 0.15, 1);
}

.book-stage.is-closed .book-spread,
.book-stage.is-closing .book-spread {
  transform: translateX(-25%) rotate(-4deg);
}

.book-stage.is-open .book-spread,
.book-stage.is-opening .book-spread {
  transform: translateX(0%) rotate(0deg);
}

/* Ambient Spread Shadow */
.book-ground-shadow {
  position: absolute;
  inset: 4% 3% -4% 3%;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, rgba(0, 18, 70, 0.5) 0%, rgba(0, 14, 55, 0.25) 55%, transparent 75%);
  filter: blur(16px);
  pointer-events: none;
  z-index: var(--z-spread-shadow);
  transition: inset 1.1s cubic-bezier(0.32, 0, 0.15, 1), opacity 1.1s ease;
}

.book-stage.is-closed .book-ground-shadow,
.book-stage.is-closing .book-ground-shadow {
  inset: 4% 3% -3% 53%;
}

/* Resting Spread Texture Base (open-book-blank.png) */
.spread-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-spread-base);
  pointer-events: none;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.32, 0, 0.15, 1);
}

.book-stage.is-open .spread-base,
.book-stage.is-opening .spread-base,
.book-stage.is-closing .spread-base {
  opacity: 1;
}

/* Inside pages, spread base, and paper frames MUST remain strictly hidden while the book is closed or loading */
.book-stage.is-closed .spread-base,
.book-stage.is-loading .spread-base,
.book-stage.is-closed .page-right,
.book-stage.is-loading .page-right,
.book-stage.is-closed .mobile-paper-frame,
.book-stage.is-loading .mobile-paper-frame,
.book-stage.is-closed .cover-face-back,
.book-stage.is-loading .cover-face-back {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.book-stage.is-opening .spread-base,
.book-stage.is-open .spread-base,
.book-stage.is-closing .spread-base,
.book-stage.is-opening .page-right,
.book-stage.is-open .page-right,
.book-stage.is-closing .page-right,
.book-stage.is-opening .mobile-paper-frame,
.book-stage.is-open .mobile-paper-frame,
.book-stage.is-closing .mobile-paper-frame,
.book-stage.is-opening .cover-face-back,
.book-stage.is-open .cover-face-back,
.book-stage.is-closing .cover-face-back {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.spread-base-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  filter: drop-shadow(var(--book-shadow));
}

/* =========================================================
   HANGING ID TAG
   Anchored to the stationary right block / back cover.
   Sibling layer in book-spread, stays attached throughout.
   ========================================================= */

.id-tag-wrapper {
  position: absolute;
  z-index: var(--z-id-tag);
  width: 22%;
  aspect-ratio: 1363 / 1154;
  right: -13.2%;
  top: 3.5%;
  transform: rotate(7deg) translateZ(-3px);
  transform-origin: 32% 10%;
  filter: drop-shadow(var(--id-shadow));
  opacity: 0.92;
  transition: transform 1.1s cubic-bezier(0.32, 0, 0.15, 1),
              right 1.1s cubic-bezier(0.32, 0, 0.15, 1),
              top 1.1s cubic-bezier(0.32, 0, 0.15, 1),
              width 1.1s cubic-bezier(0.32, 0, 0.15, 1),
              opacity 1.1s cubic-bezier(0.32, 0, 0.15, 1);
  pointer-events: auto;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.id-tag-wrapper:hover {
  transform: rotate(9deg) translateZ(-2px) scale(1.02);
}

/* When the book opens: moves outward toward upper-right edge, reduces slightly, increases opacity */
.book-stage.is-open .id-tag-wrapper,
.book-stage.is-opening .id-tag-wrapper {
  /* same size and anchor as the closed state so the tag does not rescale or drift */
  width: 22%;
  right: -13.2%;
  top: 3.5%;
  transform: rotate(7deg) translateZ(-3px);
  opacity: 1;
}

.book-stage.is-open .id-tag-wrapper:hover {
  transform: rotate(9deg) translateZ(-2px) scale(1.02);
}

.id-tag-img {
  /* v2 art: same tag-body footprint as before (wrapper keeps the old 1363x1154 box),
     the longer clasp extends 59px above it. */
  position: absolute;
  left: 0;
  top: -4.33%;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* =========================================================
   STATIONARY RIGHT PAGE (Inside Spread)
   Occupies [50%, 100%] of book-spread (underneath cover when closed)
   ========================================================= */

.page-right {
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: var(--z-right-page);
  overflow: visible;
  border-radius: 0 4px 4px 0;
}

.right-page-content {
  position: absolute;
  inset: 4% 5% 5% 3.5%;
  container-type: inline-size;
  user-select: none;
}

/* Right Page Clean Bold Sans-Serif Heading */
.right-heading-block {
  position: absolute;
  left: 44%;
  top: 3.8%;
  transform: translateX(-50%);
  width: auto;
  z-index: 10;
  text-align: center;
  pointer-events: none;
}

.right-sans-title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: clamp(18px, 3.6cqw, 25px);
  font-weight: 800;
  color: #080807;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: nowrap;
}

/* Draggable Hobby Stickers Container & Items */
.hobbies-spine-column {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
}

.hobby-draggable-item {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
}

.hobby-draggable-item:focus-visible {
  outline: 2px dashed #0647fa;
  outline-offset: 4px;
  border-radius: 6px;
}

.hobby-draggable-item:hover {
  filter: drop-shadow(0 6px 12px rgba(0, 16, 50, 0.22));
}

.hobby-draggable-item.is-dragging {
  cursor: grabbing;
  z-index: 45 !important;
  filter: drop-shadow(0 14px 24px rgba(0, 18, 60, 0.35));
}

.hobby-sticker-img {
  width: clamp(55px, 11.5cqw, 72px);
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.14));
}

.hobby-sticker-label {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(11.5px, 2cqw, 13px);
  font-weight: 600;
  color: #080807;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-top: 1px;
}

/* Central Walking Cutout & Starburst */
.walking-portrait-wrapper {
  position: absolute;
  left: 45%;
  top: 40%;
  width: 44%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: auto;
}

.walking-cutout-container {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.walking-cutout-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 16, 50, 0.16));
  user-select: none;
  -webkit-user-drag: none;
}

/* Caption beneath portrait */
.portrait-travel-caption {
  margin: 4px 0 0;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: clamp(11px, 2cqw, 13.5px);
  font-weight: 600;
  color: #23396A;
  letter-spacing: -0.015em;
  white-space: nowrap;
  user-select: none;
  text-align: center;
}

/* Travel Trail SVG Connectors */
.travel-trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Travel Stamps Collection Container */
.travel-stamps-collection {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Travel Stamp Items */
.travel-stamp-item {
  position: absolute;
  width: 29%;
  aspect-ratio: 1536 / 1024;
  z-index: 10;
  cursor: grab;
  touch-action: none;
  transform-origin: center center;
  user-select: none;
  outline: none;
  pointer-events: auto;
  will-change: transform, left, top;
}

.travel-stamp-item:focus-visible {
  outline: 2px dashed #0647fa;
  outline-offset: 4px;
  border-radius: 4px;
}

.travel-stamp-item.is-dragging {
  cursor: grabbing;
  z-index: 40 !important;
}

.travel-stamp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 4px 10px rgba(0, 16, 50, 0.18));
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
}

.travel-stamp-item:hover .travel-stamp-img {
  filter: drop-shadow(0 6px 14px rgba(0, 16, 50, 0.24));
}

.travel-stamp-item.is-dragging .travel-stamp-img {
  transform: scale(1.05);
  filter: drop-shadow(0 14px 24px rgba(0, 18, 60, 0.35));
}

/* Next Chapter Button (Lime circle at bottom right of right page) */
.next-chapter-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: clamp(34px, 5.5cqw, 42px);
  height: clamp(34px, 5.5cqw, 42px);
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 15;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.next-arrow-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.next-chapter-btn:hover {
  transform: translateX(2px) scale(1.06);
}

.next-chapter-btn:hover .next-arrow-svg {
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.28));
}

.next-chapter-btn:focus-visible {
  outline: 3px solid var(--color-lime);
  outline-offset: 4px;
  border-radius: 50%;
}

/* Moving Soft Shadow Cast on Right Page During Turn */
.cover-cast-shadow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 16, 60, 0.5) 0%, rgba(0, 16, 60, 0.15) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-cast-shadow);
  transition: opacity 0.2s ease;
}

.book-stage.is-opening .cover-cast-shadow {
  animation: coverCastShadowAnim 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

.book-stage.is-closing .cover-cast-shadow {
  animation: coverCastShadowAnimReverse 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

@keyframes coverCastShadowAnim {
  0% { opacity: 0; }
  35% { opacity: 0.55; }
  75% { opacity: 0.25; }
  100% { opacity: 0; }
}

@keyframes coverCastShadowAnimReverse {
  0% { opacity: 0; }
  45% { opacity: 0.55; }
  85% { opacity: 0.2; }
  100% { opacity: 0; }
}

/* =========================================================
   3D HINGED FRONT COVER ASSEMBLY
   Hinges around spine at left: 50%, width: 50%
   rotateY(0deg) -> rotateY(-180deg)
   ========================================================= */

.hinged-cover {
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform;
  z-index: var(--z-hinged-cover);
  transition: transform 1.1s cubic-bezier(0.32, 0, 0.15, 1);
}

.book-stage.is-closed .hinged-cover,
.book-stage.is-closing .hinged-cover {
  transform: rotateY(0deg);
}

.book-stage.is-open .hinged-cover,
.book-stage.is-opening .hinged-cover {
  transform: rotateY(-180deg);
}

/* Two Faces */
.cover-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: visible;
}

/* Front Face: Closed Cover Content */
.cover-face-front {
  transform: rotateY(0deg) translateZ(1px);
  z-index: 2;
  border-radius: 0 4px 4px 0;
}

.closed-cover-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  container-type: inline-size;
  user-select: none;
}

/* Blank Book Picture & Image (Front Cover) */
.book-base-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.book-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(var(--book-shadow));
  border-radius: 4px;
  opacity: 0;
  transition: opacity 260ms cubic-bezier(0.2, 0, 0.25, 1);
}

/* Architectural Blueprint Grid */
.book-grid {
  position: absolute;
  right: var(--grid-right);
  bottom: var(--grid-bottom);
  width: var(--grid-width);
  height: var(--grid-height);
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 145, 180, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 145, 180, 0.22) 1px, transparent 1px);
  background-size: var(--grid-cell-size) var(--grid-cell-size);
  mask-image: linear-gradient(135deg, transparent 20%, #000000 95%);
  -webkit-mask-image: linear-gradient(135deg, transparent 20%, #000000 95%);
  border-bottom-right-radius: 20px;
}

/* Draggable Cover Sticker Wrappers */
.sticker-drag-wrapper {
  position: absolute;
  z-index: 22;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  outline: none;
}

.sticker-drag-wrapper:focus-visible {
  outline: 2px dashed var(--color-lime);
  outline-offset: 4px;
  border-radius: 12px;
}

.sticker-drag-wrapper.is-dragging {
  cursor: grabbing;
  z-index: var(--z-active-drag) !important;
}

.sticker-wrapper-role {
  width: var(--role-width);
}

.sticker-wrapper-portrait {
  width: var(--portrait-width);
}

.sticker-wrapper-cursor {
  width: var(--cursor-width);
}

/* Role Badge */
.sticker-role {
  position: relative;
  width: 100%;
  border: 4.5px solid #fffdf7;
  border-radius: 14px;
  outline: 1px solid #b7ab94;
  background-color: #ffffff;
  transform: rotate(var(--role-rotation));
  box-shadow: var(--sticker-shadow);
  overflow: hidden;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  pointer-events: none;
}

.sticker-drag-wrapper:hover .sticker-role {
  transform: rotate(calc(var(--role-rotation) - 2deg)) scale(1.03);
}

.sticker-drag-wrapper.is-dragging .sticker-role {
  box-shadow: 0 16px 24px rgba(0, 18, 60, 0.42);
}

.role-header {
  display: block;
  background-color: var(--color-lime);
  border: 2px solid var(--color-ink);
  border-radius: 8px 8px 0 0;
  padding: 4.5px 0 4px;
  font-family: 'Inter', sans-serif;
  font-size: 3.8cqw;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--color-ink);
  white-space: nowrap;
}

.role-body {
  display: block;
  border: 2px solid var(--color-ink);
  border-top: none;
  border-radius: 0 0 8px 8px;
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 5.2cqw;
  line-height: 0.94;
  color: var(--color-ink);
  padding: 5px 0 9px;
  white-space: pre-line;
}

/* Portrait Sticker */
.sticker-portrait {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(var(--portrait-rotation));
  filter: drop-shadow(2px 4px 3px rgba(103, 95, 75, 0.28));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.sticker-drag-wrapper:hover .sticker-portrait {
  transform: rotate(calc(var(--portrait-rotation) + 2deg)) scale(1.03);
}

.sticker-drag-wrapper.is-dragging .sticker-portrait {
  filter: drop-shadow(0 16px 24px rgba(0, 18, 60, 0.42));
}

/* Cursor Sticker */
.sticker-cursor {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(var(--cursor-rotation));
  filter: drop-shadow(2px 5px 3px rgba(103, 95, 75, 0.25));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.sticker-drag-wrapper:hover .sticker-cursor {
  transform: rotate(calc(var(--cursor-rotation) - 1.5deg)) scale(1.03);
}

.sticker-drag-wrapper.is-dragging .sticker-cursor {
  filter: drop-shadow(0 16px 24px rgba(0, 18, 60, 0.42));
}

/* Intro Typography Block (Selectable text) */
.intro-block {
  position: absolute;
  left: var(--intro-left);
  top: var(--intro-top);
  width: var(--intro-width);
  z-index: 20;
  pointer-events: auto;
  user-select: text;
}

.intro-greeting {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 8.6cqw;
  font-weight: 400;
  letter-spacing: -0.045em;
  color: var(--color-ink);
  line-height: 1.15;
}

.intro-name {
  margin: -0.04em 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 17.3cqw;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.075em;
  color: var(--color-ink);
  white-space: nowrap;
}

.intro-underline {
  position: absolute;
  width: 44%;
  right: 5%;
  top: 67%;
  pointer-events: none;
  user-select: none;
}

.intro-tagline {
  margin: 4.8cqw 0 0;
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 5.1cqw;
  line-height: 1.2;
  color: var(--color-ink);
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0;
}

/* Open Book Button */
.open-book-btn {
  position: absolute;
  right: var(--open-right);
  bottom: var(--open-bottom);
  width: auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.5em;
  font-size: clamp(10px, 2.5cqw, 13px);
  color: var(--color-ink);
  z-index: 25;
  text-decoration: none;
  outline: none;
}

.open-book-btn:focus-visible {
  outline: 3px solid var(--color-lime);
  outline-offset: 6px;
  border-radius: 8px;
}

/* Cover actions: two small, quiet buttons ("My works", "Open sketchbook") */
.cover-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 0.95em;
  border-radius: 999px;
  border: 1.25px solid var(--color-ink);
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-ink);
  font: 600 1em/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.cover-action svg {
  width: 0.9em;
  height: 0.9em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}
.cover-action--book {
  background: var(--color-ink);
  color: #fff;
}
.cover-action:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16); }
.cover-action--works:hover { background: rgba(255, 255, 255, 0.85); }
.cover-action--book:hover svg { transform: translateX(2px); }
.cover-action--works:hover svg { transform: translateY(2px); }
.cover-action:focus-visible { outline: 2px solid var(--color-lime); outline-offset: 3px; }

.open-book-label {
  font-family: 'Caveat', cursive;
  font-weight: 500;
  font-size: 3.7cqw;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-6deg);
  border-bottom: 1.5px solid var(--color-ink);
  padding-bottom: 5px;
  color: var(--color-ink);
}

.curved-arrow-img {
  width: 21%;
  height: auto;
  margin-left: -1%;
  pointer-events: none;
}

.lime-circle {
  flex: none;
  display: grid;
  place-items: center;
  background-color: var(--color-lime);
  width: 10.4cqw;
  height: 10.4cqw;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.arrow-right-img {
  width: 50%;
  height: auto;
  display: block;
}

.open-book-btn:hover .lime-circle {
  transform: translateX(3px) rotate(-5deg);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.22);
}

/* =========================================================
   BACK FACE: LEFT PAGE (Inside Spread)
   transform: rotateY(180deg) so it is right-side up when open!
   ========================================================= */

.cover-face-back {
  transform: rotateY(180deg) translateZ(1px);
  z-index: 1;
  border-radius: 4px 0 0 4px;
  background: transparent;
}

.book-stage.is-opening .cover-face-back,
.book-stage.is-closing .cover-face-back {
  background: url('assets/sketchbook/open-book-blank.webp') left center / 200% 100% no-repeat;
  border-radius: 4px 0 0 4px;
}

.book-stage.is-open .cover-face-back {
  background: transparent;
}

/* During the flip, hide the left half of the stationary blank spread so no empty page shows;
   the turning cover's back face carries the real left page in (and back out on close). */
.book-stage:not(.is-single-page).is-opening .spread-base,
.book-stage:not(.is-single-page).is-closing .spread-base {
  clip-path: inset(-10% -10% -10% 50%);
}

/* Light falloff on the turning cover: the face darkens as it tilts away and brightens as it lands.
   Two-keyframe animations share the hinge's easing so shading tracks the rotation angle. */
.book-stage:not(.is-single-page) .cover-face::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}

.book-stage:not(.is-single-page) .cover-face-front::after {
  border-radius: 0 4px 4px 0;
  background: linear-gradient(to left, rgba(0, 10, 40, 0.55), rgba(0, 10, 40, 0.25) 70%, rgba(0, 10, 40, 0.15));
  /* Clip shading to the cover's silhouette so it never darkens the blue backdrop */
  -webkit-mask: url('assets/sketchbook/native/blank-book.webp') center / 100% 100% no-repeat;
  mask: url('assets/sketchbook/native/blank-book.webp') center / 100% 100% no-repeat;
}

.book-stage:not(.is-single-page) .cover-face-back::after {
  border-radius: 4px 0 0 4px;
  background: linear-gradient(to right, rgba(0, 10, 40, 0.5), rgba(0, 10, 40, 0.2) 70%, rgba(0, 10, 40, 0.1));
  /* Clip shading to the left page's silhouette (same slice the face's paper background uses) */
  -webkit-mask: url('assets/sketchbook/open-book-blank.webp') left center / 200% 100% no-repeat;
  mask: url('assets/sketchbook/open-book-blank.webp') left center / 200% 100% no-repeat;
}

.book-stage:not(.is-single-page).is-opening .cover-face-front::after {
  animation: coverShadeIn 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

.book-stage:not(.is-single-page).is-opening .cover-face-back::after {
  animation: coverShadeOut 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

.book-stage:not(.is-single-page).is-closing .cover-face-back::after {
  animation: coverShadeIn 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

.book-stage:not(.is-single-page).is-closing .cover-face-front::after {
  animation: coverShadeOut 1.1s cubic-bezier(0.32, 0, 0.15, 1) forwards;
}

@keyframes coverShadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes coverShadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.page-left {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  background: transparent;
}

.left-paper-bg {
  display: none !important;
}

.left-page-content {
  position: absolute;
  top: 8%;
  bottom: 10%;
  left: 14%;
  right: 8%;
  width: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  container-type: inline-size;
  user-select: text;
  background: transparent;
  box-sizing: border-box;
}

/* Left Page Header Row: 4-line Heading + Beside it Architecture Sticker */
.left-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  position: relative;
}

.left-heading-container {
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
}

.left-page-heading {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  font-size: clamp(24px, 5.8cqw, 32px);
  outline: none;
  text-align: left;
}

.heading-line {
  display: block;
  font-weight: 850;
  text-align: left;
}

.heading-line.line-2,
.heading-line.line-4 {
  font-weight: 850;
  letter-spacing: -0.03em;
}

/* Rough-edged lime highlight behind Explorer */
.highlight-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.highlight-svg {
  position: absolute;
  left: -5px;
  right: -5px;
  top: -2px;
  bottom: -2px;
  width: calc(100% + 10px);
  height: calc(100% + 4px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.95;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 1px 2px rgba(189, 255, 0, 0.35));
}

.highlight-text {
  position: relative;
  z-index: 2;
  color: var(--color-ink);
  font-weight: 900;
}

/* Architecture Sticker beside heading (Draggable) */
.architecture-sticker-wrapper {
  flex: 0 0 auto;
  position: relative;
  width: clamp(72px, 16cqw, 92px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  transform: rotate(-3deg);
  transition: transform 0.15s ease-out;
  z-index: 10;
  margin-top: -4px;
  margin-right: 0;
}

.architecture-sticker-wrapper:focus-visible {
  outline: 2px dashed #0647fa;
  outline-offset: 4px;
  border-radius: 6px;
}

.architecture-sticker-wrapper:hover {
  transform: rotate(-1deg) scale(1.04);
}

.architecture-sticker-wrapper.is-dragging {
  cursor: grabbing;
  z-index: 50 !important;
  transform: scale(1.08) rotate(0deg);
  filter: drop-shadow(0 14px 24px rgba(0, 18, 60, 0.35));
}

.arch-accent-rays {
  position: absolute;
  top: -14px;
  right: 6px;
  width: 28px;
  height: 15px;
  pointer-events: none;
}

.architecture-sticker-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 16, 50, 0.16));
  -webkit-user-drag: none;
}

/* Bio Paragraph Container with Marker Highlights & Lightweight Accents */
.left-paragraph-container {
  margin-top: clamp(14px, 3.5cqw, 22px);
  position: relative;
  width: 100%;
  text-align: left;
  padding-left: 0;
  margin-left: 0;
}

.bio-sparkle-accent {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.left-page-bio {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 400;
  font-size: clamp(13px, 2.8cqw, 15px);
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: #1a1a18;
  max-width: 100%;
  text-align: left;
}

/* Marker Highlights */
.marker-peach {
  background-color: #fed7aa;
  padding: 1px 4px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: inherit;
}

.marker-lavender {
  background-color: #e9d5ff;
  padding: 1px 4px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: inherit;
}

.marker-underline {
  border-bottom: 2px solid #0647fa;
  padding-bottom: 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: inherit;
}

.marker-lime {
  background-color: rgba(189, 255, 0, 0.65);
  padding: 1px 4px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: inherit;
}

.bio-cursor-accent {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  margin-bottom: -3px;
  pointer-events: none;
}

/* 4-Stop Timeline */
.left-timeline-block {
  margin-top: clamp(14px, 3.5cqw, 22px);
  position: relative;
  width: 100%;
  text-align: left;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.6cqw, 10px);
}

.timeline-continuous-line {
  position: absolute;
  left: 2.75px;
  width: 2px;
  background-color: var(--color-blue);
  z-index: 1;
  pointer-events: none;
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.timeline-item:not(:last-child)::before {
  display: none !important;
}

.timeline-bullet {
  flex: none;
  width: 7.5px;
  height: 7.5px;
  margin-top: 4px;
  border-radius: 50%;
  background-color: var(--color-blue);
  box-shadow: 0 0 0 2px #fff0d7;
  z-index: 2;
}

.timeline-item-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.timeline-institution {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(13.5px, 2.8cqw, 16px);
  color: var(--color-ink);
  letter-spacing: -0.015em;
  line-height: 1.18;
}

.timeline-type {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(11px, 2.2cqw, 12.5px);
  color: #0647fa;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* Page Numbers 01 and 02 aligned at same distance from bottom (inside the paper, above the curled bottom edge) */
.page-number {
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(11px, 2cqw, 13px);
  color: #847a6b;
  letter-spacing: 0.04em;
  user-select: none;
}

.page-number-left {
  left: 14%;
  bottom: 11%;
}

.page-number-right {
  right: 14%;
  bottom: 11%;
}

.reset-stickers-btn {
  display: none !important;
}

/* =========================================================
   SCENE CONTROLS (Close book, Drag hint, Reset stickers)
   ========================================================= */

.scene-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 24px;
  position: relative;
  z-index: var(--z-scene-controls);
  user-select: none;
  width: 100%;
  max-width: 680px;
}

.page-nav-controls {
  display: none;
  align-items: center;
  gap: 8px;
}

.book-stage.is-single-page ~ .scene-controls .page-nav-controls {
  display: inline-flex;
}

.page-switch-btn.is-active {
  background: var(--color-lime);
  color: var(--color-ink);
  font-weight: 700;
  border-color: var(--color-lime);
}

.single-page-next-btn,
.single-page-prev-btn {
  display: none;
}

.control-btn {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 16, 60, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 36px;
}

.control-btn:hover {
  background: rgba(0, 20, 80, 0.8);
  color: var(--color-lime);
  border-color: var(--color-lime);
  transform: translateY(-1px);
}

.control-btn:focus-visible {
  outline: 2px solid var(--color-lime);
  outline-offset: 3px;
}

.close-book-btn,
.reset-stamps-btn {
  display: none;
}

.book-stage.is-open ~ .scene-controls .close-book-btn,
.book-stage.is-opening ~ .scene-controls .close-book-btn,
.book-stage.is-open ~ .scene-controls .reset-stamps-btn,
.book-stage.is-opening ~ .scene-controls .reset-stamps-btn {
  display: inline-flex;
}

.close-icon-svg,
.reset-icon-svg {
  width: 14px;
  height: 14px;
}

.sticker-drag-hint {
  font-family: 'Caveat', cursive;
  font-size: 16px;
  color: var(--color-lime);
  letter-spacing: 0.02em;
  opacity: 0.95;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sticker-drag-hint.is-hidden {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   CHAPTER DIALOG / MODAL
   ========================================================= */

.chapter-dialog {
  border: none;
  border-radius: 20px;
  background-color: var(--color-paper);
  padding: 40px;
  max-width: 520px;
  width: calc(100% - 40px);
  color: var(--color-ink);
  box-shadow: 0 24px 80px rgba(0, 22, 71, 0.55);
}

.chapter-dialog::backdrop {
  background-color: rgba(0, 27, 79, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-content {
  position: relative;
  display: flex;
  flex-direction: column;
}

.dialog-close-btn {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
  color: #64748b;
  border-radius: 50%;
  transition: color 0.15s ease, transform 0.15s ease;
}

.dialog-close-btn:hover {
  color: var(--color-ink);
  transform: scale(1.1);
}

.dialog-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #693bfe;
}

.dialog-title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 8px 0 14px;
  line-height: 1.15;
}

.dialog-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin: 0 0 20px;
}

.dialog-project-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.dialog-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dialog-project-item:hover {
  background: #ffffff;
  border-color: var(--color-blue);
  transform: translateX(3px);
}

.proj-text strong {
  display: block;
  font-size: 15px;
  color: var(--color-ink);
}

.proj-text span {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.proj-arrow {
  font-size: 18px;
  color: var(--color-blue);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.dialog-back-btn {
  background-color: var(--color-lime);
  color: var(--color-ink);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dialog-back-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ========================================================= */

@media (max-width: 1024px) {
  .site-header {
    padding: 20px 32px;
  }
  .main-stage {
    padding: 8px 24px 28px;
  }
}

/* Mobile Screens (< 768px): clean accessible single-line navigation */
@media (max-width: 768px) {
  .site-header {
    padding: 14px clamp(12px, 3.5vw, 20px) 8px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .wordmark {
    font-size: 24px;
  }

  .site-header nav {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: clamp(4px, 1.8vw, 10px);
    overflow-x: auto;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }

  .site-header nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .nav-item {
    font-size: clamp(11.5px, 2.7vw, 13px);
    padding: 4px 1px;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .main-stage {
    padding: 20px 16px 40px;
    min-height: calc(100svh - 100px);
  }

  /* When book is closed on mobile */
  .book-stage.is-closed .book-spread,
  .book-stage.is-closing .book-spread {
    transform: translateX(0%) rotate(0deg);
  }

  .book-stage.is-closed .spread-base,
  .book-stage.is-closed .page-right {
    display: none;
  }

  .book-stage.is-closed .hinged-cover {
    left: 0;
    width: 100%;
    transform: rotateY(0deg) !important;
  }

  .book-stage.is-closed .id-tag-wrapper {
    right: -12%;
    width: 32%;
  }

  .open-book-btn {
    width: auto;
    right: 5%;
  }

  .lime-circle {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hinged-cover,
  .book-spread {
    transition: opacity 0.2s ease !important;
  }
}

/* =========================================================
   EXPERIMENT NOTE SECTION: "Keep calm. Experiment on."
   Centered notebook note on plain white background
   ========================================================= */

.experiment-note-section {
  position: relative;
  z-index: 20;
  width: 100%;
  background-color: #ffffff;
  /* At least 140px visible whitespace between preceding hero and top edge of note */
  padding-top: 155px;
  /* Balanced gap to paper plane animation centered between toolkit and Selected work */
  padding-bottom: clamp(24px, 3.5vh, 40px);
  overflow: visible;
  box-sizing: border-box;
}

.experiment-grid-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-image: url('assets/note/pale-blue-grid-tile-2x.webp');
  background-repeat: repeat;
  background-position: center top;
  background-size: 1200px auto; /* 50px square grid cells on desktop */
  /* Subtle fade to white at top (blends from hero) and bottom (blends into Selected work) */
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.4) 60px,
    rgba(0, 0, 0, 1) 160px,
    rgba(0, 0, 0, 1) calc(100% - 90px),
    rgba(0, 0, 0, 0.4) calc(100% - 30px),
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.4) 60px,
    rgba(0, 0, 0, 1) 160px,
    rgba(0, 0, 0, 1) calc(100% - 90px),
    rgba(0, 0, 0, 0.4) calc(100% - 30px),
    rgba(0, 0, 0, 0) 100%
  );
}

@media (max-width: 768px) {
  .experiment-grid-background {
    background-size: 840px auto; /* 35px square grid cells on mobile */
  }
}

.experiment-scene-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow: visible;
  padding: 0 clamp(16px, 3vw, 36px);
}

.note-outer-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  z-index: 6;
}

/* Entire note assembly rotated approximately -3 degrees */
.note-assembly {
  position: relative;
  width: clamp(340px, 46vw, 610px);
  aspect-ratio: 1024 / 661;
  /* Note text is sized in cqw (card width) so it always stays inside the cream sheet */
  container-type: inline-size;
  transform: rotate(-3deg);
  transform-origin: center center;
  user-select: text;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Layered elements within note assembly */
.note-layer {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

/* Paper layer with authentic cream sheet, orange & cobalt backings */
.note-paper {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 2;
  /* Assets already include natural shadows; subtle extra depth only */
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.04));
}

/* Yellow masking tape across top-left corner (~18% width, -25deg rotation) */
.note-tape {
  top: -3.5%;
  left: 2.5%;
  width: 18.2%;
  aspect-ratio: 1024 / 380;
  transform: rotate(-25deg);
  transform-origin: center center;
  z-index: 15;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

/* Lavender circular asterisk badge near upper-right paper edge (~12% width) */
.note-badge {
  top: 9.8%;
  right: 7.8%;
  width: 12.8%;
  aspect-ratio: 1 / 1;
  z-index: 15;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.09));
}

/* Lime asterisk sticker overlapping lower-left edge (~11% width) */
.note-asterisk {
  bottom: 10%;
  left: 3.5%;
  width: 11.8%;
  aspect-ratio: 1024 / 973;
  transform: rotate(-8deg);
  transform-origin: center center;
  z-index: 15;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.09));
}

/* Live HTML text strictly inside the cream paper sheet */
.note-content {
  position: absolute;
  top: 23%;
  left: 14%;
  right: 12%;
  bottom: 8%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
  box-sizing: border-box;
}

/* Eyebrow: A NOTE TO SELF */
.note-eyebrow {
  margin: 0 0 2cqw 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: max(9.5px, 1.9cqw);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #27272a;
  line-height: 1;
  user-select: text;
}

/* Main Heading: Keep calm. / Experiment on. */
.note-heading {
  margin: 0 0 3cqw 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 7.4cqw;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
  display: flex;
  flex-direction: column;
  user-select: text;
}

.note-heading-line {
  display: block;
}

.note-heading-dark {
  color: #080807;
}

.note-heading-cobalt {
  color: #263DE8;
  white-space: nowrap;
}

/* Paragraph: A little curiosity, a lot of trying... */
.note-paragraph {
  margin: 0;
  max-width: 80%;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 2.75cqw;
  font-weight: 400;
  line-height: 1.45;
  color: #18181b;
  letter-spacing: -0.005em;
  user-select: text;
}

/* Signature: Rushabh in Caveat aligned toward lower-right */
.note-signature-area {
  position: absolute;
  right: 1.5%;
  bottom: 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.note-signature {
  font-family: 'Caveat', cursive;
  font-size: 5.6cqw;
  font-weight: 700;
  color: #18181b;
  line-height: 0.9;
  transform: rotate(-3deg);
  user-select: text;
}

.note-signature-stroke {
  width: clamp(65px, 6vw, 88px);
  height: auto;
  margin-top: -2px;
  pointer-events: none;
}

/* =========================================================
   TOOLKIT JAR ANIMATION SECTION
   Glass jar, cobalt lid, lime sticker, and software icon atlas
   ========================================================= */

.toolkit-jar-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 45-70px clear gap from note's lowest edge to jar rim */
  margin-top: 55px;
  box-sizing: border-box;
  overflow: visible;
}

/* Background hand-drawn doodle sparks */
.jar-doodles-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Flight layer: unclipped, spans the whole scene */
.jar-icons-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
  overflow: visible;
}

/* Individual software icon card */
.jar-tool-icon {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transform-origin: center center;
  opacity: 0;
  /* Visual depth for card without overpowering artwork */
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.08));
}

.jar-icon-crop {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  background: transparent;
}

.jar-icon-img {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

/* Jar Stage Wrapper & Assembly */
.jar-stage-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  z-index: 8;
}

.jar-stage {
  position: relative;
  width: 268px;
  height: 350px;
  overflow: visible;
  will-change: transform;
  transform-origin: 50% 95%;
}

/* Ground shadow underneath jar base */
.jar-ground-shadow {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.04) 55%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Ground shadow under resting lid */
.lid-ground-shadow {
  position: absolute;
  bottom: 22px;
  right: -90px;
  width: 140px;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.16) 0%, rgba(15, 23, 42, 0.03) 55%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Jar interior container clipped to jar shape */
.jar-interior {
  position: absolute;
  inset: 0;
  clip-path: url(#jarInteriorClip);
  -webkit-clip-path: url(#jarInteriorClip);
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.jar-back-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(235, 244, 255, 0.16) 0%, rgba(210, 230, 255, 0.08) 100%);
  pointer-events: none;
}

/* Question mark sticker inside the jar */
.jar-question-mark {
  position: absolute;
  top: 140px;
  left: 50%;
  width: 85px;
  height: auto;
  transform: translate(-50%, -60px) scale(0.6);
  opacity: 0;
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  pointer-events: none;
  will-change: transform, opacity;
}

/* Front glass overlay with soft center mask */
.jar-glass-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 4;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 1) 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 1) 100%);
}

/* Jar Paper Label: "Tools I’m exploring" */
.jar-paper-label {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 136px;
  height: 28px;
  background: #faf7f0;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: auto;
  user-select: text;
  border: 1px solid rgba(215, 205, 190, 0.75);
}

.jar-label-text {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  font-weight: 600;
  color: #18181b;
  line-height: 1;
  letter-spacing: -0.01em;
  user-select: text;
}

/* Silver Metal Lid Carrier */
.jar-lid-carrier {
  position: absolute;
  top: 20px;
  left: 48px;
  width: 171.4px;
  height: 57.2px;
  pointer-events: none;
  z-index: 6;
  will-change: transform;
  transform: translate(0px, 0px) rotate(0deg);
}

.jar-lid-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.16));
}

/* "What's next?" handwritten annotation */
.jar-whats-next {
  position: absolute;
  top: 60px;
  right: -95px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 7;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  user-select: text;
}

.whats-next-text {
  font-family: 'Caveat', cursive;
  font-size: 23px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1;
  transform: rotate(-4deg);
  user-select: text;
}

.whats-next-arrow {
  width: 44px;
  height: 36px;
  margin-top: -2px;
  margin-left: -12px;
}

/* Jar Caption & Replay Area (Reserved space, no layout shift) */
.jar-caption-block {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  z-index: 8;
  opacity: 0.35;
  transition: opacity 0.6s ease;
}

.jar-caption-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #080807;
  margin: 0 0 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: text;
}

.jar-caption-subtitle {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(15.5px, 1.3vw, 18.5px);
  font-weight: 400;
  line-height: 1.45;
  color: #334155;
  margin: 0 0 18px 0;
  user-select: text;
}

/* Replay Button */
.jar-replay-btn {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 9999px;
  padding: 7px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.jar-replay-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.jar-replay-btn:active {
  transform: translateY(0);
}

.jar-replay-btn:focus-visible {
  outline: 2px solid #263de8;
  outline-offset: 3px;
}

.replay-icon {
  display: inline-block;
  font-size: 15px;
  transition: transform 0.3s ease;
}

.jar-replay-btn:hover .replay-icon {
  transform: rotate(90deg);
}

/* =========================================================
   SELECTED WORK HEADER SECTION
   Centered in its own plain white area without background grid
   ========================================================= */

/* =========================================================
   UNIFIED WORKS & ABOUT SHOWCASE WRAPPER
   Continuous seamless pale-blue graph grid spanning both
   Selected Work and "Still that kid" (Memory Machine)
   ========================================================= */

.works-and-about-wrapper {
  position: relative;
  z-index: 20;
  width: 100%;
  background-color: #ffffff;
  overflow: visible;
}

/* Positioned subtle hand-drawn blue grid background layer matching Keep Calm (behind Projects) */
.works-and-about-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--selected-works-height, 2600px);
  pointer-events: none;
  z-index: 0;
  background-image: url('assets/note/pale-blue-grid-tile-2x.webp');
  background-repeat: repeat;
  background-position: center top;
  background-size: 1200px auto; /* 50px square grid cells on desktop, matches Keep Calm */
  opacity: 0.5; /* Softer than the Keep Calm grid so project cards stand out, but still clearly visible */
  /* Hand-drawn blue grid matching Keep Calm with visible opacity (~0.78), fading out before About Me */
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.78) 120px,
    rgba(0, 0, 0, 0.78) calc(var(--selected-works-height, 2600px) - 140px),
    rgba(0, 0, 0, 0.35) calc(var(--selected-works-height, 2600px) - 50px),
    transparent var(--selected-works-height, 2600px)
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.78) 120px,
    rgba(0, 0, 0, 0.78) calc(var(--selected-works-height, 2600px) - 140px),
    rgba(0, 0, 0, 0.35) calc(var(--selected-works-height, 2600px) - 50px),
    transparent var(--selected-works-height, 2600px)
  );
}

@media (max-width: 768px) {
  .works-and-about-grid-bg {
    background-size: 840px auto; /* 35px square grid cells on mobile, matches Keep Calm */
  }
}

/* =========================================================
   SELECTED WORK SECTION
   Header area on seamless graph grid
   ========================================================= */

.selected-work-header-section {
  position: relative;
  z-index: 1;
  width: 100%;
  background-color: transparent;
  padding-top: clamp(48px, 6vh, 68px);
  padding-bottom: clamp(24px, 3.5vh, 36px);
  text-align: center;
  box-sizing: border-box;
}

.selected-work-header-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  box-sizing: border-box;
}

.selected-work-plane-wrapper {
  position: relative;
  width: clamp(340px, 52vw, 640px);
  max-width: 100%;
  margin: 0 auto clamp(36px, 5.5vh, 56px);
  opacity: 1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.selected-work-plane-video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.selected-work-title {
  margin: 0 0 16px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(42px, 4.6vw, 62px);
  font-weight: 850;
  letter-spacing: -0.04em;
  color: #080807;
  line-height: 1.1;
}

.selected-work-subtitle {
  margin: 0 auto;
  max-width: 620px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(16.5px, 1.35vw, 19.5px);
  font-weight: 400;
  color: #64748b;
  line-height: 1.45;
}

/* =========================================================
   PROJECTS SHOWCASE SECTION
   Hand-drawn pale-blue graph grid continues seamlessly
   ========================================================= */

.projects-section {
  position: relative;
  z-index: 1;
  width: 100%;
  background-color: transparent;
  padding-top: clamp(40px, 6vh, 64px);
  padding-bottom: clamp(120px, 14vh, 180px); /* Extra breathing room before About me */
  box-sizing: border-box;
  overflow: visible;
}

/* Positioned grid background layer: visual opacity reduced by ~65-70% (one-third as strong) */
.projects-section::before {
  display: none;
}

/* Subtle fade transition from solid white header into the blue grid */
.projects-grid-fade {
  display: none;
}

.projects-container {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4.5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(140px, 13vh, 180px);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* Alternating Project Rows (Media Left/Text Right vs Text Left/Media Right) */
.project-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(64px, 5.5vw, 80px);
  position: relative;
  box-sizing: border-box;
}

/* Media Column (~60% of row width) */
.project-media-col {
  flex: 0 0 clamp(320px, 58%, 760px);
  max-width: clamp(320px, 58%, 760px);
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.project-index-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #8b95a5;
  text-transform: uppercase;
  margin-bottom: 18px;
  margin-left: 2px;
  user-select: none;
  line-height: 1;
  position: relative;
  z-index: 15;
}

/* Paper Frame: Warm Ivory, Narrow border around 3:2 video aperture */
.project-paper-frame {
  position: relative;
  background-color: #FAF8F0;
  padding: clamp(12px, 1.3vw, 16px);
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 20px rgba(0, 16, 60, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  overflow: visible;
  box-sizing: border-box;
}

.project-paper-frame:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 16, 60, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
}

.project-aperture-link {
  display: block;
  width: 100%;
  text-decoration: none;
  outline: none;
  border-radius: 2px;
}

.project-aperture-link:focus-visible {
  outline: 2px solid #0047fa;
  outline-offset: 4px;
}

/* 3:2 Video Aperture */
.project-video-aperture {
  width: 100%;
  aspect-ratio: 3 / 2;
  background-color: #0c1017;
  overflow: hidden;
  border-radius: 2px;
  position: relative;
}

.project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  user-select: none;
}

/* Yellow Tape Decorations */
.tape-strip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  -webkit-user-drag: none;
  user-select: none;
}

.tape-upper-left {
  left: -14px;
  top: -12px;
  width: clamp(74px, 6.4vw, 84px);
  height: auto;
  transform: rotate(-22deg);
}

.tape-upper-right {
  right: -14px;
  top: -12px;
  width: clamp(74px, 6.4vw, 84px);
  height: auto;
  transform: rotate(20deg);
}

/* Location Pin Sticker (Sajag Lower-Left Edge) */
.sticker-pin {
  position: absolute;
  left: -18px;
  bottom: -18px;
  width: clamp(52px, 4.4vw, 60px);
  height: auto;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.16));
  -webkit-user-drag: none;
  user-select: none;
}

/* Snake Sticker (The Fear Between Us Lower-Left Edge) */
.sticker-snake {
  position: absolute;
  left: -20px;
  bottom: -22px;
  width: clamp(92px, 7.8vw, 108px);
  height: auto;
  pointer-events: none;
  z-index: 10;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.16));
  -webkit-user-drag: none;
  user-select: none;
}

/* Category Tabs (HTML text with paper overhang) */
.category-tab {
  position: absolute;
  right: 18px;
  bottom: -13px;
  padding: 5px 14px;
  border-radius: 4px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
  user-select: none;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

.tab-lavender {
  background-color: #E2D9F3;
  color: #2c1a4d;
}

.tab-peach {
  background-color: #FFE2D1;
  color: #5c2415;
}

.tab-mint {
  background-color: #D6EDE4;
  color: #184838;
}

/* Text Column (~40% of row width) */
.project-text-col {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  box-sizing: border-box;
}

.project-name {
  margin: 0 0 14px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(38px, 3.8vw, 50px);
  font-weight: 850;
  letter-spacing: -0.035em;
  color: #080807;
  line-height: 1.08;
}

.project-subheading {
  margin: 0 0 20px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #080807;
  line-height: 1.25;
}

/* Inline Marker Highlights */
.marker-highlight {
  display: inline;
  padding: 2px 6px 3px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  /* The highlighted phrase moves as one piece rather than splitting across lines */
  white-space: nowrap;
}

.marker-highlight.marker-lime {
  background-color: rgba(189, 255, 0, 0.72);
  color: inherit;
}

.marker-highlight.marker-peach {
  background-color: rgba(254, 215, 170, 0.88);
  color: inherit;
}

.project-desc {
  margin: 0 0 22px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(16px, 1.2vw, 17.5px);
  line-height: 1.5;
  color: #5A677A;
  max-width: 480px;
}

.project-meta-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14.5px;
  color: #64748B;
  margin-bottom: 14px; /* ~12-16px separation above capsules */
  font-weight: 450;
  user-select: text;
}

.project-meta-item {
  line-height: 1.4;
}

/* Project Discipline Badges (Capsules) */
.project-discipline-capsules {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px; /* ~24px separation above action links row */
}

.discipline-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border-radius: 9999px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  user-select: none;
  white-space: nowrap;
}

/* Lavender: pale lavender background with dark purple text */
.capsule-lavender {
  background-color: #E6E0F8;
  color: #4A3580;
}

/* Peach: pale peach background with dark warm-brown text */
.capsule-peach {
  background-color: #FDE8DE;
  color: #8B432C;
}

/* Mint: pale mint background with dark teal text */
.capsule-mint {
  background-color: #DCEEE7;
  color: #1D5C4A;
}

/* Action Links Row (Explore case study + Interactive demo on same baseline) */
.project-link-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(24px, 2.8vw, 32px);
  margin-top: 0;
}

.project-case-study-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #0047fa;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.15s ease, transform 0.15s ease;
  outline: none;
  line-height: 1.4;
}

.project-case-study-link:hover {
  color: #002db3;
  transform: translateX(2px);
}

.project-case-study-link:focus-visible {
  outline: 2px solid #0047fa;
  outline-offset: 4px;
  border-radius: 2px;
}

.link-arrow {
  display: inline-block;
  font-size: 15px;
  transition: transform 0.15s ease;
}

.project-case-study-link:hover .link-arrow {
  transform: translate(2px, -2px);
}

/* =========================================================
   RESPONSIVE LAYOUT (Tablets & Mobile Screens)
   ========================================================= */

@media (max-width: 860px) {
  .experiment-note-section {
    padding-top: 100px;
    padding-bottom: 60px;
  }

  .selected-work-header-section {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .project-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 36px !important;
  }

  .project-media-col {
    order: 1 !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .project-text-col {
    order: 2 !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .projects-container {
    gap: 96px !important;
  }
}

@media (max-width: 640px) {
  .experiment-note-section {
    padding-top: clamp(48px, 6vh, 64px);
    padding-bottom: clamp(24px, 3.5vh, 40px);
  }

  /* Switch to content-sized compact paper composition on mobile */
  .note-assembly {
    width: min(90vw, 390px);
    aspect-ratio: auto;
    min-height: auto;
    height: auto;
    transform: rotate(-1.5deg);
    border-radius: 4px;
    background-color: #fffdf7;
    /* Layered backing sheets: orange sheet top-left, cobalt sheet bottom-right */
    box-shadow: 
      -8px -8px 0 #f95d12,
      8px 8px 0 #0647fa,
      0 12px 28px rgba(0, 0, 0, 0.12);
    overflow: visible;
  }

  /* Decorative spiral binding top header */
  .note-paper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    object-fit: cover;
    object-position: center top;
    filter: none;
    z-index: 3;
    border-radius: 4px 4px 0 0;
  }

  .note-content {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 54px 24px 22px 24px;
    width: 100%;
    min-height: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .note-eyebrow {
    font-size: 11px;
    margin-bottom: 10px;
  }

  .note-heading {
    font-size: clamp(26px, 7vw, 30px);
    line-height: 1.05;
    margin-bottom: 14px;
  }

  /* Keep body text readable at a minimum of approximately 16px */
  .note-paragraph {
    max-width: 100%;
    font-size: 15.5px;
    line-height: 1.45;
    margin-bottom: 0;
  }

  .note-signature-area {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 22px;
    margin-left: auto;
    padding: 0;
  }

  .note-signature {
    font-size: 30px;
  }

  .note-tape {
    top: -12px;
    left: -8px;
    width: 24%;
  }

  .note-badge {
    top: 14px;
    right: -8px;
    width: 16%;
  }

  .note-asterisk {
    bottom: -10px;
    left: -8px;
    width: 15%;
  }

  .toolkit-jar-container {
    margin-top: clamp(48px, 7vh, 64px);
    padding-bottom: 28px;
  }

  .jar-stage {
    transform: scale(0.80);
    transform-origin: 50% 50%;
  }

  .jar-whats-next {
    right: -32px;
    top: 15px;
    transform: scale(0.80);
  }

  .jar-caption-title {
    font-size: 24px;
  }

  .jar-caption-subtitle {
    font-size: 15.5px;
  }
}

/* =========================================================
   ONE-PAGE-AT-A-TIME PHYSICAL BOOK VIEW (Narrow / High Zoom)
   Uses the exact same physical book artwork (open-book-blank.png)
   cropped per page, keeping realistic paper texture, layered
   edges, cover outline, and the appropriate spine shadow!
   ========================================================= */

.book-stage.is-single-page {
  width: var(--spread-width);
  height: var(--spread-height);
  min-height: var(--spread-height);
  max-width: 100%;
  margin: 0 auto;
}

.book-stage.is-single-page .book-spread {
  perspective: none !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  background: transparent !important;
}

/* Hide desktop spread base image completely in single-page mode - NO rectangular cream box! */
.book-stage.is-single-page .spread-base {
  display: none !important;
}

/* Layered 3-Slice Paper Frame for Mobile (preserves corners, spine stitches & cover rim without stretching) */
.mobile-paper-frame {
  display: none;
}

.book-stage.is-single-page .mobile-paper-frame {
  display: flex !important;
  flex-direction: column !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  filter: drop-shadow(0 14px 28px rgba(0, 16, 60, 0.28)) !important;
}

.book-stage.is-single-page .mobile-paper-cap-top {
  width: 100% !important;
  height: calc(var(--spread-width) * 0.17655) !important;
  flex: none !important;
  background-size: 100% 100% !important;
  background-position: top center !important;
  background-repeat: no-repeat !important;
}

.book-stage.is-single-page .mobile-paper-body {
  width: 100% !important;
  flex: 1 1 auto !important;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.book-stage.is-single-page .mobile-paper-cap-bottom {
  width: 100% !important;
  height: calc(var(--spread-width) * 0.17655) !important;
  flex: none !important;
  background-size: 100% 100% !important;
  background-position: bottom center !important;
  background-repeat: no-repeat !important;
}

/* Page 1 (Intro): Left Page 3-slice background */
.book-stage.is-single-page.show-page-1 .mobile-paper-cap-top {
  background-image: url('assets/sketchbook/mobile-left-top.webp');
}
.book-stage.is-single-page.show-page-1 .mobile-paper-body {
  background-image: url('assets/sketchbook/mobile-left-mid.webp');
}
.book-stage.is-single-page.show-page-1 .mobile-paper-cap-bottom {
  background-image: url('assets/sketchbook/mobile-left-bottom.webp');
}

/* Page 2 (More me): Right Page 3-slice background */
.book-stage.is-single-page.show-page-2 .mobile-paper-cap-top {
  background-image: url('assets/sketchbook/mobile-right-top.png');
}
.book-stage.is-single-page.show-page-2 .mobile-paper-body {
  background-image: url('assets/sketchbook/mobile-right-mid.png');
}
.book-stage.is-single-page.show-page-2 .mobile-paper-cap-bottom {
  background-image: url('assets/sketchbook/mobile-right-bottom.png');
}

/* Page 1 (Intro) Active Structure */
.book-stage.is-single-page.show-page-1 .hinged-cover {
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  z-index: 10 !important;
}

.book-stage.is-single-page.show-page-1 .cover-face-front {
  display: none !important;
}

.book-stage.is-single-page.show-page-1 .cover-face-back {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.book-stage.is-single-page.show-page-1 .page-left {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Content Area strictly INSIDE the visible paper bounds (24-32px padding off dark leather cover edge) */
.book-stage.is-single-page.show-page-1 .left-page-content {
  position: absolute !important;
  top: clamp(36px, 7.5vw, 44px) !important;
  bottom: clamp(40px, 9vw, 50px) !important;
  left: clamp(48px, 14vw, 58px) !important;
  right: clamp(20px, 6vw, 28px) !important;
  width: auto !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

.book-stage.is-single-page .left-page-heading {
  font-size: clamp(20px, 5vw, 24px) !important;
  line-height: 1.1 !important;
}

.book-stage.is-single-page .architecture-sticker-wrapper {
  width: clamp(58px, 14vw, 70px) !important;
}

.book-stage.is-single-page .left-paragraph-container {
  margin-top: 10px !important;
}

.book-stage.is-single-page .left-page-bio {
  font-size: clamp(12.5px, 3.2vw, 13.5px) !important;
  line-height: 1.35 !important;
}

.book-stage.is-single-page .left-timeline-block {
  margin-top: 8px !important;
}

.book-stage.is-single-page .timeline-list {
  gap: 3px !important;
}

.book-stage.is-single-page .timeline-institution {
  font-size: clamp(11.5px, 3vw, 13px) !important;
}

.book-stage.is-single-page .timeline-role {
  font-size: 10px !important;
}

.book-stage.is-single-page .timeline-item {
  gap: 7px !important;
}

.book-stage.is-single-page.show-page-1 .page-number-left {
  left: clamp(48px, 14vw, 58px) !important;
  bottom: clamp(16px, 3.5vh, 22px) !important;
  font-size: 13px !important;
}

.book-stage.is-single-page.show-page-1 .page-right,
.book-stage.is-single-page.show-page-1 .id-tag-wrapper {
  display: none !important;
}

.book-stage.is-single-page.show-page-1 .single-page-next-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  position: absolute;
  right: clamp(20px, 6vw, 28px);
  bottom: clamp(14px, 3vh, 20px);
  background: rgba(0, 16, 60, 0.78);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  z-index: 25;
  transition: all 0.2s ease;
}

.book-stage.is-single-page.show-page-1 .single-page-next-btn:hover {
  background: rgba(0, 20, 80, 0.9);
  color: var(--color-lime);
  border-color: var(--color-lime);
}

.book-stage.is-single-page.show-page-1 .single-page-next-btn svg {
  width: 14px;
  height: 14px;
}

/* Page 2 (More me) Active Structure */
.book-stage.is-single-page.show-page-2 .hinged-cover {
  display: none !important;
}

.book-stage.is-single-page.show-page-2 .page-left {
  display: none !important;
}

.book-stage.is-single-page.show-page-2 .page-right {
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  z-index: 10 !important;
}

/* Content Area strictly INSIDE the visible paper bounds on Right Page (24-32px padding off right cover edge) */
.book-stage.is-single-page.show-page-2 .right-page-content {
  position: absolute !important;
  top: clamp(36px, 7.5vw, 44px) !important;
  bottom: clamp(40px, 9vw, 50px) !important;
  left: clamp(20px, 6vw, 28px) !important;
  right: clamp(48px, 14vw, 58px) !important;
  width: auto !important;
  height: auto !important;
}

.book-stage.is-single-page.show-page-2 .right-heading-block {
  margin-bottom: 6px !important;
}

.book-stage.is-single-page.show-page-2 .right-sans-title {
  font-size: clamp(20px, 5vw, 24px) !important;
  line-height: 1.1 !important;
}

.book-stage.is-single-page.show-page-2 .page-number-right {
  right: clamp(48px, 14vw, 58px) !important;
  bottom: clamp(16px, 3.5vh, 22px) !important;
  font-size: 13px !important;
}

.book-stage.is-single-page.show-page-2 .next-chapter-btn {
  display: none !important;
}

.book-stage.is-single-page.show-page-2 .id-tag-wrapper {
  display: block !important;
  position: absolute !important;
  right: -2% !important;
  top: 1% !important;
  width: clamp(50px, 14vw, 66px) !important;
  z-index: 25 !important;
}

/* Portrait with Starburst on Mobile Page 2 - Centered between Hobbies (left) and Travel Stamps (right) */
.book-stage.is-single-page.show-page-2 .walking-portrait-wrapper {
  width: 36% !important;
  left: 48% !important;
  top: 30% !important;
}

/* Portrait Caption: Allowed to wrap to 2 lines within its column, maintaining at least 20px clearance from Reading */
.book-stage.is-single-page.show-page-2 .portrait-travel-caption {
  max-width: 105px !important;
  white-space: normal !important;
  line-height: 1.2 !important;
  font-size: 12px !important;
  text-align: center !important;
  margin-top: 4px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.book-stage.is-single-page.show-page-2 .travel-stamp-item {
  width: clamp(80px, 24vw, 100px) !important;
}

.book-stage.is-single-page.show-page-2 .single-page-prev-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: clamp(20px, 6vw, 28px);
  bottom: clamp(14px, 3vh, 20px);
  background: rgba(0, 16, 60, 0.78);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  z-index: 25;
  transition: all 0.2s ease;
}

.book-stage.is-single-page.show-page-2 .single-page-prev-btn:hover {
  background: rgba(0, 20, 80, 0.9);
  color: var(--color-lime);
  border-color: var(--color-lime);
}

.book-stage.is-single-page.show-page-2 .single-page-prev-btn svg {
  width: 14px;
  height: 14px;
}

.book-stage.is-single-page ~ .scene-controls {
  margin-top: 16px !important;
  gap: 8px !important;
  padding: 0 12px !important;
}

/* =========================================================
   HERO ENTRANCE SEQUENCE & READINESS STATES
   1. Blue background, logo, navigation immediately.
   2. Book base image complete load & decode before reveal.
   3. Subtle 200-300ms opacity transition for complete book.
   4. Staggered fade-in of cover text, stickers, open control.
   5. Secondary decorative elements (crawler video, drag hint, id tag) last.
   ========================================================= */

/* Stage 1 initial hidden states */
.book-stage.is-loading .book-base {
  opacity: 0 !important;
}

.closed-cover-inner .book-grid,
.closed-cover-inner .intro-block,
.closed-cover-inner .sticker-drag-wrapper,
.closed-cover-inner .open-book-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Stage 3: Complete book revealed with 260ms opacity transition */
.book-stage.is-book-visible .book-base,
.book-stage.is-cover-ready .book-base,
.book-stage.is-scene-ready .book-base,
.book-stage.is-ready .book-base {
  opacity: 1;
}

/* Stage 4: Cover overlays fade in in restrained sequence once book is visible */
.book-stage.is-cover-ready .closed-cover-inner .book-grid,
.book-stage.is-scene-ready .closed-cover-inner .book-grid,
.book-stage.is-ready .closed-cover-inner .book-grid {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease-out;
}

.book-stage.is-cover-ready .closed-cover-inner .intro-block,
.book-stage.is-scene-ready .closed-cover-inner .intro-block,
.book-stage.is-ready .closed-cover-inner .intro-block {
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease-out 40ms;
}

.book-stage.is-cover-ready .closed-cover-inner .sticker-wrapper-role,
.book-stage.is-scene-ready .closed-cover-inner .sticker-wrapper-role,
.book-stage.is-ready .closed-cover-inner .sticker-wrapper-role {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease-out 80ms, transform 220ms cubic-bezier(0.2, 0, 0.2, 1) 80ms;
}

.book-stage.is-cover-ready .closed-cover-inner .sticker-wrapper-portrait,
.book-stage.is-scene-ready .closed-cover-inner .sticker-wrapper-portrait,
.book-stage.is-ready .closed-cover-inner .sticker-wrapper-portrait {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease-out 120ms, transform 220ms cubic-bezier(0.2, 0, 0.2, 1) 120ms;
}

.book-stage.is-cover-ready .closed-cover-inner .sticker-wrapper-cursor,
.book-stage.is-scene-ready .closed-cover-inner .sticker-wrapper-cursor,
.book-stage.is-ready .closed-cover-inner .sticker-wrapper-cursor {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease-out 160ms, transform 220ms cubic-bezier(0.2, 0, 0.2, 1) 160ms;
}

.book-stage.is-cover-ready .closed-cover-inner .open-book-btn,
.book-stage.is-scene-ready .closed-cover-inner .open-book-btn,
.book-stage.is-ready .closed-cover-inner .open-book-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease-out 200ms, transform 220ms cubic-bezier(0.2, 0, 0.2, 1) 200ms;
}

/* Stage 5: Secondary decorative elements reveal last */
.id-tag-wrapper {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.book-stage.is-scene-ready .id-tag-wrapper,
.book-stage.is-ready .id-tag-wrapper {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.crawler-video {
  opacity: 0;
  transition: opacity 400ms ease-out;
}

body.is-scene-ready .crawler-video,
body.is-ready .crawler-video,
.book-stage.is-scene-ready ~ .crawler-video,
.book-stage.is-ready ~ .crawler-video {
  opacity: 1 !important;
  visibility: visible !important;
}

body.is-book-open .crawler-video,
.book-stage.is-open ~ .crawler-video {
  opacity: 0 !important;
}

.sticker-drag-hint {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

body.is-scene-ready .sticker-drag-hint:not(.is-hidden),
.book-stage.is-scene-ready ~ .scene-controls .sticker-drag-hint:not(.is-hidden),
.book-stage.is-ready ~ .scene-controls .sticker-drag-hint:not(.is-hidden) {
  opacity: 0.95;
}

/* Prefers-reduced-motion: reveal ready content instantly without animations */
@media (prefers-reduced-motion: reduce) {
  .book-base,
  .closed-cover-inner .book-grid,
  .closed-cover-inner .intro-block,
  .closed-cover-inner .sticker-drag-wrapper,
  .closed-cover-inner .open-book-btn,
  .id-tag-wrapper,
  .crawler-video,
  .sticker-drag-hint {
    transition: none !important;
    transition-delay: 0s !important;
    transform: none !important;
  }
}

/* =========================================================
   MEMORY MACHINE SECTION ("A LITTLE MORE ME")
   Unified scrapbook composition seamlessly sharing the pale-blue
   graph grid background with Selected Work
   ========================================================= */

/* =========================================================
   ABOUT SECTION ("BEHIND THE WORK" / STILL THAT KID)
   Full-width decorative torn paper top edge & solid near-white continuation
   ========================================================= */

.memory-machine-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background-color: transparent;
  color: #1a1917;
  padding: 0 0 clamp(90px, 10vw, 140px) 0;
  margin-top: 0;
  overflow: visible;
  box-sizing: border-box;
}

/* Full-bleed decorative paper backdrop layer with doodle grid background */
.about-paper-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: #fefdf9;
  background-image: url('assets/about-bg.jpg?v=2');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* Feathered top edge so the paper melts into the projects grid instead of a hard seam */
  --about-feather: clamp(140px, 16vw, 240px);
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather)
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather)
  );
}

@media (max-width: 768px) {
  .about-paper-bg {
    background-size: cover;
    background-position: center top;
  }
}

.about-paper-torn-layer,
.about-paper-fill,
.about-paper-torn-img {
  display: none !important;
}

/* Section Introduction Header: centred pill above the heading */
.about-intro-header {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto clamp(40px, 4.5vw, 68px);
  padding: clamp(28px, 3vw, 48px) clamp(20px, 4vw, 64px) 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Cobalt "ABOUT ME" pill */
.about-section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-blue, #0647fa);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(6, 71, 250, 0.25);
  user-select: none;
  line-height: 1.2;
}

/* "Behind the work." Section Heading */
.about-section-heading {
  margin: clamp(12px, 1.4vw, 18px) 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(36px, 4.2vw, 64px);
  font-weight: 850;
  letter-spacing: -0.045em;
  color: #080807;
  line-height: 1.04;
}

/* Childhood photos / copy / VR figure / printer, about 20 / 28 / 25 / 27 */
.memory-machine-container {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 20fr) minmax(0, 28fr) minmax(0, 25fr) minmax(0, 27fr);
  column-gap: clamp(20px, 2.4vw, 44px);
  align-items: start;
  z-index: 2;
  box-sizing: border-box;
}

.memory-col {
  position: relative;
  min-width: 0;
  z-index: 2;
}

/* =========================================================
   COLUMN 1: CHILDHOOD COLLAGE
   ========================================================= */

.memory-col-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.childhood-collage-wrap {
  position: relative;
  width: 100%;
  max-width: 315px;
  margin: 0 auto;
}

/* White photographic borders & polaroid shadows */
.childhood-photo-card {
  position: relative;
  background: #ffffff;
  padding: 12px 12px 18px 12px;
  border-radius: 2px;
  box-shadow:
    0 12px 30px rgba(35, 25, 15, 0.12),
    0 2px 8px rgba(35, 25, 15, 0.08);
  box-sizing: border-box;
}

.childhood-img-frame {
  width: 100%;
  overflow: hidden;
  background: #faf7ee;
  border-radius: 1px;
}

.childhood-img-frame img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

/* Turban Photo (behind) */
.childhood-turban-card {
  z-index: 1;
  width: 86%;
  transform: rotate(-3.5deg);
  transition: transform 0.25s ease-out;
}

.childhood-turban-card:hover {
  transform: rotate(-2deg) scale(1.02);
  z-index: 4;
}

/* Yellow Tape across turban top edge */
.childhood-tape {
  position: absolute;
  top: -14px;
  left: 28%;
  width: 38%;
  max-width: 105px;
  height: auto;
  transform: rotate(-6deg);
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  pointer-events: none;
}

/* Birthday Photo (in front, overlapping only the turban photo's lower edge so both faces show) */
.childhood-birthday-card {
  z-index: 2;
  width: 88%;
  margin-top: -16%;
  margin-left: auto;
  transform: rotate(3.5deg);
  transition: transform 0.25s ease-out;
}

.childhood-birthday-card:hover {
  transform: rotate(2deg) scale(1.02);
  z-index: 4;
}

/* Decorative Sparkles */
.childhood-sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.childhood-sparkle-top {
  top: 30%;
  left: -24px;
  width: 26px;
  height: auto;
}

.childhood-sparkle-bottom {
  bottom: -34px;
  right: 10%;
  width: 26px;
  height: auto;
}

/* Caption "Little me." */
.childhood-caption-wrap {
  position: relative;
  z-index: 3;
  margin: 26px 0 0;
  align-self: flex-start;
  padding-left: 8%;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  transform: rotate(-4deg);
}

.childhood-caption-text {
  font-family: 'Caveat', cursive;
  font-size: clamp(30px, 2.3vw, 36px);
  font-weight: 700;
  color: #0647fa;
  line-height: 1.05;
}

.childhood-caption-underline {
  width: 110px;
  height: 16px;
  margin-top: -2px;
  display: block;
}

/* =========================================================
   COLUMN 2: COPY
   ========================================================= */

.memory-col-center {
  padding-top: clamp(12px, 2vw, 32px);
}

.memory-intro-block {
  width: 100%;
  max-width: 470px;
}

.memory-main-heading {
  font-family: 'Plus Jakarta Sans', var(--font-sans), sans-serif;
  font-size: clamp(46px, 4.6vw, 78px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: #080807;
  margin: 0 0 clamp(20px, 2vw, 30px);
}

.memory-main-para {
  font-family: 'Plus Jakarta Sans', var(--font-sans), sans-serif;
  font-size: clamp(18px, 1.25vw, 20px);
  font-weight: 600;
  line-height: 1.5;
  color: #1f1e1c;
  margin: 0 0 clamp(20px, 2vw, 28px);
}

/* Lime marker highlight */
.lime-marker {
  background: rgba(189, 255, 0, 0.45);
  color: inherit;
  padding: 1px 6px 3px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.memory-body p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.55;
  color: #3b3833;
  margin: 0 0 clamp(12px, 1.1vw, 16px);
}

.memory-body p:last-child {
  margin-bottom: 0;
}

.memory-divider {
  width: 100%;
  max-width: 360px;
  height: 0;
  margin: clamp(22px, 2.4vw, 34px) 0;
  border: 0;
  border-top: 1px solid rgba(26, 25, 23, 0.22);
}

.memory-secondary-para {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.5;
  color: #3b3833;
  margin: 0;
}

/* Closing line in cobalt */
.memory-closing-accent {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  color: #0647fa;
}

/* =========================================================
   COLUMN 3: VR FIGURE
   ========================================================= */

.memory-col-vr {
  display: flex;
  justify-content: center;
  align-self: center;
}

.vr-sticker-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

/* The cutout already carries a white sticker border; add a hairline edge and a soft shadow */
.vr-sticker-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
  filter:
    drop-shadow(0 0 0.75px rgba(26, 25, 23, 0.28))
    drop-shadow(0 18px 30px rgba(35, 25, 15, 0.16));
  user-select: none;
}

/* "Still exploring." sits in the empty space left of the torso; one dashed arrow leads up to the headset */
.vr-callout-text {
  position: absolute;
  top: 29%;
  left: 0;
  z-index: 3;
  font-family: 'Caveat', cursive;
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 600;
  line-height: 0.95;
  color: #0647fa;
  transform: rotate(-8deg);
  transform-origin: left top;
  white-space: nowrap;
  pointer-events: none;
}

/* Hobby stickers: placed in % of the cutout's 2:3 box, in the empty space around the figure
   (badminton above-left, flute above-right, table tennis by the right waist, map below-left) */
.hobby-sticker {
  position: absolute;
  z-index: 1;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter:
    drop-shadow(0 0 0.75px rgba(26, 25, 23, 0.22))
    drop-shadow(0 10px 16px rgba(35, 25, 15, 0.14));
  /* Stop-motion wiggle: steps() holds each pose, then jumps to the next */
  animation: hobbyStopMotion 1.4s steps(1, end) infinite;
}

.hobby-badminton {
  left: -7%;
  top: -22%;
  width: 30%;
  rotate: -4deg;
}

.hobby-flute {
  left: 58%;
  top: -18%;
  width: 46%;
  animation-duration: 1.7s;
  animation-delay: -0.5s;
}

.hobby-table-tennis {
  left: 94%;
  top: 72%;
  width: 28%;
  rotate: 6deg;
  animation-duration: 1.5s;
  animation-delay: -0.9s;
}

.hobby-map {
  left: -7%;
  top: 91%;
  width: 48%;
  rotate: -3deg;
  animation-duration: 1.9s;
  animation-delay: -0.3s;
}

@keyframes hobbyStopMotion {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1px, -2px) rotate(1.6deg); }
  50% { transform: translate(-1px, -1px) rotate(-1.2deg); }
  75% { transform: translate(1px, 1px) rotate(0.8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hobby-sticker {
    animation: none;
  }
}

/* Tablet and phone: the cutout sits beside or between other blocks, so keep the stickers
   smaller and mostly inside its own box */
@media (max-width: 1180px) {
  .hobby-badminton {
    left: 0;
    top: -6%;
    width: 22%;
  }

  .hobby-flute {
    left: 70%;
    top: -14%;
    width: 30%;
  }

  .hobby-table-tennis {
    left: 89%;
    top: 73%;
    width: 20%;
  }

  .hobby-map {
    left: -5%;
    top: 87%;
    width: 34%;
  }
}

/* Same 2:3 box as the cutout, so the arrow end stays on the headset at any width */
.vr-callout-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

/* =========================================================
   COLUMN 4: VIBE CHECK PRINTER & RECEIPT
   ========================================================= */

.memory-col-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.memory-printer-assembly {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: var(--assembly-height, 820px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Quiet ivory placeholder on initial cold load */
.printer-placeholder {
  position: absolute;
  inset: 0;
  min-height: 580px;
  background-color: #faf7ee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

.placeholder-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(6, 71, 250, 0.15);
  border-top-color: #0647fa;
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

.memory-printer-assembly.is-ready .printer-placeholder {
  opacity: 0;
  visibility: hidden;
}

/* Stationary Printer Container */
.printer-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2135 / 736;
  z-index: 2;
}

/* Layer 1: Base Housing (Back, with drop-shadow) */
.printer-housing-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 14px 28px rgba(35, 25, 15, 0.12));
}

/* Accents (Labels & LED on top) */
.printer-label-text {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Plus Jakarta Sans', var(--font-sans), sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7d766a;
  text-transform: uppercase;
  z-index: 8;
  pointer-events: none;
  white-space: nowrap;
}

.printer-power-led {
  position: absolute;
  top: 24.5%;
  right: 11%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a3e635;
  box-shadow: 0 0 6px rgba(163, 230, 53, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  z-index: 8;
  pointer-events: none;
}

/* Layer 2: Viewport (Middle, anchored at slit exit line Y=525 -> 71.33%) */
.receipt-viewport {
  position: absolute;
  top: 71.33%;
  left: 50%;
  transform: translateX(-50%);
  width: 66.8%;
  height: var(--measured-viewport-height, 680px);
  overflow: hidden;
  z-index: 3;
  box-sizing: border-box;
}

/* Slit inner shadow on top edge of paper viewport */
.receipt-viewport::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0.75) 0%, rgba(10, 10, 11, 0.25) 4px, transparent 100%);
  z-index: 7;
  pointer-events: none;
}

/* Layer 3: Upper Housing Mask (Front, covers above slit line Y=525 -> 71.33%) */
.printer-housing-upper-clip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 28.67% 0);
  pointer-events: none;
  z-index: 6;
}

.printer-housing-upper-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Continuous Paper Strip with Authentic Scalloped Perforations */
.receipt-paper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  background-color: #fffef9;
  box-shadow: 
    0 10px 28px rgba(35, 25, 15, 0.1),
    0 2px 6px rgba(35, 25, 15, 0.05);
}

/* Scalloped teeth on left and right borders */
.receipt-paper::before,
.receipt-paper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background-size: 8px 16px;
  background-repeat: repeat-y;
  z-index: 6;
  pointer-events: none;
}

.receipt-paper::before {
  left: -4px;
  background-image: radial-gradient(circle at 0px 8px, #fefdf9 3.5px, transparent 4px);
}

.receipt-paper::after {
  right: -4px;
  background-image: radial-gradient(circle at 8px 8px, #fefdf9 3.5px, transparent 4px);
}

/* Bottom fade mask on receipt viewport */
.receipt-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  /* Short fade so the print below the current one stays clearly visible */
  height: 28px;
  background: linear-gradient(to bottom, rgba(255, 254, 249, 0) 0%, rgba(254, 253, 249, 0.98) 100%);
  pointer-events: none;
  z-index: 5;
}

/* Individual Memory Panels on the receipt */
.receipt-panel {
  position: relative;
  width: 100%;
  background-color: #fffef9;
  padding: 10px 10px 0 10px;
  box-sizing: border-box;
}

.panel-photo-frame {
  width: 100%;
  height: auto;
  background-color: #f5f2e9;
  border-radius: 2px;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
}

.panel-photo-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: unset;
  border-radius: 1px;
}

.panel-caption-band {
  width: 100%;
  padding: 8px 2px 10px 2px;
  box-sizing: border-box;
}

.panel-caption {
  font-family: 'SF Mono', 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1c1a17;
  line-height: 1.35;
  margin: 0;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
}

.panel-tear-separator {
  width: 100%;
  height: 1px;
  border-bottom: 1px dashed rgba(195, 185, 170, 0.6);
  margin-top: 2px;
}

/* =========================================================
   CONTROLS BELOW RECEIPT
   ========================================================= */

.memory-controls {
  display: none !important;
}

.memory-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #1c1a17;
  background: #ffffff;
  color: #1c1a17;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.memory-nav-btn:hover {
  background: #1c1a17;
  color: #ffffff;
  transform: scale(1.04);
}

.memory-nav-btn:focus-visible {
  outline: 2px solid #0647fa;
  outline-offset: 2px;
}

.memory-counter {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1c1a17;
  min-width: 60px;
  text-align: center;
  user-select: none;
}

.memory-pause-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1.5px solid #1c1a17;
  background: #ffffff;
  color: #1c1a17;
  font-family: 'Plus Jakarta Sans', var(--font-sans), sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.memory-pause-btn:hover {
  background: #1c1a17;
  color: #ffffff;
  transform: scale(1.02);
}

.memory-pause-btn:focus-visible {
  outline: 2px solid #0647fa;
  outline-offset: 2px;
}

/* =========================================================
   RESPONSIVE LAYOUTS: TABLET & MOBILE
   ========================================================= */

/* Tablet: two balanced columns, childhood photos + copy, then VR figure + printer */
@media (max-width: 1180px) {
  .memory-machine-container {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    column-gap: clamp(28px, 4vw, 48px);
    row-gap: 64px;
  }

  .childhood-collage-wrap {
    max-width: 270px;
  }

  .memory-col-center {
    align-self: center;
    padding-top: 0;
  }

  .vr-sticker-wrapper {
    max-width: 340px;
  }

  .memory-printer-assembly {
    max-width: 420px;
  }
}

/* Phone: heading, childhood photos, copy, VR figure, printer, stacked */
@media (max-width: 640px) {
  .memory-machine-section {
    padding: 0 0 60px 0;
    margin-top: 0;
  }

  .about-intro-header {
    margin-bottom: 36px;
    padding: 8px 20px 0;
  }

  .about-section-heading {
    font-size: 34px;
  }

  .memory-machine-container {
    padding: 0 20px;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
  }

  .childhood-collage-wrap {
    max-width: 270px;
  }

  .childhood-caption-wrap {
    align-self: center;
    padding-left: 0;
  }

  .memory-col-center {
    padding-top: 0;
  }

  .memory-intro-block {
    max-width: 100%;
  }

  .memory-main-heading {
    font-size: clamp(42px, 12vw, 52px);
  }

  .memory-main-para {
    font-size: 18px;
  }

  .memory-body p,
  .memory-secondary-para {
    font-size: 17px;
  }

  .vr-sticker-wrapper {
    max-width: 280px;
  }

  .memory-printer-assembly {
    max-width: 100%;
  }

  .receipt-viewport {
    width: 66.8%;
    height: var(--measured-viewport-height, 540px);
  }

  .panel-caption {
    font-size: 0.78rem;
  }

  .memory-controls {
    margin-top: var(--controls-margin-top, 640px);
    gap: 10px;
  }

  .memory-pause-btn {
    padding: 0 14px;
    font-size: 0.78rem;
  }
}

/* Scroll reveal: hidden until ScrollReveal.js animates each block in on first view */
.sr-pending {
  opacity: 0;
}

/* =========================================================
   PHONE POLISH (≤ 819px / ≤ 640px)
   Proportionate type & imagery for phones, clash-free jar band.
   Laptop/desktop layouts are untouched.
   ========================================================= */

@media (max-width: 819px) {
  /* Reserve the gap between the note and the jar where ToolkitJar.js lays out the 3-row icon band */
  .toolkit-jar-container {
    margin-top: 196px;
  }
}

@media (max-width: 768px) {
  /* Nav: readable 14px links with comfortable tap height; row scrolls sideways with an edge fade */
  .site-header nav {
    justify-content: flex-start;
    gap: 20px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    padding-right: 28px;
  }

  .nav-item {
    font-size: 14px;
    padding: 10px 0;
  }
}

@media (max-width: 640px) {
  /* Type scale: section title 34 / card title 30 / subhead 20 / body 16 */
  .selected-work-title {
    font-size: 34px;
  }

  .project-name {
    font-size: 30px;
  }

  .project-subheading {
    font-size: 20px;
  }

  .note-eyebrow,
  .about-section-tab {
    font-size: 11.5px;
  }

  .printer-label-text {
    font-size: 11px;
  }

  /* About paper: keep the doodle grid at a natural phone scale instead of stretching one tile */
  .about-paper-bg {
    background-size: 900px auto;
    background-repeat: repeat-y;
    background-position: center top;
  }
}

@media (max-width: 640px) {
  /* "What's next?" sits just right of the rim, clear of the glass and the icon band */
  .jar-whats-next {
    right: -40px;
    top: -4px;
  }
}

@media (max-width: 380px) {
  .jar-whats-next {
    right: -26px;
  }
}

/* =========================================================
   SHARED ABOUT + SERVICES PAPER
   One continuous grid sheet behind both sections. The doodle image
   (about-bg.jpg) sits at the top at its natural aspect and fades into
   this CSS grid, which is drawn to the image's exact grid metrics
   (1024px image: cells 27.0 x 26.36px, line centres from x 26 / y 23.2, measured by comb fit).
   ========================================================= */

.about-paper-group {
  position: relative;
  container-type: inline-size;
}

.about-paper-group::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --about-feather: clamp(140px, 16vw, 240px);
  --line: rgba(60, 58, 40, 0.047); /* ~45% lighter than the original About grid */
  --line-w: max(1px, 0.17cqw);
  background-color: #f8f7f1;
  background-image:
    linear-gradient(to right, var(--line) var(--line-w), transparent var(--line-w)),
    linear-gradient(to bottom, var(--line) var(--line-w), transparent var(--line-w));
  background-size: 2.6367cqw 2.5742cqw;
  background-position: 2.4541cqw 2.1807cqw; /* line centre minus half the line width */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather)
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather)
  );
}

/* Sections sit on the shared sheet */
.about-paper-group .services-section {
  background-color: transparent;
}

.about-paper-group .services-grid-bg {
  display: none;
}

/* Doodle image: natural aspect at the top, soft fade where the CSS grid takes over */
.about-paper-group .about-paper-bg {
  --img-h: 56.25cqw; /* 576 / 1024 */
  /* Image grid fades by the same ~45% (it blends into the identical cream paper underneath) */
  opacity: 0.55;
  background-color: transparent;
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center top;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather),
    #000 calc(var(--img-h) - 70px),
    transparent var(--img-h)
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    rgba(0, 0, 0, 0.12) calc(var(--about-feather) * 0.25),
    rgba(0, 0, 0, 0.45) calc(var(--about-feather) * 0.55),
    rgba(0, 0, 0, 0.85) calc(var(--about-feather) * 0.85),
    #000 var(--about-feather),
    #000 calc(var(--img-h) - 70px),
    transparent var(--img-h)
  );
}

@media (max-width: 640px) {
  /* Phones: image drawn 900px wide (centred) so cells stay ~23px; grid uses the same metrics */
  .about-paper-group::before {
    --line-w: 1px;
    background-size: 23.730px 23.168px;
    background-position: calc(50cqw - 427.65px) 19.89px;
  }

  .about-paper-group .about-paper-bg {
    --img-h: 506px; /* 900 * 576 / 1024 */
    background-size: 900px auto;
    background-repeat: no-repeat;
  }
}

/* =========================================================
   PHONE: PROJECT ROWS
   "01 / SELECTED WORK" label, image, category, title, tagline,
   "See more…" (opens description, meta, tags) and short links.
   Dashed dividers between projects. Laptop untouched.
   ========================================================= */

.project-mobile-index,
.project-mobile-category,
.project-details-toggle,
.link-label-short {
  display: none;
}

@media (max-width: 640px) {
  .projects-container {
    gap: 0 !important;
    padding-left: 22px !important;
    padding-right: 22px !important;
    box-sizing: border-box;
  }

  .project-row {
    gap: 0 !important;
    padding: 30px 0 34px;
  }

  .project-row:first-child {
    padding-top: 8px;
  }

  .project-row + .project-row {
    border-top: 1.5px dashed rgba(100, 116, 139, 0.32);
  }

  /* 01 / SELECTED WORK */
  .project-mobile-index {
    display: flex;
    align-items: baseline;
    order: 0 !important;
    margin: 0 0 28px; /* clears the tape that sits over the frame's top corner */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #64748b;
  }

  .project-mobile-index-num {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0647fa;
  }

  .project-mobile-index-sep {
    margin: 0 12px;
    color: #94a3b8;
    letter-spacing: 0;
  }

  /* Desktop's "01 / SAJAG" label and on-image tab are replaced by the lines above/below */
  .project-index-label,
  .category-tab {
    display: none;
  }

  .project-paper-frame {
    padding: 8px;
  }

  /* Thumbnails are 16:9 videos, so this shows them uncropped */
  .project-video-aperture {
    aspect-ratio: 16 / 9;
  }

  /* Text starts below the stickers that hang off the frame's lower-left corner */
  .project-text-col {
    padding-top: 30px;
  }

  .project-mobile-category {
    display: block;
    margin: 0 0 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7b8494;
  }

  .project-name {
    font-size: clamp(26px, 8vw, 32px);
    line-height: 1.06;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
  }

  .project-subheading {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.45;
    margin: 0 0 6px;
  }

  .project-name br,
  .project-subheading br {
    display: none;
  }

  /* Tucked-away details */
  .project-row:not(.is-details-open) .project-desc,
  .project-row:not(.is-details-open) .project-meta-details,
  .project-row:not(.is-details-open) .project-discipline-capsules {
    display: none;
  }

  /* Plain muted "See more…" text (still a real button for keyboard & screen readers) */
  .project-details-toggle {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .project-details-toggle:focus-visible {
    outline: 2px solid #0647fa;
    outline-offset: 3px;
    border-radius: 3px;
  }

  .project-row.is-details-open .project-desc {
    margin-bottom: 14px;
  }

  /* Short blue links: "Case study ↗", "Live demo ↗" */
  .link-label-full {
    display: none;
  }

  .link-label-short {
    display: inline;
  }

  .project-link-wrapper {
    gap: 8px 26px;
    margin: 0;
  }

  .project-case-study-link {
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }
}

/* =========================================================
   LAPTOP: TWO PROJECTS PER ROW (.projects-section.is-two-up)
   Image on top, then title + tagline; description, meta and tags
   sit behind "See more…" like the phone. Cards in a row line up;
   an odd last card is centred on its own row.
   ========================================================= */

@media (min-width: 861px) {
  .projects-section.is-two-up .projects-container {
    --two-up-gap: clamp(48px, 5vw, 88px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--two-up-gap);
    row-gap: clamp(88px, 8vw, 128px);
    align-items: start;
  }

  .projects-section.is-two-up .project-row {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
  }

  .projects-section.is-two-up .project-row:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - var(--two-up-gap)) / 2);
  }

  .projects-section.is-two-up .project-media-col,
  .projects-section.is-two-up .project-text-col {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  .projects-section.is-two-up .project-media-col {
    order: 1;
  }

  /* Text starts below the stickers that hang off the frame's lower-left corner */
  .projects-section.is-two-up .project-text-col {
    order: 2;
    padding-top: 34px;
  }

  .projects-section.is-two-up .project-name {
    font-size: clamp(30px, 2.6vw, 38px);
    margin-bottom: 8px;
  }

  .projects-section.is-two-up .project-subheading {
    font-size: clamp(18px, 1.4vw, 20px);
    font-weight: 400;
    line-height: 1.45;
    margin-bottom: 6px;
  }

  .projects-section.is-two-up .project-name br,
  .projects-section.is-two-up .project-subheading br {
    display: none;
  }

  /* Tucked-away details */
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-desc,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-meta-details,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-discipline-capsules {
    display: none;
  }

  .projects-section.is-two-up .project-details-toggle {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
  }

  .projects-section.is-two-up .project-details-toggle:hover {
    color: #64748b;
  }

  .projects-section.is-two-up .project-details-toggle:focus-visible {
    outline: 2px solid #0647fa;
    outline-offset: 3px;
    border-radius: 3px;
  }

  .projects-section.is-two-up .project-row.is-details-open .project-desc {
    margin-bottom: 14px;
  }

  /* Short blue links: "Case study ↗", "Live demo ↗" */
  .projects-section.is-two-up .link-label-full {
    display: none;
  }

  .projects-section.is-two-up .link-label-short {
    display: inline;
  }

  .projects-section.is-two-up .project-link-wrapper {
    gap: 8px 26px;
    margin: 0;
  }
}

/* Mouse users: details fade in while hovering a card (or tabbing into it). Their space is
   reserved, so nothing below moves; links sit right under the tagline. Touch keeps "See more…". */
@media (min-width: 861px) and (hover: hover) and (pointer: fine) {
  .projects-section.is-two-up .projects-container {
    row-gap: clamp(40px, 4vw, 64px);
  }

  .projects-section.is-two-up .project-details-toggle {
    display: none;
  }

  .projects-section.is-two-up .project-link-wrapper {
    margin: 6px 0 18px;
  }

  .projects-section.is-two-up .project-row:not(.is-details-open) .project-desc,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-meta-details,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-discipline-capsules {
    display: flex;
    order: 5;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .projects-section.is-two-up .project-row:not(.is-details-open) .project-desc {
    display: block;
    margin: 0 0 14px;
  }

  .projects-section.is-two-up .project-row:hover .project-desc,
  .projects-section.is-two-up .project-row:hover .project-meta-details,
  .projects-section.is-two-up .project-row:hover .project-discipline-capsules,
  .projects-section.is-two-up .project-row:focus-within .project-desc,
  .projects-section.is-two-up .project-row:focus-within .project-meta-details,
  .projects-section.is-two-up .project-row:focus-within .project-discipline-capsules {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 861px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-desc,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-meta-details,
  .projects-section.is-two-up .project-row:not(.is-details-open) .project-discipline-capsules {
    transform: none;
    transition: opacity 0.2s ease;
  }
}


/* =========================================================
   PHONE: FULL NOTE PAPER
   Phones need a taller card than the art's aspect, so the paper art is
   drawn as a 9-slice: torn top (punch holes), bottom and side edges keep
   their shape, only the plain cream middle stretches to fit the text.
   Slices are in source pixels of the 1024 x 661 note-paper art.
   ========================================================= */

@media (max-width: 640px) {
  .note-assembly {
    --note-w: min(90vw, 390px);
    --slice-top: calc(var(--note-w) * 150 / 1024);
    --slice-right: calc(var(--note-w) * 70 / 1024);
    --slice-bottom: calc(var(--note-w) * 110 / 1024);
    --slice-left: calc(var(--note-w) * 80 / 1024);
    background: none;
    box-shadow: none;
    border-radius: 0;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.10));
  }

  .note-assembly::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    box-sizing: border-box;
    border-style: solid;
    border-width: var(--slice-top) var(--slice-right) var(--slice-bottom) var(--slice-left);
    border-image: url('assets/note/note-paper.webp') 150 70 110 80 fill stretch;
  }

  /* The cropped top-strip version of the art is replaced by the 9-slice above */
  .note-paper {
    display: none;
  }

  .note-content {
    padding:
      calc(var(--slice-top) + 6px)
      calc(var(--slice-right) + 16px)
      calc(var(--slice-bottom) + 6px)
      calc(var(--slice-left) + 10px);
  }
}

/* =========================================================
   SERVICES: "What can I do for you?" (chapter folder)
   Header, three folder tabs (Understand / Design / Make) over one card.
   The folder and active tab take the chapter colour (--folder-color /
   --chapter-color); inactive tabs stay ivory. Stop-motion art per chapter.
   ========================================================= */

.services-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background-color: #f8f7f1;
  color: #0f172a;
  padding: clamp(24px, 3vw, 48px) 0 clamp(96px, 10vw, 140px);
  box-sizing: border-box;
}

.services-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  box-sizing: border-box;
}

.services-kicker {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #0647fa;
}

.services-heading {
  margin: 12px 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: #080807;
}

.services-heading-accent {
  color: #0647fa;
  white-space: nowrap;
}

.services-intro {
  margin: 12px 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.45;
  color: #5b6474;
}

/* Folder */
.services-scroll {
  margin-top: clamp(28px, 4vw, 48px);
}

/* Scroll-driven chapters: the folder holds still, centred, while the track scrolls past
   (track height and pin offset are set from ServicesSection.js) */
.services-section.is-pinned .services-folder {
  position: sticky;
  top: var(--services-pin-top, 24px);
}

.services-tabs-row {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding-right: clamp(24px, 5vw, 72px);
}

.services-pick {
  position: absolute;
  right: calc(clamp(24px, 5vw, 72px) + 330px);
  bottom: 54px;
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 15px;
  color: #475569;
  transform: rotate(-4deg);
  pointer-events: none;
  white-space: nowrap;
}

.services-pick svg {
  width: 22px;
  height: 26px;
  margin-top: 8px;
}

.services-tabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}

.services-tab-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 26px 12px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f7f3e8;
  color: #0f172a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.3s ease, padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.services-tab-btn:hover:not(.is-active) {
  background: #efeadc;
}

.services-tab-btn:focus-visible {
  outline: 2px solid #0647fa;
  outline-offset: 2px;
}

.services-tab-num {
  font-weight: 400;
  color: #64748b;
}

.services-tab-label {
  font-weight: 600;
}

.services-tab-btn.is-active {
  background: var(--chapter-color);
  border-color: transparent;
  padding-top: 16px;
}

.services-tab-btn.is-active .services-tab-num {
  color: #475569;
}

.services-card {
  position: relative;
  display: grid;
  background: var(--folder-color, #f7f5ef);
  transition: background-color 0.5s ease;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 30, 60, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: clamp(32px, 4.5vw, 60px) clamp(28px, 6vw, 88px);
}

.services-panel {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  outline: none;
}

/* Tab change: outgoing chapter fades out while the incoming one fades and settles in,
   in step with the folder colour easing between chapters */
.services-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0s linear 0.3s;
}

.services-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.45s ease 0.1s,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s,
    visibility 0s;
}

/* Chapter tagline: refined serif italic (Lora, already loaded for body copy) */
.services-panel-eyebrow {
  margin: 0;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 400;
  color: #0647fa;
  line-height: 1.35;
  letter-spacing: 0;
}

.services-panel-title {
  margin: 6px 0 28px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(30px, 3.3vw, 46px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #080807;
}

.services-panel-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  max-width: 560px;
}

.services-panel-list li {
  padding: 18px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.services-panel-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.services-item-name {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0b0f19;
}

.services-item-line {
  margin: 6px 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #64748b;
}

.services-panel-link {
  display: inline-flex;
  gap: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #0647fa;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

/* Fixed-size stage; one frame visible at a time (hard swaps, no crossfade) */
.services-art {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 470px;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border-radius: 12px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.services-art:focus-visible {
  outline: 2px solid #0647fa;
  outline-offset: 6px;
}

.services-art-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.services-art-frame.is-current {
  opacity: 1;
}

.services-details-toggle {
  display: none;
}

.services-panel-link:hover {
  color: #0035c4;
}

@media (max-width: 960px) {
  .services-pick {
    display: none;
  }

  .services-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  }
}

@media (max-width: 640px) {
  .services-section {
    padding: 8px 0 72px;
  }

  .services-inner {
    padding: 0 20px;
  }

  .services-heading {
    font-size: 30px;
  }

  .services-intro {
    font-size: 16px;
  }

  /* Tabs span the card width as three equal folder tabs */
  .services-tabs-row {
    padding-right: 0;
  }

  .services-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .services-tab-btn {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 9px 4px;
    font-size: 14px;
  }

  .services-tab-btn.is-active {
    padding-top: 12px;
  }

  .services-tab-num {
    font-size: 12px;
  }

  /* Keep every tab label on one line so the three tabs stay the same height */
  .services-tab-label {
    white-space: nowrap;
    font-size: clamp(12.5px, 3.6vw, 14px);
  }

  .services-card {
    border-radius: 0 0 14px 14px;
    padding: 26px 20px 12px;
  }

  .services-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .services-panel-eyebrow {
    font-size: 16.5px;
  }

  .services-panel-title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .services-panel-list li {
    padding: 9px 0;
  }

  /* Names read as a list under the title: regular weight, softer ink, small cobalt dot */
  .services-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: #334155;
  }

  .services-item-name::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0647fa;
  }

  /* Opened up, each name heads its description */
  .services-section.is-details-open .services-item-name {
    font-weight: 650;
    color: #0b0f19;
  }

  .services-section.is-details-open .services-item-line {
    padding-left: 16px;
  }

  .services-item-line {
    font-size: 14px;
    margin-top: 2px;
  }

  /* Service names only until "See more…" (one state for every chapter) */
  .services-section:not(.is-details-open) .services-item-line {
    display: none;
  }

  .services-details-toggle {
    display: inline-block;
    margin: 4px 0 6px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .services-details-toggle:focus-visible {
    outline: 2px solid #0647fa;
    outline-offset: 3px;
    border-radius: 3px;
  }

  .services-panel-link {
    display: flex;
    width: fit-content;
    font-size: 14.5px;
  }

  .services-art {
    justify-self: center;
    max-width: 220px;
    margin-top: 2px;
  }
}

/* =========================================================
   FEAR BETWEEN US: snake sticker over the video's corner watermark
   The mark sits at 90.6% x / 83.3% y of the 16:9 video. Laptop frames
   crop the video to 3:2 (mark at 98.1% x of the visible image); phones
   show the full 16:9 frame. The sticker is centred on that point.
   ========================================================= */

.project-row-fear .sticker-snake {
  --frame-pad: clamp(12px, 1.3vw, 16px);
  left: calc(var(--frame-pad) + (100% - 2 * var(--frame-pad)) * 0.981);
  top: calc(var(--frame-pad) + (100% - 2 * var(--frame-pad)) * 0.833);
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%) rotate(8deg);
}

@media (max-width: 640px) {
  .project-row-fear .sticker-snake {
    --frame-pad: 8px;
    left: calc(var(--frame-pad) + (100% - 2 * var(--frame-pad)) * 0.906);
    width: 78px;
  }
}

/* =========================================================
   CONTACT (graph paper, after the services folder)
   60/40: pitch + email on the left, envelope illustration on the right
   ========================================================= */
.contact-section {
  position: relative;
  z-index: 10;
  padding: 0 0 clamp(80px, 9vw, 128px);
  color: #080807;
}

/* Narrower than the page content so the pitch and envelope read as one group */
.contact-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.contact-kicker {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #4b5262;
}

.contact-heading {
  margin: 14px 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(36px, 4.4vw, 60px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.04;
  color: #080807;
}

.contact-heading-accent {
  display: block;
  color: #0647fa;
}

.contact-text {
  margin: 18px 0 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
  color: #5b6474;
}

/* Same hand-drawn underline as the services CTA it replaces */
.contact-email {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0647fa;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-email .footer-icon {
  width: 0.8em;
  height: 0.8em;
  flex-shrink: 0;
}

.contact-email-underline {
  position: absolute;
  left: 0;
  bottom: -9px;
  width: 92%;
  height: 12px;
}

.contact-email:hover {
  color: #0035c4;
}

.contact-email:focus-visible {
  outline: 2px solid #0647fa;
  outline-offset: 8px;
  border-radius: 4px;
}

/* Illustration */
.contact-art {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(320px, 100%);
}

.contact-envelope {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(20, 30, 60, 0.12));
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-art:hover .contact-envelope {
  transform: translateY(-8px) rotate(-1.5deg);
}

/* =========================================================
   SITE FOOTER (cobalt paper band closing the page)
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 20;
  background-color: var(--color-blue);
  background-image: url('assets/sketchbook/cobalt-soft-paper-4k.webp');
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(48px, 5.5vw, 76px) clamp(20px, 4vw, 48px) clamp(28px, 3vw, 40px);
  box-sizing: border-box;
}

.site-footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px 48px;
}

/* Same wordmark as the header, set larger */
.site-footer-wordmark {
  display: inline-block;
  font-size: clamp(48px, 5.4vw, 76px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--color-white);
  text-decoration: none;
}

.site-footer-wordmark span {
  color: var(--color-lime);
  margin-left: 0.5px;
}

.site-footer-tagline {
  margin: 12px 0 0;
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-white);
}

/* All five links on one line, wrapping only when the band gets narrow */
.site-footer-links {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px clamp(22px, 2.6vw, 40px);
}

.site-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: clamp(17px, 1.4vw, 20px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--color-white);
  text-decoration: none;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--color-lime);
}

.site-footer-link .footer-icon {
  width: 0.85em;
  height: 0.85em;
}

.site-footer-link:hover {
  text-decoration-line: underline;
}

.site-footer-bottom {
  margin-top: clamp(36px, 4vw, 52px);
  padding-top: clamp(20px, 2vw, 26px);
  border-top: 1px solid rgba(255, 254, 250, 0.32);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px 24px;
}

.site-footer-copy {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 254, 250, 0.9);
}

.site-footer-motto {
  margin: 0;
  font-family: 'Caveat', cursive;
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 500;
  line-height: 1;
  color: var(--color-white);
  transform: rotate(-2deg);
}

.site-footer-top-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-white);
}

.site-footer-top-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-lime);
  color: var(--color-blue);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-footer-top-icon svg {
  width: 20px;
  height: 20px;
}

.site-footer-top-btn:hover .site-footer-top-icon {
  transform: translateY(-3px);
}

.site-footer a:focus-visible,
.site-footer button:focus-visible {
  outline: 2px solid var(--color-lime);
  outline-offset: 6px;
  border-radius: 6px;
}

@media (max-width: 960px) {
  .contact-art {
    width: min(260px, 100%);
  }
}

@media (max-width: 640px) {
  .contact-section {
    padding-bottom: 72px;
  }

  .contact-inner {
    padding: 0 20px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-heading {
    font-size: 34px;
  }

  .contact-art {
    width: 200px;
  }

  .site-footer-inner {
    padding: 44px 20px 28px;
  }

  .site-footer-top {
    grid-template-columns: 1fr;
  }

  .site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 14px 28px;
  }

  .site-footer-bottom {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-footer-motto {
    white-space: nowrap;
  }

  .site-footer-top-btn {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-envelope,
  .site-footer-top-icon {
    transition: none;
  }

  .contact-art:hover .contact-envelope,
  .site-footer-top-btn:hover .site-footer-top-icon {
    transform: none;
  }
}


/* "Guidance" line in the project details */
.project-guidance { color: #64748B; }
.project-guidance .guidance-label {
  color: #334155;
  font-weight: 600;
  margin-right: 0.35em;
}
.project-guidance .guidance-label::after { content: ' ·'; font-weight: 400; color: #94A3B8; }
