/* =====================================================================
   Layout 2 — Notebook as Canvas (half-bleed)
   Notebook runs off the right viewport edge; only the left page + a
   narrow strip of the right page is visible. Items cluster on the
   visible page. Lamp peeks from the top-right corner.
   Scoped under .hero-editorial so original .hero styles stay untouched.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&display=swap');

:root {
  --font-hand-2: 'Architects Daughter', 'Caveat', cursive;
}

/* --------------------- Hero container ------------------------------ */
.hero-editorial {
  position: relative;
  min-height: 100vh;
  padding: 6rem 0 4rem max(3rem, calc((100vw - 1100px) / 2));  /* left aligns with work grid; no right padding so notebook bleeds */
  z-index: 1;
  overflow: hidden;                   /* clip the bleed */
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) 1.3fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

/* --------------------- Left column: text --------------------------- */
.hero-editorial-text {
  max-width: 520px;
  position: relative;
  z-index: 5;
}
.hero-editorial-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}
.hero-editorial-text h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.hero-editorial-text h1 em {
  font-style: normal;
  color: var(--peach);
  font-weight: 600;
  position: relative;
}
.hero-editorial-text h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--peach);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-editorial-text:hover h1 em::after { transform: scaleX(1); }

/* --------------------- Right column: cluster stage ----------------- */
.hero-cluster {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 640px;
  overflow: visible;
}

/* Ambient warm light pool from lamp — falls across upper notebook */

