/* ============================================================
   Landing page. All visual values come from the design system
   tokens (static/css/design-system.css). Navbar + footer live
   in base.css. Page background is the design-system --color-bg.

   The Work section ships as a STATIC GRID by default — that's the
   no-JS / reduced-motion / SEO baseline. work-shuffle.js adds the
   `is-shuffle` class to upgrade the same markup into the 3D deck.
   ============================================================ */

/* ---- Lenis smooth scroll — required base styles (work-shuffle.js).
   Without these the smooth scroll fights native scroll-behavior and stutters. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Revealed by landing.js once the intro veil leaves (intro:done). */
.landing { transition: opacity var(--duration-base) var(--ease-out-expo); }
.landing.is-hidden { opacity: 0; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--margin-page);
}
/* container-type lets the display size with `cqi` (% of this column's width),
   so the heading shrinks to fit its half instead of re-wrapping. */
.hero__inner { position: relative; z-index: 1; max-width: var(--max-width); container-type: inline-size; }

/* Decorative self-drawing frame parked in the empty right gutter, behind the
   copy and tilted to match the doodle voice. Sized fluidly; hero-crew.js drives
   the DrawSVG loop. Hidden where it would collide with the text (see below). */
.hero__frame {
  display: block;
  width: 100%;                          /* fills its grid column (the right half) */
  height: clamp(340px, 60vh, 620px);
  justify-self: end;
  transform: rotate(-2.5deg);
  transform-origin: center;
  z-index: 0;
  overflow: visible;
  cursor: pointer;                      /* whole rectangle links to /lobby */
  -webkit-tap-highlight-color: transparent;
}
.hero__frame-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hero__frame-rect {
  fill: none;
  stroke: var(--color-fg);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;   /* crisp, uniform line at any box size */
  transition: stroke-width var(--duration-fast) var(--ease-out-expo);
}
/* Hover/focus: thicken the line + a faint interior wash so the click target
   reads (still hollow at rest). */
.hero__frame-hit {
  transition: fill var(--duration-fast) var(--ease-out-expo);
}
.hero__frame:hover .hero__frame-rect,
.hero__frame:focus-visible .hero__frame-rect { stroke-width: 2.4; }
.hero__frame:hover .hero__frame-hit,
.hero__frame:focus-visible .hero__frame-hit { fill: rgba(14, 14, 14, 0.04); }
.hero__frame:focus-visible { outline: 2px solid var(--color-fg); outline-offset: 6px; }

/* ---- Hero crew: cursor-sized dots that live inside the frame ----
   Fills the frame box and inherits its −2.5° tilt (it's a child of
   .hero__frame), so the dots stand level with the drawn rectangle.
   pointer-events:none → clicks fall through to the /lobby link.
   hero-crew.js drives all motion; CSS only sets the resting look. */
