/* Prototype-only sky treatments, title reveals and service carousel. */

/* The original supplied day/night images remain the untouched base in Original mode. */
#sky-effects {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: .12;
  transition: opacity 1s ease;
}
#sky-effects::before,
#sky-effects::after {
  content: "";
  position: absolute;
  inset: 0;
  filter: blur(34px);
  will-change: transform;
}
#sky-effects::before {
  background:
    radial-gradient(ellipse 34% 16% at 24% 36%, rgba(244, 239, 222, .32), transparent 76%),
    radial-gradient(ellipse 28% 13% at 67% 29%, rgba(222, 231, 225, .24), transparent 78%),
    radial-gradient(ellipse 42% 17% at 78% 71%, rgba(227, 218, 199, .17), transparent 76%);
  animation: cloud-drift-a 78s ease-in-out infinite alternate;
}
#sky-effects::after {
  background:
    radial-gradient(ellipse 30% 12% at 39% 65%, rgba(205, 220, 219, .19), transparent 78%),
    radial-gradient(ellipse 34% 15% at 83% 40%, rgba(240, 226, 202, .14), transparent 80%);
  animation: cloud-drift-b 94s ease-in-out infinite alternate;
}
#landscape { z-index: 2; }
.stage-coordinate,
.stage-caption { z-index: 3; }
:root[data-theme="light"] #sky-effects { opacity: .10; }

