/* Homepage-only scene. Navigation and project styles retain their existing rules. */
.watercolour-home { --hero-paper: #fdfdfd; --color-page: var(--hero-paper); }
.watercolour-home .grid-background { display: none; }
.watercolour-hero.page-section--hero {
  padding: 84px 0 0;
  background: var(--hero-paper);
  overflow: visible;
}
.watercolour-scene {
  position: relative;
  isolation: isolate;
  width: min(70vw, 1120px);
  aspect-ratio: 1;
  color: #132e34;
  touch-action: pan-y pinch-zoom;
}
.watercolour-painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  pointer-events: none;
  user-select: none;
}
/* Copy-local wash: no layout footprint; the copy's scroll transform carries it. */
.watercolour-scene {
  --hero-wash-color: 238, 250, 242;
  --hero-wash-opacity: .54;
  --hero-wash-extent-inline: .07;
  --hero-wash-extent-block: .12;
  --hero-wash-feather-inline: 5%;
  --hero-wash-feather-block: 9%;
  --boat-copy-overlay-color: 225, 246, 235;
}
.watercolour-scene:not(.has-copy-wash) .hero-copy::before,
.watercolour-scene.has-copy-wash::after {
  content: '';
  position: absolute;
  inset: calc(-100% * var(--hero-wash-extent-block)) calc(-100% * var(--hero-wash-extent-inline));
  z-index: -1;
  pointer-events: none;
  background: rgba(var(--hero-wash-color), var(--hero-wash-opacity));
  /* Independent feathering follows long mobile copy without a pond-sized ellipse. */
  --wash-mask-inline: linear-gradient(to right, transparent, #000 var(--hero-wash-feather-inline), #000 calc(100% - var(--hero-wash-feather-inline)), transparent);
  --wash-mask-block: linear-gradient(to bottom, transparent, #000 var(--hero-wash-feather-block), #000 calc(100% - var(--hero-wash-feather-block)), transparent);
  -webkit-mask-image: var(--wash-mask-inline), var(--wash-mask-block);
  -webkit-mask-composite: source-in;
  mask-image: var(--wash-mask-inline), var(--wash-mask-block);
  mask-composite: intersect;
}
/* Cached copy bounds keep this layer below ripples/sprites (2) and live text (3). */
.watercolour-scene.has-copy-wash::after {
  inset: auto;
  left: calc(var(--hero-copy-x) - var(--hero-copy-width) * var(--hero-wash-extent-inline));
  top: calc(var(--hero-copy-y) - var(--hero-copy-height) * var(--hero-wash-extent-block));
  width: calc(var(--hero-copy-width) * (1 + 2 * var(--hero-wash-extent-inline)));
  height: calc(var(--hero-copy-height) * (1 + 2 * var(--hero-wash-extent-block)));
  transform: translate3d(0, var(--hero-copy-scroll-y, 0px), 0);
  opacity: var(--hero-copy-scroll-opacity, 1);
  z-index: 1;
}
.watercolour-scene .hero-copy {
  position: relative;
  z-index: 3;
  width: 60%;
  max-width: 64ch;
  margin: 23% 0 var(--space-16) 27%;
  transform: translate3d(0, var(--hero-copy-scroll-y, 0px), 0);
  opacity: var(--hero-copy-scroll-opacity, 1);
  gap: var(--space-5);
}
.watercolour-scene .hero-headline,
.watercolour-scene .hero-support,
.watercolour-scene .text,
.watercolour-scene .hero-inline-link { color: #132e34; }
.watercolour-scene .hero-headline {
  max-width: none;
  margin: 0;
  font-size: clamp(1.5rem, 2.1vw, 2rem);
  line-height: 1.2;
  letter-spacing: normal;
  text-wrap: initial;
}
.hero-headline-line { display: block; }
.hero-word { display: inline-block; max-width: 100%; overflow-wrap: anywhere; vertical-align: baseline; transform-origin: 50% 75%; }
.watercolour-scene .hero-copy > .hero-support {
  max-width: 60ch;
  font-size: var(--font-size-body);
  line-height: 1.7;
}
.watercolour-scene .hero-work-link {
  align-self: flex-start;
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: #132e34;
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: #254d5490;
}
.watercolour-scene .hero-work-link:hover { text-decoration-color: currentColor; }
.watercolour-scene .hero-work-link:focus-visible {
  outline: 2px solid #123c48;
  outline-offset: 6px;
  border-radius: 2px;
}
#selected-work { scroll-margin-top: 64px; }
.watercolour-ripples {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.watercolour-boat {
  position: absolute;
  left: 66%;
  top: 71%;
  width: clamp(76px, 9vw, 116px);
  aspect-ratio: 1;
  height: auto;
  transform: translate(-50%, -50%) rotate(35deg);
  pointer-events: none;
  user-select: none;
  z-index: 2;
  filter: drop-shadow(2px 4px 3px #17454a24);
}
/* The tint is masked to the boat artwork, so it cannot wash out the pond or plants. */
.watercolour-boat > img { display: block; width: 100%; height: auto; }
.watercolour-boat::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: rgb(var(--boat-copy-overlay-color));
  -webkit-mask: url('./Images/hero/watercolour-paper-boat.webp') center / contain no-repeat;
  mask: url('./Images/hero/watercolour-paper-boat.webp') center / contain no-repeat;
  opacity: calc(var(--boat-copy-overlay-progress, 0) * var(--boat-copy-overlay-strength, .28));
}
.watercolour-scene:not(.is-initialized) .watercolour-boat { --boat-copy-overlay-progress: 1; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-boat { --boat-copy-overlay-strength: .76; }
.watercolour-cursor {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #123c48;
  pointer-events: none;
  z-index: 4;
}
@media (hover: hover) and (pointer: fine) {
  .watercolour-scene.has-dot-cursor,
  .watercolour-scene.has-dot-cursor * { cursor: none; }
  .watercolour-scene.has-dot-cursor .watercolour-cursor { display: block; }
  .watercolour-cursor.is-clickable { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
}
@media (max-width: 900px) and (min-width: 601px) {
  .watercolour-scene { width: 86vw; }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .watercolour-scene {
    aspect-ratio: auto;
    min-height: 800px;
    padding: 72px 0 260px;
    box-sizing: border-box;
  }
  .watercolour-scene .hero-copy { width: 66%; margin: clamp(36px, 7vw, 72px) 0 0 24%; }
}
@media (max-width: 600px) {
  .watercolour-hero.page-section--hero { padding-top: 72px; }
  .watercolour-scene {
    width: calc(100vw - 16px);
    aspect-ratio: auto;
    min-height: 740px;
    padding: 72px 0 270px;
    box-sizing: border-box;
  }
  .watercolour-painting {
    object-position: 50% 50%;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  }
  .watercolour-scene .hero-copy { width: 82%; max-width: none; margin: clamp(24px, 8vw, 44px) auto 0; }
  .watercolour-scene .hero-headline { font-size: clamp(1.5rem, 6.4vw, 1.75rem); }
  .watercolour-scene .hero-copy { gap: var(--space-5); }
  .watercolour-boat { width: 88px; left: 56%; top: 79%; }
}
@media (prefers-reduced-motion: reduce) {
  .watercolour-boat { will-change: auto; }
  .hero-word { transform: none !important; }
}

/* Each leaf keeps its geometry while its two original theme assets swap. */
.watercolour-leaf {
  position: absolute;
  width: 55px;
  aspect-ratio: 1;
  left: 56%;
  top: 51%;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%) rotate(-18deg);
}
.watercolour-leaf[data-plant="1"] { width: 45px; left: 81%; top: 69%; }
.watercolour-leaf[data-plant="2"] { width: 64px; left: 48%; top: 59%; transform: translate(-50%, -50%) rotate(62deg); }
.watercolour-leaf[data-plant="3"] { width: 52px; left: 74%; top: 83%; transform: translate(-50%, -50%) rotate(-34deg); }
.watercolour-leaf--oval { aspect-ratio: 1.4; }
.watercolour-leaf img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Independent flowers: upper +40%, lower +100% of their former displayed widths. */
.watercolour-flower {
  position: absolute; width: 47.74px; aspect-ratio: 1; left: 45%; top: 16%;
  z-index: 2; pointer-events: none; user-select: none;
  transform: translate(-50%, -50%) rotate(10deg);
}
.watercolour-flower[data-flower="lower"] { width: 62.4px; left: 74%; top: 83%; transform: translate(-50%, -50%) rotate(-12deg); }
.watercolour-flower img { display: block; width: 100%; height: 100%; object-fit: contain; }
.watercolour-painting--dark,
.watercolour-leaf .watercolour-leaf--dark { display: none; }
.watercolour-leaf .watercolour-leaf--dark { position: absolute; inset: 0; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-painting--light,
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-leaf--light { display: none; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-painting--dark,
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-leaf--dark { display: block; }
.watercolour-home.dark-mode,
[data-hero-theme="dark"] .watercolour-home { --hero-paper: #171717; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene {
  --hero-wash-color: 11, 39, 43;
  --hero-wash-opacity: .64;
  --boat-copy-overlay-color: 11, 39, 43;
}
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene .hero-headline,
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene .hero-support,
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene .hero-work-link { color: #edf4e9; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene .hero-work-link { text-decoration-color: #edf4e990; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-scene .hero-work-link:focus-visible { outline-color: #edf4e9; }
:is(.dark-mode, [data-hero-theme="dark"]) .watercolour-cursor { background: #edf4e9; }
@media (max-width: 600px) {
  .watercolour-leaf { width: 40px; }
  .watercolour-flower { width: 34.72px; left: 40%; top: 9%; }
  .watercolour-flower[data-flower="lower"] { width: 50.4px; }
  .watercolour-leaf[data-plant="1"] { width: 35px; }
  .watercolour-leaf[data-plant="2"] { width: 45px; }
  .watercolour-leaf[data-plant="3"] { width: 42px; }
}

/* Static CSS positions remain the fallback; the loop exclusively owns transforms. */
.watercolour-scene.is-initialized .watercolour-boat,
.watercolour-scene.is-initialized .watercolour-leaf,
.watercolour-scene.is-initialized .watercolour-flower { left: 0; top: 0; }