.hero__crew {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.hero__dot {
  position: absolute;
  /* JS positions via left/top (% of the box) + GSAP x/y for hops. */
  left: 0; top: 0;
  width: 35px; height: 35px;
  margin: -8px 0 0 -8px;                 /* left/top address the dot's centre */
  border-radius: 50%;
  opacity: 0;                            /* parked off until the crew enters */
  will-change: transform;
  box-shadow: 0 2px 6px rgba(14, 14, 14, 0.18);
}
.hero__dot--r { background: #e5484d; }
.hero__dot--g { background: #2faa5e; }
.hero__dot--b { background: #3e63dd; }

/* Speech doodle ("knock knock!" / "come play with us!") — handwritten,
   parked above the huddle. Inherits .doodle/.doodle--md from the system. */
.hero__speech {
  position: absolute;
  left: 0; top: 0;
  margin: 0;
  white-space: nowrap;
  color: var(--color-fg);
  opacity: 0;
  transform-origin: left bottom;
  will-change: transform, opacity;
}

/* Narrow viewports: single column, copy fills the width, frame retired
   (the crew is a child of the frame, so it's hidden along with it). */
@media (max-width: 900px) {
  .hero__frame { display: none; }
}

/* No animation for visitors who ask for less motion: hide the crew and
   let hero-crew.js leave the box statically drawn. */
@media (prefers-reduced-motion: reduce) {
  .hero__crew { display: none; }
}

/* Wide viewports: split the hero into two equal halves — copy on the left,
   the self-drawing frame on the right, each spanning ~50% of the viewport.
   The display is sized down so its longest word still fits inside its half. */
@media (min-width: 901px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-7);
  }
  .hero__inner { max-width: none; }
}

.hero__eyebrow {
  margin: 0 0 var(--space-5);
  font-size: var(--text-nav);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-muted);
}
.hero__display {
  margin: 0;
  font-weight: var(--weight-light);
  /* Fixed 3 lines (hard <br>s, never auto-wrap) — font scales to the column
     width via cqi so the longest line just fits. Tune the cqi to fill more. */
  font-size: clamp(30px, 8.8cqi, 116px);
  white-space: nowrap;
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-fg);
}
.hero__doodle {
  margin: var(--space-4) 0 0;
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: clamp(20px, 4vw, 48px);
  line-height: 1;
  color: var(--color-muted);
  transform: rotate(-2.5deg);
  transform-origin: left center;
}
.hero__sub {
  margin: var(--space-7) 0 0;
  max-width: var(--max-reading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: var(--lh-body);
  color: var(--color-fg);
}
.hero__scroll {
  position: absolute;
  left: var(--margin-page);
  bottom: var(--space-6);
  font-family: var(--font-doodle);
  font-weight: 600;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--color-muted);
  transform: rotate(-1.5deg);
}

/* ============================================================
   Panel stacking — the Work panel slides up OVER the pinned hero
   (hero pin + recede handled in work-shuffle.js). Work sits above
   the hero with an opaque background + a soft top lip so it reads
   as a sheet sliding over.
   ============================================================ */
.landing { position: relative; }
.hero { z-index: 0; }
.work {
  position: relative;
  z-index: 1;
  background: var(--color-fg-dark);   /* dark panel — slides over the light hero */
  box-shadow: 0 -28px 70px -22px rgba(14, 14, 14, 0.45);
}
/* About rides above the hero in the stack, same as the Work panel. */
.about { position: relative; z-index: 1; background: var(--color-bg); }

/* ============================================================
   Work — shared chrome
   ============================================================ */
.work__pin {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-7);
  padding: var(--space-8) var(--margin-page);
}
.work__head { max-width: var(--max-width); }
.work__eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--text-nav);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--dark-muted);          /* on the dark Work panel */
}
.work__title {
  margin: 0;
  font-weight: var(--weight-light);
  font-size: var(--text-display);
  line-height: var(--lh-section);
  letter-spacing: var(--tracking-section);
  color: var(--dark-fg);             /* on the dark Work panel */
}

/* ---- Flip-card primitive (shared by both layouts) ----
   Layers: .card__outer (scrubbed pose) > .card__inner (idle float + hover lift)
   > .card__flip (rotateY flip) > two .card__face. The static grid shows only the
   front (project) face; the 3D deck shows both and flips between them. */
.card { list-style: none; }
.card__outer,
.card__inner,
.card__flip { display: block; width: 100%; height: 100%; }
.card__flip {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.card__face {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
}
/* Minimalistic deck back — only revealed in the 3D deck (hidden in the grid). */
.card__face--back {
  display: none;                 /* revealed only in the 3D deck */
  padding: 0;
  border: 0;
  background: var(--color-bg);    /* matches the card art's cream margin */
}
.card__back-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The art has a black margin around the card; scaling up crops it in the clipped
     face. Less scale = thicker visible border. Tune if needed. */
  transform: scale(1.08);
}

.card__media {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-border);
}
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}
.card__tag {
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-muted);
}
.card__title {
  font-size: var(--text-heading);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-heading);
  color: var(--color-fg);
}
.card__blurb {
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-muted);
}