/* New sky: procedural gradients only; no supplied background image is used. */
:root[data-sky-mode="new"] #persistent-stage { background: #0b121b; }
:root[data-theme="dark"][data-sky-mode="new"] #persistent-stage::before {
  background-image:
    radial-gradient(ellipse 56% 72% at 72% 42%, rgba(37, 112, 120, .40), transparent 72%),
    radial-gradient(ellipse 47% 63% at 28% 56%, rgba(88, 69, 112, .35), transparent 73%),
    radial-gradient(ellipse 33% 40% at 48% 18%, rgba(146, 117, 91, .16), transparent 75%),
    linear-gradient(132deg, #0b121b 0%, #17252b 48%, #171723 100%);
  background-size: 150% 150%;
  animation: aurora-base-pan 54s ease-in-out infinite alternate;
}
:root[data-theme="light"][data-sky-mode="new"] #persistent-stage {
  background: #e8e6dc;
}
:root[data-theme="light"][data-sky-mode="new"] #persistent-stage::before {
  background-image:
    radial-gradient(ellipse 58% 70% at 71% 42%, rgba(90, 152, 145, .30), transparent 72%),
    radial-gradient(ellipse 47% 60% at 29% 57%, rgba(168, 135, 161, .25), transparent 74%),
    radial-gradient(ellipse 34% 40% at 48% 18%, rgba(218, 165, 124, .26), transparent 76%),
    linear-gradient(132deg, #e9e9df 0%, #d5e0d6 49%, #e5d9d0 100%);
  background-size: 150% 150%;
  animation: aurora-base-pan 54s ease-in-out infinite alternate;
}
:root[data-sky-mode="new"] #sky-effects { opacity: .72; }
:root[data-theme="light"][data-sky-mode="new"] #sky-effects { opacity: .56; }
:root[data-sky-mode="new"] #sky-effects::before {
  background:
    radial-gradient(ellipse 13% 20% at 4% 79%, rgba(78, 153, 161, .54), rgba(59, 121, 139, .30) 42%, transparent 72%),
    radial-gradient(ellipse 16% 27% at 17% 83%, rgba(69, 143, 154, .52), rgba(56, 116, 138, .28) 43%, transparent 73%),
    radial-gradient(ellipse 14% 22% at 31% 77%, rgba(98, 151, 162, .50), rgba(70, 119, 143, .26) 43%, transparent 72%),
    radial-gradient(ellipse 17% 29% at 46% 84%, rgba(125, 139, 174, .48), rgba(85, 113, 153, .25) 44%, transparent 73%),
    radial-gradient(ellipse 13% 21% at 61% 78%, rgba(79, 148, 155, .51), rgba(57, 119, 137, .27) 43%, transparent 72%),
    radial-gradient(ellipse 17% 28% at 76% 84%, rgba(90, 150, 157, .50), rgba(63, 118, 140, .27) 44%, transparent 73%),
    radial-gradient(ellipse 14% 23% at 91% 79%, rgba(148, 117, 163, .48), rgba(96, 103, 147, .26) 44%, transparent 72%),
    radial-gradient(ellipse 11% 20% at 103% 84%, rgba(89, 142, 152, .46), rgba(58, 113, 133, .24) 44%, transparent 72%),
    radial-gradient(ellipse 42% 25% at 35% 42%, rgba(88, 199, 188, .22), transparent 74%),
    radial-gradient(ellipse 45% 24% at 71% 50%, rgba(148, 111, 192, .20), transparent 77%),
    linear-gradient(to top, rgba(40, 102, 116, .12), transparent 36%);
  filter: blur(12px);
  animation: aurora-flow-a 42s ease-in-out infinite alternate;
}
:root[data-sky-mode="new"] #sky-effects::after {
  background:
    radial-gradient(ellipse 52% 19% at 48% 31%, rgba(100, 177, 181, .17), transparent 78%),
    radial-gradient(ellipse 34% 19% at 80% 70%, rgba(162, 123, 168, .16), transparent 80%);
  filter: blur(46px);
  animation: aurora-flow-b 61s ease-in-out infinite alternate;
}
:root[data-theme="light"][data-sky-mode="new"] #sky-effects::before {
  background:
    radial-gradient(ellipse 13% 20% at 4% 79%, rgba(94, 158, 151, .38), rgba(80, 135, 137, .20) 42%, transparent 72%),
    radial-gradient(ellipse 16% 27% at 17% 83%, rgba(90, 153, 146, .36), rgba(76, 132, 137, .19) 43%, transparent 73%),
    radial-gradient(ellipse 14% 22% at 31% 77%, rgba(125, 157, 155, .34), rgba(96, 133, 145, .18) 43%, transparent 72%),
    radial-gradient(ellipse 17% 29% at 46% 84%, rgba(154, 145, 171, .32), rgba(122, 128, 158, .17) 44%, transparent 73%),
    radial-gradient(ellipse 13% 21% at 61% 78%, rgba(100, 157, 150, .35), rgba(80, 134, 137, .18) 43%, transparent 72%),
    radial-gradient(ellipse 17% 28% at 76% 84%, rgba(110, 159, 151, .34), rgba(84, 133, 140, .18) 44%, transparent 73%),
    radial-gradient(ellipse 14% 23% at 91% 79%, rgba(168, 143, 166, .32), rgba(126, 127, 157, .17) 44%, transparent 72%),
    radial-gradient(ellipse 11% 20% at 103% 84%, rgba(113, 153, 146, .31), rgba(80, 128, 136, .16) 44%, transparent 72%),
    radial-gradient(ellipse 42% 25% at 35% 42%, rgba(46, 133, 129, .14), transparent 74%),
    radial-gradient(ellipse 45% 24% at 71% 50%, rgba(129, 91, 147, .12), transparent 77%),
    linear-gradient(to top, rgba(85, 127, 118, .11), transparent 36%);
  filter: blur(12px);
}
:root[data-theme="light"][data-sky-mode="new"] #sky-effects::after {
  background:
    radial-gradient(ellipse 52% 19% at 48% 31%, rgba(42, 127, 131, .12), transparent 78%),
    radial-gradient(ellipse 34% 19% at 80% 70%, rgba(149, 98, 145, .11), transparent 80%);
}

