/* Living watercolor. All coordinates refer to the original 1672 × 941 painting. */
:root {
  --coast-ink: #102c27;
  --coast-muted: #18352d;
  --coast-header-ink: #102c27;
  --coast-header-shadow: 0 1px 2px rgba(255, 251, 236, .7);
  --coast-text-shadow: 0 1px 2px rgba(255, 251, 236, .7);
  --coast-paper: #fbf7ed;
  --coast-fade: #fbf7ed00;
}
.coast-ready .painted-landscape { opacity: 1; }
.coast-flag { position: absolute; pointer-events: none; }
.coast-world { position: absolute; pointer-events: none; }
.coast-world:not(.coast-loaded) *, .coast-atmosphere:not(.coast-loaded) * { transition: none !important; }
.coast-water { position: absolute; left: 26%; top: 79%; width: 66%; height: 19%; }
.coast-ocean {
  position: absolute; pointer-events: none; overflow: hidden; opacity: 0;
  -webkit-mask-image: url('assets/mar/agua-mascara-v8.png?v=8cab95a296b4');
  mask-image: url('assets/mar/agua-mascara-v8.png?v=8cab95a296b4');
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  transition: opacity 1.2s ease;
}
.coast-ocean-ready { opacity: 1; }
.coast-ocean-clip { position:absolute; inset:0; width:100%; height:100%; object-fit:fill; }
.coast-ocean-rough { opacity:0; }
@media (prefers-reduced-motion: reduce) { .coast-ocean { display:none; } }
.coast-light, .coast-weather, .coast-night, .coast-sky {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.coast-light {
  background: radial-gradient(ellipse at 51% 80%, #ffc176 0%, #efaa95 35%, #9b829e 85%);
  mix-blend-mode: multiply; opacity: var(--coast-gold, 0);
}
.coast-weather { background: #6d8596; mix-blend-mode: multiply; opacity: var(--coast-overcast, 0); }
.coast-night {
  background: linear-gradient(#0b172e 10%, #1a3046 60%, #30474e 80%, #142a33);
  mix-blend-mode: multiply; opacity: var(--coast-night, 0);
}
.coast-light, .coast-weather, .coast-night { transition: opacity 12s linear; }
.coast-ready .tropical-hero { background: var(--coast-paper); color: var(--coast-ink); }
.coast-ready .tropical-hero:before {
  background: linear-gradient(var(--coast-paper), var(--coast-fade));
  opacity: .85;
}
.coast-ready .tropical-hero:after { height: 30px; }
.coast-ready .hero h1 { color: var(--coast-ink); text-shadow: var(--coast-text-shadow); }
.coast-ready .hero h1 em, .coast-ready .hero-description,
.coast-ready .hero-note, .coast-ready .hero .eyebrow,
.coast-ready .wake-jungle, .coast-ready .scroll-cue,
.coast-ready .scene-credit { color: var(--coast-muted); transition: color .8s ease; }
.coast-ready .hero h1, .coast-ready .hero h1 em { transition: color .8s ease; }
.coast-ready .hero-copy, .coast-ready .scroll-cue, .coast-ready .scene-credit { text-shadow: var(--coast-text-shadow); }
.coast-ready .header nav { color: var(--coast-header-ink); text-shadow: var(--coast-header-shadow); }
.coast-ready .header .nav-cta { border-color: currentColor; }
.coast-ready .header nav>a:hover { color: var(--coast-muted); }
.coast-ready .hero-copy, .coast-ready .header nav {
  transition: color .8s ease;
}
.coast-ready .botanical, .coast-ready .macaw-flight,
.coast-ready .monkey-swing, .coast-ready .butterfly, .coast-ready .fauna-perch {
  filter: brightness(var(--coast-fauna-light, 1)) saturate(var(--coast-fauna-color, 1));
  transition: filter 12s linear, opacity 3s ease;
}
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .macaw-flight,
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .monkey-swing,
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .butterfly {
  opacity: 0; animation-play-state: paused;
}
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .macaw-sprite,
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .butterfly img { animation-play-state: paused; }
.coast-ready[data-fauna-state]:not([data-fauna-state="active"]) .wake-jungle:disabled { opacity: .85; }
.fauna-perch { position: absolute; pointer-events: none; z-index: 3; opacity: 0; }
.fauna-macaw { left: 1%; top: 32%; width: clamp(180px, 19vw, 275px); aspect-ratio: 418 / 464; }
.fauna-monkey { right: -24px; top: 48%; width: clamp(170px, 17vw, 245px); aspect-ratio: 418 / 414; }
.fauna-morpho { left: 83%; top: 74%; width: 68px; aspect-ratio: 418 / 390; }
.fauna-morpho-small { left: 8%; top: 74%; width: 52px; }
.fauna-catalog { left: auto; right: 8px; top: -8px; width: 60px; }
.fauna-catalog:not(.fauna-in-view) * { animation-play-state: paused !important; }
.fauna-pose {
  position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 418 / 464;
  background: url('assets/fauna-estados.webp?v=3fcf5f4439f5') no-repeat; background-size: 300% auto;
  background-position: var(--fauna-column, 0%) 0%; opacity: 0;
  transform-origin: 53% 63%; transition: opacity 3s ease;
  animation: fauna-rest 9s ease-in-out infinite; animation-play-state: paused;
}
.fauna-rest { --fauna-column: 0%; }
.fauna-sleep { --fauna-column: 50%; animation-name: fauna-breathe; animation-duration: 7s; }
.fauna-shelter { --fauna-column: 100%; animation-name: fauna-breathe; animation-duration: 8.5s; }
/* Crop the painted atlas at its transparent gutters; never scale separate rows unevenly. */
.fauna-monkey .fauna-pose { aspect-ratio: 418 / 410; background-position-y: 54.9763%; transform-origin: 52% 78%; animation-delay: -2.7s; }
.fauna-monkey .fauna-sleep { aspect-ratio: 418 / 400; background-position-y: 54.3326%; }
.fauna-monkey .fauna-shelter { aspect-ratio: 418 / 414; background-position-y: 55.2381%; }
.fauna-morpho .fauna-pose { top: auto; bottom: 0; aspect-ratio: 418 / 380; background-position-y: 100%; transform-origin: 60% 85%; animation-duration: 12s; animation-delay: -4s; }
.fauna-morpho .fauna-sleep { aspect-ratio: 418 / 390; }
.fauna-morpho .fauna-shelter { aspect-ratio: 418 / 376; }
[data-fauna-state="rest"] .fauna-perch,
[data-fauna-state="sleep"] .fauna-perch,
[data-fauna-state="shelter"] .fauna-perch,
[data-fauna-state="rest"] .fauna-rest,
[data-fauna-state="sleep"] .fauna-sleep,
[data-fauna-state="shelter"] .fauna-shelter { opacity: 1; animation-play-state: running; }
[data-fauna-state="sleep"] .fauna-morpho .fauna-sleep { animation: none; }
.fauna-drip {
  position: absolute; left: 76%; top: 72%; width: 2px; height: 5px; border-radius: 50%;
  background: #dce8e2; opacity: 0; animation: fauna-drip 4.5s linear infinite; animation-play-state: paused;
}
[data-fauna-wet="true"] .fauna-drip { animation-play-state: running; }
.fauna-monkey .fauna-drip { top: 88%; left: 88%; animation-delay: -1.6s; }
.fauna-morpho .fauna-drip { top: 89%; animation-delay: -3.2s; }
[data-fauna-wet="false"] .fauna-drip { visibility: hidden; }
.coast-ready .scene-credit { bottom: 82px; }
.coast-stars { opacity: var(--coast-stars, 0); transition: opacity 12s linear; }
.coast-clouds { opacity: var(--coast-cloud, 0); transition: opacity 12s linear; }
.coast-cloud-drift { animation: coast-cloud-drift 110s ease-in-out infinite alternate; }
.coast-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: var(--coast-rain, 0); transition: opacity 12s linear; }
.coast-rain-far { position: absolute; inset: -240px 0 0; background: url('assets/rain-far.svg?v=ec7178ec38ee') repeat; animation: coast-rain-far 1.2s linear infinite; }
.coast-rain-near { position: absolute; inset: -320px 0 0; background: url('assets/rain-near.svg?v=b1aacac20cba') repeat; animation: coast-rain-near .95s linear infinite; }
.coast-sun, .coast-moon { transition: opacity 12s linear, transform 60s linear; }
.tropical-hero:not([data-coast-mode="live"]) .coast-sun,
.tropical-hero:not([data-coast-mode="live"]) .coast-moon { transition-duration: 12s; }
.coast-controls {
  position: absolute; left: clamp(22px, 4vw, 70px); bottom: 25px; z-index: 6;
  display: flex; align-items: flex-end; gap: 9px; max-width: calc(100% - 44px);
}
.coast-status {
  position: relative;
  display: flex; align-items: center; gap: 12px; max-width: none;
  border: 1px solid #7b92771c; padding: 9px 12px;
  background: #fbf7edeb; border-radius: 7px 9px 6px 8px; color: #294d42; font: 12px/1.5 var(--sans); text-align: left;
}
.coast-conditions { min-width: 0; }
.coast-lunar { display: flex; align-items: center; gap: 7px; border-left: 1px solid #72957c45; padding-left: 12px; white-space: nowrap; }
.coast-phase-icon { display: block; width: 32px; height: 32px; flex: none; }
.coast-lunar-kicker { display: block; color: #536e60; font-size: 8px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.coast-lunar strong { display: block; font-size: 11px; font-weight: 600; }
.coast-status-arrow { align-self: flex-start; }
.coast-status small { display: block; font-size: 10px; opacity: .85; }
.coast-status[hidden] { display: none; }
.coast-status:hover .coast-place { text-decoration: underline; text-underline-offset: 4px; }
.coast-customize {
  flex: none; border: 1px solid #7b927755; border-radius: 8px; padding: 11px 14px;
  background: #fbf7edeb; color: #294d42; box-shadow: 0 4px 18px #10272020;
  font: 600 12px/1.3 var(--sans); cursor: pointer; white-space: nowrap;
}
.coast-customize span { color: #9a6940; font-size: 15px; margin-right: 3px; }
.coast-customize:hover, .coast-customize[aria-expanded="true"] { background: #e9ede3; }
.coast-customize[hidden] { display: none; }
.coast-status:focus-visible, .coast-customize:focus-visible, .coast-preview button:focus-visible { outline: 2px solid #798c64; outline-offset: 5px; }
.moon-music {
  position: fixed; right: 20px; bottom: 64px; z-index: 21; width: min(300px, calc(100vw - 28px));
  padding: 7px; color: #294d42; background: #fbf7edf2;
  border: 1px solid #8a997d80; border-radius: 14px; box-shadow: 0 8px 28px #10272036;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--sans);
}
.moon-music[hidden], .moon-music-details[hidden] { display: none; }
.moon-music-bar { display: flex; align-items: center; gap: 7px; }
.moon-music-note {
  display: grid; place-items: center; flex: none; width: 35px; height: 35px;
  border-radius: 50%; background: #e9d5a8; color: #6e5338; font-size: 20px;
}
.moon-music-title { flex: 1; min-width: 0; line-height: 1.2; }
.moon-music-title small { display: block; color: #637568; font-size: 9px; }
.moon-music-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.moon-music button { flex: none; display: grid; place-items: center; border: 0; cursor: pointer; }
.moon-music-play { width: 36px; height: 36px; border-radius: 50%; background: #2f513c; color: #fff8e7; font-size: 15px; }
.moon-music-play:hover { background: #41684b; }
.moon-music-toggle { width: 26px; height: 36px; border-radius: 6px; background: transparent; color: #526b58; font-size: 21px; }
.moon-music-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.moon-music-details { padding: 10px 9px 5px 44px; border-top: 1px solid #8a997d55; margin-top: 7px; }
.moon-music-details label { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; }
.moon-music-details output { font-variant-numeric: tabular-nums; }
.moon-music-details input { width: 100%; margin: 9px 0 6px; accent-color: #2f513c; cursor: pointer; }
.moon-music-details p { margin: 0; color: #637568; font-size: 10px; line-height: 1.35; }
.moon-music button:focus-visible, .moon-music input:focus-visible { outline: 2px solid #798c64; outline-offset: 3px; }
.coast-attribution {
  position: absolute; left: clamp(22px, 4vw, 70px); bottom: 7px; z-index: 6;
  color: #294d42; background: #fbf7edeb; border-radius: 4px; padding: 2px 6px;
  font: 9px/1.4 var(--sans); text-underline-offset: 2px;
}
.coast-attribution:hover { text-decoration: underline; }
.tropical-hero:not([data-coast-mode="live"]) .coast-attribution { display: none; }
.coast-dialog { width: min(480px, calc(100% - 32px)); padding: 36px; }
.coast-dialog h2 { font: 35px/1.2 var(--serif); margin: 6px 0 12px; }
.coast-dialog .coast-kicker { font: 18px var(--hand); color: #687755; margin: 0; }
.coast-dialog .coast-context, .coast-dialog .coast-source { font-size: 12px; line-height: 1.7; color: #52604a; }
.coast-dialog dl { margin: 22px 0; }
.coast-dialog dl>div { padding: 12px 0; border-bottom: 1px solid #5c715224; }
.coast-dialog dt { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #61745c; }
.coast-dialog dd { margin: 5px 0 0; font-size: 14px; line-height: 1.6; }
.coast-dialog a { color: #365c49; text-underline-offset: 3px; }
.coast-preview {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 25;
  width: max-content; max-width: calc(100% - 30px); padding: 10px 16px; border-radius: 12px;
  background: #fcf8efef; border: 1px solid #8a997d55; box-shadow: 0 6px 30px #152f3520;
  color: #294d42; backdrop-filter: blur(10px); text-align: center;
}
.coast-preview p { font: 11px var(--sans); margin: 0 0 8px; }
.coast-preview button { font: 11px var(--sans); padding: 7px 10px; border: 0; border-radius: 20px; background: transparent; color: inherit; }
.coast-preview button[aria-pressed="true"] { background: #2f513c; color: #fff8e7; }
.coast-preview[hidden] { display: none; }
.tropical-hero[data-coast-mode="custom"] .coast-atmosphere :is(
  .coast-light, .coast-weather, .coast-night, .coast-stars, .coast-clouds,
  .coast-rain, .coast-sun, .coast-moon
) { transition-duration: .45s; }
.tropical-hero[data-coast-mode="custom"] :is(
  .botanical, .macaw-flight, .monkey-swing, .butterfly, .fauna-perch
) { transition-duration: .45s; }
.coast-preview-combinations {
  left: 50%; right: auto; bottom: 12px; width: min(1060px, calc(100% - 24px));
  max-width: none; max-height: min(48vh, 340px); padding: 14px 18px 12px;
  overflow: auto; border: 1px solid #7c8e754d; border-radius: 16px;
  background: #fbf7eeef; box-shadow: 0 16px 50px #10272055;
  color: #23463a; text-align: left; backdrop-filter: blur(18px);
  font: 12px/1.4 var(--sans);
}
.coast-preview .preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-heading strong { display: block; font: 600 18px/1.1 var(--serif); }
.preview-heading span { display: block; margin-top: 3px; color: #596d5e; font-size: 11px; }
.coast-preview-combinations button { cursor: pointer; }
.preview-heading button {
  flex: none; border: 1px solid #31564466; border-radius: 20px; padding: 7px 12px;
  background: transparent; color: #23463a; font-size: 11px;
}
.preview-body { display: block; margin-top: 11px; }
.preview-presets { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 9px; white-space: nowrap; }
.coast-preview-combinations .preview-presets button {
  flex: none; border: 1px solid #7288726b; border-radius: 18px; padding: 7px 11px;
  background: #fffdf8a8; color: #23463a; font: 600 11px/1 var(--sans);
}
.coast-preview-combinations .preview-presets button[aria-pressed="true"] {
  border-color: #2f513c; background: #2f513c; color: #fff8e7;
}
.preview-fields { display: grid; grid-template-columns: minmax(170px, 1.3fr) repeat(3, minmax(132px, 1fr)); gap: 10px; }
.preview-fields label { display: block; min-width: 0; color: #425e50; font-size: 11px; font-weight: 700; }
.preview-fields select {
  display: block; width: 100%; height: 34px; margin-top: 4px; padding: 5px 8px;
  border: 1px solid #7288726b; border-radius: 7px; background: #fffdf8; color: #23463a;
  font: 12px var(--sans);
}
.preview-hour output { float: right; color: #23463a; font-weight: 700; }
.preview-hour input { display: block; width: 100%; height: 34px; margin: 4px 0 0; accent-color: #2f513c; }
.coast-preview-combinations .preview-caption { margin: 7px 0 0; color: #617268; font: 11px/1.4 var(--sans); }
.coast-preview-combinations :is(button, select, input):focus-visible { outline: 2px solid #cb864e; outline-offset: 2px; }
.coast-offscreen .jungle-scene *, .coast-offscreen .jungle-scene *::before,
.coast-offscreen .jungle-scene *::after { animation-play-state: paused !important; }
.motion-paused .coast-light, .motion-paused .coast-weather, .motion-paused .coast-night,
.motion-paused .coast-stars, .motion-paused .coast-clouds, .motion-paused .coast-rain,
.motion-paused .coast-sun, .motion-paused .coast-moon,
.motion-paused .fauna-perch, .motion-paused .fauna-pose { transition: none; }
@keyframes coast-cloud-drift { from { transform: translateX(-14px); } to { transform: translateX(20px); } }
@keyframes coast-rain-far { to { transform: translate3d(0, 240px, 0); } }
@keyframes coast-rain-near { to { transform: translate3d(0, 320px, 0); } }
@keyframes fauna-rest { 0%, 100% { transform: rotate(-.3deg); } 50% { transform: rotate(.35deg); } }
@keyframes fauna-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.003, 1.012); } }
@keyframes fauna-drip { 0%, 76%, 100% { opacity: 0; transform: translateY(0); } 80% { opacity: .45; transform: translateY(2px); } 96% { opacity: 0; transform: translateY(29px); } }
@media (min-width: 1700px) {
  .fauna-macaw { left: 5%; top: 35%; }
  .fauna-monkey { right: -12px; top: 48%; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .fauna-macaw { left: -12px; top: 48%; width: 190px; }
  .fauna-monkey { right: -12px; top: 52%; width: 160px; }
}
@media (max-width: 760px) {
  .coast-ready .painted-landscape { background-position: 52% center; }
  .fauna-macaw { left: -10px; top: auto; bottom: 156px; width: clamp(140px, 40vw, 190px); }
  .fauna-monkey { right: -4px; top: auto; bottom: 166px; width: clamp(130px, 36vw, 170px); }
  .fauna-morpho { left: auto; right: 9%; top: auto; bottom: 137px; width: 43px; }
  .fauna-morpho-small { left: 13%; right: auto; bottom: 135px; width: 35px; }
  .fauna-catalog { right: 8px; left: auto; top: -2px; bottom: auto; width: 47px; }
  .coast-ready .scroll-cue { bottom: 180px; }
  .coast-controls { bottom: 36px; left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 28px)); max-width: none; flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .coast-status { display: grid; grid-template-columns: minmax(0, 1fr) 12px; width: 100%; max-width: none; gap: 6px 10px; font-size: 11px; }
  .coast-customize { align-self: flex-end; padding: 7px 11px; font-size: 11px; }
  .coast-conditions { grid-column: 1; }
  .coast-lunar { grid-column: 1; border-left: 0; border-top: 1px solid #72957c45; padding: 6px 0 0; }
  .coast-status-arrow { grid-column: 2; grid-row: 1 / 3; }
  .coast-status small { font-size: 9px; }
  .coast-attribution { bottom: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 8px; }
  .coast-dialog { padding: 30px 24px; }
  .coast-dialog h2 { font-size: 31px; }
  .coast-preview { bottom: 62px; width: 310px; }
  .coast-preview button { padding: 6px 8px; }
  .moon-music { right: 10px; top: 130px; bottom: auto; width: min(230px, calc(100vw - 28px)); }
  .coast-preview-open .moon-music { top: auto; bottom: calc(var(--coast-preview-height, 260px) + 20px); }
  .coast-preview-combinations { bottom: 8px; width: min(1060px, calc(100% - 24px)); max-height: 62vh; padding: 11px 12px; }
  .preview-heading strong { font-size: 16px; }
  .preview-heading span { font-size: 10px; }
  .preview-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .preview-fields label { font-size: 10px; }
  .preview-fields select { font-size: 11px; }
}
@media (max-width: 390px) {
  .moon-music { top: 160px; }
  .preview-heading { gap: 6px; }
  .preview-heading strong { font-size: 14px; }
  .preview-heading span { display: none; }
  .preview-heading button { padding: 5px 8px; font-size: 10px; }
}
@media (min-width: 550px) and (max-width: 760px) {
  .moon-music { top: auto; bottom: 47px; width: 280px; }
  .moon-music-visible .coast-controls { left: 14px; transform: none; width: min(340px, calc(100% - 314px)); }
  .moon-music-visible .coast-customize { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .coast-ready *, .coast-ready *::before, .coast-ready *::after { animation: none !important; transition: none !important; }
}

/* Rain tiles composite independently of the large masked SVG sky. */
.coast-atmosphere[data-raining="false"] .coast-rain > div { animation-play-state: paused; }
/* Keep the current phase throughout touch and momentum scrolling. */
.scroll-active .jungle-scene *, .scroll-active .jungle-scene *::before,
.scroll-active .jungle-scene *::after, .scroll-active .catalog-butterfly,
.scroll-active .catalog-butterfly *, .scroll-active .fauna-catalog *,
.scroll-active .detail-motion, .scroll-active .scroll-cue span {
  animation-play-state: paused !important;
}
@media (max-width: 760px), (pointer: coarse) {
  .coast-cloud-drift { animation: none; }
  .coast-ready .botanical, .coast-ready .macaw-flight,
  .coast-ready .monkey-swing, .coast-ready .butterfly, .coast-ready .fauna-perch {
    transition: opacity 3s ease;
  }
  .motion-toggle, .coast-status, .coast-preview, .moon-music { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .paper-grain { mix-blend-mode: normal; }
  .scroll-active .scroll-reveal { transition: none; }
}

.decoration-offscreen, .decoration-offscreen * { animation-play-state: paused !important; }

/* Clip costly effects before compositing the panoramic illustration. */
.coast-atmosphere { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
@media (max-width: 760px), (pointer: coarse) {
  .painted-landscape { transform: scale(1.02); transition: none; overflow: hidden; contain: layout paint; }
}