/* ============================================================
   Work — STATIC GRID (default / fallback / SEO baseline)
   ============================================================ */
.work__deck {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--max-width);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
/* Hover lift only in the static layout (GSAP owns the deck in shuffle mode). */
.work__deck:not(.is-shuffle) .card__inner {
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo);
}
.work__deck:not(.is-shuffle) .card:hover .card__inner,
.work__deck:not(.is-shuffle) .card__flip:focus-visible .card__inner {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -18px rgba(14, 14, 14, 0.45);
}
.work__deck:not(.is-shuffle) .card__flip:focus-visible { outline: none; }

/* ============================================================
   Work — 3D DECK (work-shuffle.js adds .is-shuffle)
   Cards leave the grid and stack at the stage centre; JS writes the pose onto
   .card__outer, float/hover onto .card__inner, and the flip onto .card__flip.
   No overflow/contain on the 3D chain — that would flatten it and kill the flip.
   ============================================================ */
.work__deck.is-shuffle {
  --card-w: clamp(190px, 16vw, 250px);
  display: block;
  position: relative;
  height: 100%;            /* fills the full-viewport pinned stage (set below) */
  max-width: none;
  perspective: 1400px;
}

/* In shuffle mode the whole pin is one full-viewport stage: the title pins to
   the top and the deck fills the viewport so cards can travel centre → title →
   bottom → diagonal without the layout squeezing them. */
.work.is-shuffle .work__pin {
  height: 100vh;
  display: block;
  padding: 0;
  gap: 0;
}
.work.is-shuffle .work__head {
  position: absolute;
  top: var(--space-8);
  left: var(--margin-page);
  right: var(--margin-page);
  z-index: 2;
  pointer-events: none;    /* never block a card beneath it */
}
/* Cards sit ABOVE the pinned title: when a card travels through the heading it
   passes over it, not under (head stays pointer-events:none so it never blocks). */
.work.is-shuffle .work__deck { position: absolute; inset: 0; z-index: 3; }
.work__deck.is-shuffle .card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
  margin: 0;
  /* GSAP owns this transform: xPercent/yPercent -50 centres it, then the pose
     rides on top — so the card's HIT-BOX travels with the visible card. */
  transform-style: preserve-3d;
  will-change: transform;
}
.work__deck.is-shuffle .card__outer,
.work__deck.is-shuffle .card__inner,
.work__deck.is-shuffle .card__flip {
  transform-style: preserve-3d;
  will-change: transform;
}
/* two faces stacked back-to-back; backface hidden so the flip shows one at a time */
.work__deck.is-shuffle .card__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.work__deck.is-shuffle .card__face--back  { display: flex; transform: rotateY(0deg); }
.work__deck.is-shuffle .card__face--front { transform: rotateY(180deg); }
/* front face fills the card: image grows, caption pinned, blurb goes to the modal */
.work__deck.is-shuffle .card__face--front .card__media { flex: 1 1 auto; aspect-ratio: auto; }
.work__deck.is-shuffle .card__blurb { display: none; }
/* lift shadow toggled by JS via --lift (deeper so it grounds a light card on dark) */
.work__deck.is-shuffle .card__inner {
  box-shadow: 0 calc(var(--lift, 0) * 30px) calc(var(--lift, 0) * 60px)
              rgba(0, 0, 0, calc(var(--lift, 0) * 0.7));
}

/* ============================================================
   Project modal
   ============================================================ */