/* -------- Lamp (ON the right page, fully inside the notebook) -------- */
.hero-notebook-stage .c-lamp {
  position: absolute;
  top: 3%;                            /* near the top edge of the notebook */
  left: 40%;                          /* nudged slightly toward left page, sits clearly inside visible area */
  width: 10%;
  min-width: 70px;
  z-index: 10;
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  animation: lampWobble 11s ease-in-out infinite;
  transform-origin: 50% 100%;         /* pivot at lamp base */
  cursor: pointer;
}
.hero-notebook-stage .c-lamp img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.8) brightness(0.95)
          drop-shadow(-1px 2px 2px rgba(58, 46, 38, 0.5)) drop-shadow(-6px 12px 18px rgba(58, 46, 38, 0.32));
  animation: lampBulb 4.5s ease-in-out infinite;
}
body.evening .hero-notebook-stage .c-lamp img {
  filter: saturate(0.6) brightness(0.7)
          drop-shadow(-1px 2px 2px rgba(58, 46, 38, 0.5)) drop-shadow(-6px 12px 18px rgba(58, 46, 38, 0.32));
}
@keyframes lampBulb {
  0%, 100% { filter: saturate(0.8) brightness(0.95) drop-shadow(-1px 2px 2px rgba(58, 46, 38, 0.5)) drop-shadow(-6px 12px 18px rgba(58, 46, 38, 0.32)); }
  50%      { filter: saturate(0.85) brightness(1.02) drop-shadow(-1px 2px 2px rgba(58, 46, 38, 0.5)) drop-shadow(-6px 12px 18px rgba(58, 46, 38, 0.32)); }
}
.hero-notebook-stage .c-lamp-hint {
  position: absolute;
  top: 104%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  background: rgba(245, 238, 225, 0.92);
  padding: 5px 10px;
  border-radius: 999px;
  border: 0.5px solid rgba(58, 46, 38, 0.2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  letter-spacing: 0.04em;
}
body.evening .hero-notebook-stage .c-lamp-hint {
  background: rgba(232, 216, 184, 0.9);
}
.hero-notebook-stage .c-lamp:hover .c-lamp-hint { opacity: 1; }

/* ================ NOTEBOOK (bleeds off right edge) ================= */
.hero-notebook-stage {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  height: 100%;                        /* drives the size */
  aspect-ratio: 1798 / 1322;           /* width auto-computed — ALWAYS matches the image */
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-notebook-stage .c-notebook-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
  image-rendering: auto;                /* smooth downscaling */
  transition: filter 0.6s ease;
}

/* Evening: slightly darken notebook */
body.evening .hero-notebook-stage .c-notebook-bg {
  filter: brightness(0.9) sepia(0.15) saturate(1.05) hue-rotate(-4deg);
  transition: filter 0.6s ease;
}

/* ================ ITEMS ON THE VISIBLE (LEFT) PAGE ================= */

/* Sticky note (white PNG with blue tape) — upper-left of left page */
.hero-notebook-stage .c-sticky {
  position: absolute;
  top: 2%;
  left: 13%;
  width: 18%;
  z-index: 4;
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  filter: drop-shadow(-3px 5px 10px rgba(58, 46, 38, 0.16));
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
  animation: stickyFlutter 6.5s ease-in-out infinite;
  container-type: inline-size;          /* enables cqi-based font scaling for children */
}
.hero-notebook-stage .c-sticky img {
  width: 100%;
  height: auto;
  display: block;
}
.hero-notebook-stage .c-sticky-text {
  position: absolute;
  /* Text overlays the note body, below the blue tape, past the perforations on left */
  top: 24%;
  left: 22%;
  right: 8%;
  bottom: 10%;
  font-family: var(--font-mono);
  font-size: clamp(7px, 5.5cqi, 11px);   /* scales with the sticky's width */
  line-height: 1.55;
  color: var(--ink);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transform: rotate(-7deg);
  transform-origin: center;
}
.hero-notebook-stage .c-sticky-text .title {
  font-weight: 700;
  margin-bottom: 0.35em;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.hero-notebook-stage .c-sticky-text p { margin: 0 0 0.1em; }

.hero-notebook-stage .c-sticky:hover {
  animation: none;
  transform: rotate(-2deg) scale(1.05);
  filter: drop-shadow(-5px 12px 20px rgba(58, 46, 38, 0.28));
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.35s ease;
}

/* Portrait stamp — CENTER of left page (horizontally and upper-vertically) */
.hero-notebook-stage .c-stamp {
  position: absolute;
  top: 30%;
  left: 17%;
  width: 24%;
  transform: rotate(-1deg);
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  z-index: 4;
  filter: drop-shadow(-3px 6px 8px rgba(58, 46, 38, 0.28));
}
.hero-notebook-stage .c-stamp img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.35s ease;
}
.hero-notebook-stage .c-stamp:hover img {
  transform: scale(1.03);
  filter: brightness(1.04) saturate(1.05);
}


/* Pressed flower — cascades from stamp's bottom-right, trailing down-right */
.hero-notebook-stage .c-flower {
  position: absolute;
  top: 54%;
  left: 36%;
  width: 15.2%;
  transform: rotate(-8deg);
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  z-index: 6;                                /* higher than stamp (4) — flower on top */
  filter: drop-shadow(-1px 2px 3px rgba(58, 46, 38, 0.38))
          drop-shadow(-3px 7px 10px rgba(58, 46, 38, 0.22))
          saturate(0.9);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;                      /* flower is decorative, stamp still hoverable */
}
.hero-notebook-stage .c-flower img {
  width: 100%;
  height: auto;
  display: block;
  transform: scaleX(-1);
  animation: flowerSway 8.3s ease-in-out infinite;
  transform-origin: 30% 10%;            /* pivot near the stem tip (upper-left of mirrored image) */
}
/* Subtle breath when notebook is hovered */
.hero-notebook-stage .c-flower {
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.5s ease;
}
.hero-notebook-stage .c-flower:hover {
  transform: rotate(-10deg) scale(1.06);
  filter: drop-shadow(-1px 2px 3px rgba(58, 46, 38, 0.38))
          drop-shadow(-3px 7px 10px rgba(58, 46, 38, 0.22))
          hue-rotate(-40deg)
          saturate(2.2)
          brightness(1.05);
}

/* Pencil — tucked vertically into the spine, quiet decorative prop */
.hero-notebook-stage .c-pencil {
  position: absolute;
  top: 18%;
  left: 51%;
  height: 78%;
  transform: rotate(3deg);
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  animation: pencilRoll 7.1s ease-in-out infinite;
  transform-origin: 50% 100%;           /* pivot at eraser end */
  z-index: 3;
  filter: drop-shadow(-1px 2px 4px rgba(58, 46, 38, 0.22))
          drop-shadow(-4px 8px 18px rgba(58, 46, 38, 0.16));
  pointer-events: none;
}
.hero-notebook-stage .c-pencil img {
  height: 100%;
  width: auto;
  display: block;
}

/* Yarn ball + crochet hook — bottom-left of left page, below the stamp */
.hero-notebook-stage .c-yarn {
  position: absolute;
  bottom: 8%;
  left: 2%;
  width: 20%;
  transform: rotate(-8deg);
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
  z-index: 5;
  filter: drop-shadow(-1px 2px 3px rgba(58, 46, 38, 0.5))
          drop-shadow(-5px 10px 16px rgba(58, 46, 38, 0.32))
          saturate(0.9) brightness(1.02);
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}
.hero-notebook-stage .c-yarn img {
  width: 100%;
  height: auto;
  display: block;
}
.hero-notebook-stage .c-yarn:hover {
  transform: rotate(-12deg) scale(1.05);
  filter: drop-shadow(-1px 2px 3px rgba(58, 46, 38, 0.5))
          drop-shadow(-5px 10px 16px rgba(58, 46, 38, 0.32))
          saturate(1.1) brightness(1.05);
}

/* Yarn caption — appears on yarn hover as a handwritten-feeling note */
.hero-notebook-stage .c-yarn-caption {
  position: absolute;
  bottom: 6%;
  left: 16%;
  font-family: 'Caveat', cursive;        /* flowy cursive, reads like a jotted personal note */
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transform: rotate(-3deg) translateY(-4px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
  letter-spacing: 0.005em;
  z-index: 7;
}
.hero-notebook-stage:has(.c-yarn:hover) .c-yarn-caption {
  opacity: 0.85;
  transform: rotate(-3deg) translateY(0);
}

/* ============== Ambient motion (always-on, async periods) ============== */
/* Different periods per item so they never sync into a visible loop. */
@keyframes stickyFlutter {
  0%, 100% { transform: rotate(-0.8deg) translateY(0); }
  50%      { transform: rotate(0.8deg) translateY(-2px); }
}
@keyframes flowerSway {
  0%, 100% { transform: scaleX(-1) rotate(-2deg); }
  50%      { transform: scaleX(-1) rotate(3deg); }
}
@keyframes pencilRoll {
  0%, 100% { transform: rotate(2deg); }
  50%      { transform: rotate(5deg); }
}
@keyframes lampWobble {
  0%, 100% { transform: rotate(-0.6deg); }
  50%      { transform: rotate(1.2deg); }
}

/* ============== Reduced motion ============== */
@media (prefers-reduced-motion: reduce) {
  .hero-cluster *,
  .hero-cluster *::before,
  .hero-cluster *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============== Responsive ============== */
@media (max-width: 960px) {
  .hero-editorial {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 5rem 1.5rem 3rem;
    text-align: center;
  }
  .hero-editorial-text {
    max-width: 620px;
    margin: 0 auto;
  }
  /* Mobile: notebook centered, fully visible, no bleed */
  .hero-cluster {
    min-height: 0;
    height: auto;                       /* let aspect-ratio drive height instead of inheriting 100% */
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    aspect-ratio: 1798 / 1322;          /* cluster takes notebook's aspect */
  }
  .hero-notebook-stage {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;                 /* override desktop ratio so stage fills cluster exactly */
    transform: none;
  }

  /* Mobile: redistribute items across both pages */
  .hero-notebook-stage .c-sticky {
    top: 6%;
    left: 8%;
    width: 24%;                         /* big enough for mono text to fit on one line */
  }
  /* Override container-query font so "— clarity > clever" fits on one line at mobile sizes */
  .hero-notebook-stage .c-sticky-text {
    font-size: clamp(6px, 3.8cqi, 9px);
    line-height: 1.42;
  }
  .hero-notebook-stage .c-stamp {
    top: 30%;
    left: 22%;
    width: 18%;
  }
  .hero-notebook-stage .c-flower {
    top: 56%;
    left: 34%;
    width: 11%;
  }
  .hero-notebook-stage .c-yarn {
    bottom: 20%;                        /* moved up off the leather edge */
    left: 8%;
    width: 16%;
  }
  .hero-notebook-stage .c-pencil {
    top: 12%;
    left: 50%;
    height: 72%;
  }
  .hero-notebook-stage .c-lamp {
    top: 5%;
    left: 78%;
    width: 10%;
  }
  /* font-size scales automatically via container queries on .c-sticky */
}

@media (max-width: 560px) {
  .hero-editorial {
    text-align: left;
  }
  .hero-editorial-text {
    margin: 0;
  }
  .hero-editorial-text h1 {
    font-size: 19px;
    line-height: 1.5;
  }
  /* keep notebook fully visible (inherits aspect-ratio + width: 100% from the 960px breakpoint) */
  .hero-cluster { min-height: 0; }
  .hero-notebook-stage .c-lamp {
    width: 8%;
    left: 75%;
  }
  .hero-notebook-stage .c-sticky-text {
    font-size: clamp(4px, 3cqi, 7px);
    line-height: 1.35;
  }
}

/* ================ ABOUT SECTION ================ */
.about-section-header {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding-left: 0.5rem;
}
.about-section-header h2 {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.about-section-header .cmd {
  color: var(--peach);
  font-weight: 400;
}

.about-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}
.about-body p {
  margin: 0 0 1.75rem;
}
.about-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .about-body {
    font-size: 13px;
    line-height: 1.75;
  }
  .about-body p { margin-bottom: 1.25rem; }
}

/* ================ PLAYGROUND — Layout 2 rebuild ================ */
.playground-section-header {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding-left: 0.5rem;
}
.playground-section-header h2 {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.playground-section-header .sparkle {
  color: var(--peach);
  font-weight: 400;
}

/* ==== Stamps row ==== */
.stamps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.stamp {
  display: flex;
  text-decoration: none;
  color: inherit;
  filter:
    drop-shadow(0 3px 6px rgba(58,46,38,0.08))
    drop-shadow(0 14px 24px rgba(58,46,38,0.08));
  transition:
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stamp-card { flex: 1; }

.stamp-card {
  --stamp-bg: #FBF6EC;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 24px;
  background: var(--stamp-bg);
  -webkit-mask:
    radial-gradient(circle 6px at 10px 0,    #0000 97%, #000 100%) repeat-x   0   0 / 20px 100%,
    radial-gradient(circle 6px at 10px 100%, #0000 97%, #000 100%) repeat-x   0   0 / 20px 100%,
    radial-gradient(circle 6px at 0 10px,    #0000 97%, #000 100%) repeat-y   0   0 / 100% 20px,
    radial-gradient(circle 6px at 100% 10px, #0000 97%, #000 100%) repeat-y 100%   0 / 100% 20px;
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle 6px at 10px 0,    #0000 97%, #000 100%) repeat-x   0   0 / 20px 100%,
    radial-gradient(circle 6px at 10px 100%, #0000 97%, #000 100%) repeat-x   0   0 / 20px 100%,
    radial-gradient(circle 6px at 0 10px,    #0000 97%, #000 100%) repeat-y   0   0 / 100% 20px,
    radial-gradient(circle 6px at 100% 10px, #0000 97%, #000 100%) repeat-y 100%   0 / 100% 20px;
  mask-composite: intersect;
}

.stamp:hover,
.stamp:focus-visible {
  transform: translateY(-6px);
  filter:
    drop-shadow(0 4px 8px rgba(58,46,38,0.12))
    drop-shadow(0 18px 28px rgba(58,46,38,0.12));
  outline: none;
}

.stamp-media {
  aspect-ratio: 1;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--cream-aged);
  position: relative;
}

.stamp-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stamp-text {
  padding: 0 2px;
}

.stamp-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 6px;
}

.stamp-desc {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  line-height: 1.55;
  margin: 0;
}

/* Mobile */
@media (max-width: 720px) {
  .stamps-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
  }
  .stamp { padding: 12px 12px 16px; }
  .stamp-media { margin-bottom: 12px; }
  .stamp-title { font-size: 16px; }
  .stamp-desc { font-size: 12px; }
}

@media (max-width: 560px) {
  .stamps-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 420px;
  }
  .stamp-media { aspect-ratio: 16 / 10; }
  .stamp-title { font-size: 18px; }
  .stamp-desc { font-size: 13px; }
}