@keyframes cloud-drift-a {
  from { transform: translate3d(-1.3%, -.4%, 0) scale(1); }
  to { transform: translate3d(1.6%, .9%, 0) scale(1.035); }
}
@keyframes cloud-drift-b {
  from { transform: translate3d(1%, .6%, 0) scale(1.02); }
  to { transform: translate3d(-1.2%, -.8%, 0) scale(1); }
}
@keyframes aurora-base-pan {
  from { background-position: 42% 48%; }
  to { background-position: 58% 52%; }
}
@keyframes aurora-flow-a {
  from { transform: translate3d(-2%, 1%, 0) rotate(-2deg) scale(1); }
  to { transform: translate3d(2%, -1.4%, 0) rotate(2deg) scale(1.05); }
}
@keyframes aurora-flow-b {
  from { transform: translate3d(1.4%, -1%, 0) rotate(1deg) scale(1.03); }
  to { transform: translate3d(-1.5%, 1.3%, 0) rotate(-1.5deg) scale(1); }
}

/* Small, clearly labelled prototype control; mobile control lives in the menu. */
.sky-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--muted);
  white-space: nowrap;
}
.sky-switch-label {
  padding: 0 5px;
  color: var(--muted);
  font: 7px/1.2 monospace;
  letter-spacing: .11em;
}
.sky-switch button {
  border: 0;
  padding: 6px 8px;
  color: var(--muted);
  font: 8px/1.2 monospace;
  transition: background .2s, color .2s;
}
.sky-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--inverse);
}
.sky-switch button:hover { color: var(--fg); }
.sky-switch button[aria-pressed="true"]:hover { color: var(--inverse); }
.mobile-sky-switch { display: none; }

/* Horizontal five-card service rail, retaining the original square artwork. */
.service-carousel-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -16px 0 10px;
}
.service-carousel-tools > span {
  color: var(--muted);
  font: 8px/1.4 monospace;
  letter-spacing: .09em;
}
#service-track.service-grid {
  display: flex;
  gap: 12px;
  margin-top: 0;
  padding: 3px 1px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
#service-track::-webkit-scrollbar { height: 4px; }
#service-track::-webkit-scrollbar-thumb { background: var(--accent); }
#service-track::-webkit-scrollbar-track { background: transparent; }
#service-track .service-card {
  flex: 0 0 clamp(205px, 22vw, 255px);
  min-width: 0;
  aspect-ratio: 1 / 1;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
#service-track .service-photo { height: 68%; }
#service-track .service-photo img { object-fit: contain; }
#service-track .service-copy strong { font-size: clamp(15px, 1.5vw, 20px); }
#service-track .service-copy small { font-size: clamp(8px, .75vw, 10px); line-height: 1.35; }
#service-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Titles are hidden only after JS has installed a working observer. */
.js .reveal-title:not(.is-revealed) {
  opacity: 0;
  filter: blur(1.25px);
  transform: translateY(10px);
}
.js .reveal-title {
  transition: opacity .42s ease, filter .42s ease, transform .42s cubic-bezier(.2,.7,.2,1);
}
.js .reveal-title.is-revealed { opacity: 1; filter: blur(0); transform: none; }

@media (max-width: 800px) {
  .desktop-sky-switch { display: none; }
  .mobile-sky-switch { display: inline-flex; margin: 12px 0 8px; }
  .mobile-sky-switch button { padding: 9px 10px; }
  .service-carousel-tools { margin-top: -10px; }
  .service-carousel-tools > span { font-size: 7px; letter-spacing: .04em; }
  #service-track.service-grid { gap: 10px; }
  #service-track .service-card { flex-basis: clamp(205px, 64vw, 255px); }
  #service-track .service-photo { height: 66%; }
  #service-track .service-copy { padding: 7px 9px; }
  #service-track .service-copy strong { font-size: clamp(15px, 4vw, 18px); }
  #service-track .service-copy small { font-size: clamp(8px, 2.2vw, 9px); }
}
@media (prefers-reduced-motion: reduce) {
  #sky-effects::before, #sky-effects::after,
  :root[data-sky-mode="new"] #persistent-stage::before { animation: none !important; }
  .js .reveal-title:not(.is-revealed) { opacity: 1; filter: none; transform: none; }
  .js .reveal-title { transition: none !important; }
  #service-track.service-grid { scroll-behavior: auto; }
}