.work-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin-page);
}
.work-modal[hidden] { display: none; }
.work-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 14, 0.55);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out-expo);
}
.work-modal__panel {
  position: relative;
  display: grid;
  /* 16:9 showcase on the left (the larger column), details on the right. */
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: stretch;
  width: min(1280px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity var(--duration-base) var(--ease-out-expo),
              transform var(--duration-base) var(--ease-out-expo);
}
.work-modal.is-open .work-modal__backdrop { opacity: 1; }
.work-modal.is-open .work-modal__panel { opacity: 1; transform: none; }

/* Left column: a 16:9 stage for the showcase. The image holds its ratio and
   sits centred in a surface panel, so a tall details column never stretches or
   distorts it — landscape banners crop minimally. */
.work-modal__media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  min-height: 0;
  overflow: hidden;
}
.work-modal__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.work-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-7);
  min-height: 0;
  overflow-y: auto;          /* long summaries scroll; image column stays put */
}
.work-modal__tag {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-muted);
}
.work-modal__title {
  margin: 0;
  font-weight: var(--weight-light);
  font-size: var(--text-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-section);
  color: var(--color-fg);
}
.work-modal__tagline {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-muted);
}
.work-modal__summary {
  margin: 0;
  max-width: var(--max-reading);
  font-size: 18px;
  line-height: var(--lh-body);
  color: var(--color-fg);
}
.work-modal__summary strong { font-weight: var(--weight-medium); }

/* Live = solid-dot accent (palette is monochrome, no green). Source stays muted. */
.card__tag--live,
.work-modal__tag--live { color: var(--color-fg); }
.card__tag--live::before,
.work-modal__tag--live::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  border-radius: 100px;
  background: var(--color-fg);
  vertical-align: middle;
}

/* Repo / live links */
.work-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.work-modal__link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-size: var(--text-nav);
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-fg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  transition: background var(--duration-fast) var(--ease-out-expo),
              color var(--duration-fast) var(--ease-out-expo);
}
.work-modal__link:hover { background: var(--color-surface); }
.work-modal__link--live {
  color: var(--color-bg);
  background: var(--color-fg);
  border-color: var(--color-fg);
}
.work-modal__link--live:hover { background: var(--color-fg-dark); }
.work-modal__link[hidden] { display: none; }
.work-modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-bg);
  color: var(--color-fg);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* ============================================================
   Scroll reveal — landing.js toggles .is-in via IntersectionObserver
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   About — editorial two-column: identity (left) ⟷ facets (right)
   ============================================================ */
.about__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-10) var(--margin-page) var(--space-9);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}
.about__lead { position: sticky; top: var(--space-8); }
.about__eyebrow {
  margin: 0 0 var(--space-4);
  font-size: var(--text-nav);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-muted);
}
.about__title {
  margin: 0;
  font-weight: var(--weight-light);
  font-size: var(--text-display);
  line-height: var(--lh-section);
  letter-spacing: var(--tracking-section);
  color: var(--color-fg);
}
.about__doodle {
  margin: var(--space-3) 0 0;
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
  color: var(--color-muted);
  transform: rotate(-2.5deg);
  transform-origin: left center;
}
/* Google-Docs-style accent beside the "& the fun of the journey" doodle —
   black-and-white doc, wiggles to invite a click, swept by a light band (same
   glide as .fun__melon) over a blue aura. Decorative only: aria-hidden, no nav.
   Sized in em so it tracks the doodle it sits beside. */
.about__docs {
  position: relative;
  display: inline-flex;
  vertical-align: -0.3em;
  margin-left: 0.35em;
  cursor: pointer;
  line-height: 0;
}
/* Blue glow behind the doc — gentle breathing pulse, sits below it (z-index -1). */
.about__docs::before {
  content: "";
  position: absolute;
  inset: -60%;
  z-index: -1;
  background: radial-gradient(closest-side,
              rgba(66, 133, 244, 0.95) 12%,
              rgba(66, 133, 244, 0.55) 45%,
              rgba(66, 133, 244, 0) 78%);
  filter: blur(8px);
  animation: docs-aura 3.4s ease-in-out infinite;
}
/* The page silhouette: clips the light band, casts a soft blue depth shadow,
   and carries the tempt-me wiggle. transform-origin low so it "waves". */
.about__docs__clip {
  position: relative;
  display: block;
  width: 1em;
  height: 1.25em;
  overflow: hidden;
  isolation: isolate;                 /* contain the shine's screen blend */
  clip-path: polygon(7.89% 4.21%, 65.79% 4.21%,
             92.11% 25.26%, 92.11% 95.79%, 7.89% 95.79%);
  transform-origin: 50% 65%;
  filter: drop-shadow(0 0 9px rgba(66, 133, 244, 0.8));
  animation: docs-wiggle 2.8s ease-in-out infinite;
}
.about__docs__svg { display: block; width: 100%; height: 100%; }
/* "Lightning" — a soft light glides across, brightening the blue (screen blend).
   Mirrors .fun__melon's melon-shimmer: same 3.4s ease-in-out background sweep. */
.about__docs__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
              transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%);
  background-size: 250% 100%;
  mix-blend-mode: screen;
  animation: docs-shine 3.4s ease-in-out infinite;
}
.about__docs:hover .about__docs__clip { animation-duration: 1s; }   /* perks up */
.about__docs:hover::before { opacity: 1; }
.about__docs:active .about__docs__clip {                            /* click reward */
  animation: none;
  transform: rotate(-4deg) scale(0.9);
}
@keyframes docs-wiggle {
  0%, 70%, 100% { transform: rotate(0) scale(1); }
  78%           { transform: rotate(-7deg) scale(1.05); }
  86%           { transform: rotate(6deg)  scale(1.05); }
  94%           { transform: rotate(-3deg) scale(1.02); }
}
@keyframes docs-shine {
  0%   { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}
@keyframes docs-aura {
  0%, 100% { opacity: 0.85; transform: scale(0.95); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .about__docs__clip, .about__docs__shine, .about__docs::before { animation: none; }
}
/* Doc fly-out (docs-fly.js): dim backdrop + the airborne, body-level clone.
   z-index clears the cursor overlays (10002) and intro veil (9999). */
.docs-fly-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(14, 14, 14, 0.62);   /* solid dim — no backdrop-filter (perf) */
  opacity: 0;
  cursor: pointer;
}
.about__docs.is-flying {
  z-index: 100001;              /* 3D depth comes from GSAP transformPerspective */
  cursor: pointer;
}
.about__docs.is-flying .about__docs__clip { animation: none; }   /* GSAP owns the transform */

/* The white sheet the doc morphs into mid-flight (fades in over the doc art). */
.docs-paper {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
}

/* ---- Paper-shred popup (docs-fly grows this; paper-shred.js fills it) ---- */
.paper-popup {
  z-index: 100001;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  will-change: transform;
  contain: layout paint;        /* isolate the card's repaints from the page */
}
/* Manga page backdrop — screentone dots + faint radial focus lines, behind the
   stack so the popup doesn't read empty. Low-contrast = the stack stays legible. */
.paper-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1.1px, transparent 1.4px);
  background-size: 8px 8px;
}
.paper-bg::before {
  content: "";
  position: absolute;
  inset: -25%;
  background: repeating-conic-gradient(from 0deg at 50% 50%,
              rgba(0, 0, 0, 0.05) 0deg 0.7deg, transparent 0.7deg 3.1deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 36%, #000 92%);
          mask-image: radial-gradient(closest-side, transparent 36%, #000 92%);
}
/* Spam feedback — black ink creeps in from the edges as the click-rate climbs.
   Opacity is driven each frame by paper-shred.js (sustained heat + strike flash). */
.paper-rage {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;         /* per-frame opacity stays on the compositor */
  background: radial-gradient(ellipse 72% 72% at 50% 50%,
              transparent 38%, rgba(0, 0, 0, 0.9) 100%);
}
.paper-hint {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 80;
  text-align: center;
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: clamp(18px, 2vw, 28px);
  color: rgba(14, 14, 14, 0.45);
  pointer-events: none;
}
/* A single research sheet in the messy stack. */
.paper-sheet,
.paper-half {
  position: absolute;
  box-sizing: border-box;
  padding: 7% 8% 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  contain: layout paint;
}
.paper-half { overflow: hidden; will-change: transform; }   /* live, animating */
.paper-sheet { cursor: pointer; }
.paper-sheet__heading {
  margin: 0 0 6%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(13px, 1.5vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #0e0e0e;
}
/* Faint body "text lines" so each sheet reads as a paper. */
.paper-sheet__line {
  height: 4px;
  width: 100%;
  margin: 3.4% 0;
  border-radius: 2px;
  background: rgba(14, 14, 14, 0.13);
}
/* A sliced fragment settled near the base. */
.paper-debris {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
  contain: layout paint;        /* flat (no shadow) + isolated — settled bits are cheap */
}
/* The white-hot slash. The line flashes; its core races across (JS-driven). */
.paper-streak {
  position: absolute;
  height: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
}
/* A short black blade at the leading edge with a glowing BLUE speed-trail behind
   it (silver was invisible on white). JS races this sprite across in ~0.24s. */
.paper-streak__core {
  position: absolute;
  top: -3.5px;
  left: 0;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg,
              rgba(66, 133, 244, 0) 0%,
              rgba(66, 133, 244, 0) 22%,
              rgba(66, 133, 244, 0.5) 60%,
              rgba(40, 90, 180, 0.82) 80%,
              rgba(18, 22, 38, 0.95) 92%,
              #000 100%);
  filter: drop-shadow(0 0 5px rgba(66, 133, 244, 0.7));
}
/* The slash mark left behind on the paper — flashes in, lingers, fades ~0.6s. */
.paper-streak__mark {
  position: absolute;
  left: 50%;
  top: -1.5px;
  height: 3px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
              rgba(66, 133, 244, 0) 0%,
              rgba(66, 133, 244, 0.85) 50%,
              rgba(66, 133, 244, 0) 100%);
  filter: drop-shadow(0 0 4px rgba(66, 133, 244, 0.55));
}
/* Closing line after every paper is cut. */
.paper-end {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  max-width: 80%;
  height: 100%;
  text-align: center;
  font-weight: var(--weight-light);
  font-size: clamp(20px, 2.6vw, 40px);
  line-height: 1.45;
  letter-spacing: var(--tracking-section);
  color: #0e0e0e;
  opacity: 0;
  pointer-events: none;
}

.about__bio {
  margin: var(--space-6) 0 0;
  max-width: var(--max-reading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: var(--lh-body);
  color: var(--color-fg);
}

.about__facets { list-style: none; margin: 0; padding: 0; }
.about__facet {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-border);
}
.about__facet:last-child { border-bottom: 1px solid var(--color-border); }
.about__facet:nth-child(2).reveal { transition-delay: 80ms; }
.about__facet:nth-child(3).reveal { transition-delay: 160ms; }
.about__num {
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: 30px;
  line-height: 1;
  color: var(--color-muted);
  transform: rotate(-4deg);
}
.about__facet-title {
  margin: 0 0 var(--space-2);
  font-weight: var(--weight-regular);
  font-size: var(--text-heading);
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-heading);
  color: var(--color-fg);
}
.about__facet-body {
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-muted);
}

/* ============================================================
   Fun — playful doodle break (one local watermelon accent)
   ============================================================ */
.fun {
  --melon: #df3f5a;
  width: min(var(--max-width), calc(100% - 2 * var(--margin-page)));
  margin: 0 auto var(--space-9);
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 28px;
}
/* Doodle-layer note (Caveat) pointing at the interactive watermelon. */
.fun__note {
  display: inline-block;
  vertical-align: middle;
  margin-left: var(--space-3);
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1;
  color: var(--melon);
  transform: rotate(-4deg);
}
@media (max-width: 560px) { .fun__note { display: none; } }   /* keep the heading clean when tight */   /* no room beside the text */
.fun__kicker {
  display: inline-block;
  margin: 0 0 var(--space-3);
  font-family: var(--font-doodle);
  font-weight: var(--weight-doodle);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1;
  color: var(--color-muted);
  transform: rotate(-2deg);
  transform-origin: left center;
}
.fun__head {
  margin: 0 0 var(--space-5);
  max-width: 18ch;
  font-weight: var(--weight-light);
  font-size: clamp(28px, 4vw, 56px);
  line-height: var(--lh-section);
  letter-spacing: var(--tracking-section);
  color: var(--color-fg);
}
.fun__melon {
  color: var(--melon);
  text-decoration: underline wavy rgba(223, 63, 90, 0.4);
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
  cursor: pointer;
}
.fun__melon:hover { text-decoration-thickness: 3px; }

/* Invite-to-click: a soft light glides across the melon-coloured word. Guarded
   by @supports so unsupported browsers keep the solid colour (no invisible text). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .fun__melon {
    background-image: linear-gradient(100deg,
      var(--melon) 0%, var(--melon) 38%, #ff9bad 50%, var(--melon) 62%, var(--melon) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: melon-shimmer 3.4s ease-in-out infinite;
  }
}
@keyframes melon-shimmer {
  0%   { background-position: 130% 50%; }
  100% { background-position: -130% 50%; }
}
.fun__body {
  margin: 0 0 var(--space-4);
  max-width: var(--max-reading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: var(--lh-body);
  color: var(--color-fg);
}
.fun__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
}
.fun__tags .doodle--tag { color: var(--color-fg); background: var(--color-bg); }
.fun__tags li:nth-child(2n) { transform: rotate(2deg); }
.fun__tags li:nth-child(3n) { transform: rotate(-3deg); }
.fun__tags li:nth-child(5n) { transform: rotate(1.5deg); }
.fun__tags li:nth-child(4n) { color: var(--melon); }

/* ============================================================
   Responsive / fallback — collapse the grid, stay static
   ============================================================ */
@media (max-width: 900px) {
  .work__deck { grid-template-columns: repeat(2, 1fr); }

  .about__inner { grid-template-columns: 1fr; gap: var(--space-7); }
  .about__lead { position: static; }
  .fun { padding: var(--space-6); }
}
@media (max-width: 560px) {
  .work__deck { grid-template-columns: 1fr; }
}

/* ============================================================
   Cursor interactions — weapon-cursor easter egg (cursor_interactions.js).
   Overlays sit above the dot (z 10000) and the intro veil (9999).
   ============================================================ */
.fun__melon-emoji {
  display: inline-block;
  cursor: pointer;
  transform-origin: 65% 70%;
  animation: melon-bob 2.8s ease-in-out infinite;
  will-change: transform, filter;
}
.fun__melon-emoji:hover { animation-duration: 1.1s; }   /* perks up on hover */
@keyframes melon-bob {
  0%, 100% { transform: translateY(0) rotate(-5deg) scale(1);
             filter: drop-shadow(0 0 0 rgba(223, 63, 90, 0)); }
  30%      { transform: translateY(-5px) rotate(7deg) scale(1.06); }
  50%      { transform: translateY(-2px) rotate(-3deg) scale(1.03);
             filter: drop-shadow(0 6px 12px rgba(223, 63, 90, 0.4)); }
  70%      { transform: translateY(-5px) rotate(7deg) scale(1.06); }
}
/* Hand the emoji's transform to GSAP during the weapon sequence; no CSS fight. */
html.weapon-active .fun__melon-emoji { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fun__melon, .fun__melon-emoji { animation: none; }
}

.cursor-weapon {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 10002;
  will-change: transform;
}
.cursor-weapon #cursor-shape,
.cursor-weapon #cursor-mount { fill: var(--color-fg); }

.cursor-reticle {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  pointer-events: none;
  z-index: 10002;
}
.cursor-reticle circle,
.cursor-reticle line { fill: none; stroke: var(--color-fg); stroke-width: 3; }

.cursor-seed {
  position: fixed;
  top: 0;
  left: 0;
  width: 11px;
  height: 13px;
  pointer-events: none;
  z-index: 10001;
}
.cursor-seed path { fill: #1f2d12; }   /* dark watermelon seed */

/* Hide the plain dot while the weapon overlay is driving. (The footer logo
   cursor — .cursor-icon + html.icon-active — lives in cursor.css since it
   ships on every page.) */
html.weapon-active .cursor { opacity: 0; }