:root {
  color-scheme: dark;
  --page-bg: #060916;
  --text: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, #172139 0%, #090d1b 42%, #040610 100%);
  color: var(--text);
}
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
}

/*
  The source artwork is exactly 1536 × 1024 (3:2).
  Only the width is resolved here; height is derived from aspect-ratio.
  Keeping both width and height explicit can let stale/overridden CSS stretch
  the stage to the viewport and put the interaction layer in another coordinate
  system. One source ratio now drives the artwork, panel links and hover rings.
*/
.desktop-stage {
  position: relative;
  width: min(100vw, 150vh);
  width: min(100vw, 150svh);
  height: auto;
  max-height: 100vh;
  max-height: 100svh;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
  background: #080c18;
  box-shadow: 0 0 90px rgba(0, 0, 0, .58);
}

.render-picture {
  position: absolute;
  inset: 0;
  display: block;
}
.render-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.desktop-links {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.panel-link {
  --glow: 255, 255, 255;
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
  outline: none;
  transition: background-color .25s ease, box-shadow .25s ease;
}

/* Decorative separators must not change the width of the three equal panels. */
.panel-link:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,.035);
  pointer-events: none;
}
.panel-link--cleaning {
  --glow: 185, 80, 255;
  --button-left: 37.890625%;   /* 194 / 512 */
  --button-top: 83.0078125%;    /* 850 / 1024 */
  --button-width: 27.34375%;    /* 140 / 512 */
  --button-height: 4.6875%;     /* 48 / 1024 */
}
.panel-link--transport {
  --glow: 255, 142, 34;
  --button-left: 35.546875%;   /* 182 / 512 */
  --button-top: 83.0078125%;   /* 850 / 1024 */
  --button-width: 28.125%;     /* 144 / 512 */
  --button-height: 4.6875%;    /* 48 / 1024 */
}
.panel-link--manager {
  --glow: 37, 218, 220;
  --button-left: 33.3984375%;  /* 171 / 512 */
  --button-top: 83.0078125%;   /* 850 / 1024 */
  --button-width: 28.7109375%; /* 147 / 512 */
  --button-height: 4.6875%;    /* 48 / 1024 */
}

/* Only a gentle interaction layer: the artwork itself stays unchanged. */
.panel-link:hover,
.panel-link:focus-visible {
  background: linear-gradient(180deg, transparent 60%, rgba(var(--glow), .035));
  box-shadow: inset 0 0 55px rgba(var(--glow), .075);
}

/*
  The three controls were painted at different horizontal positions in the
  generated artwork. Their exact source-pixel bounds are stored per panel
  above; sharing one left offset caused a growing rightward hover mismatch.
  Keep the artwork stationary and fade only the glow around its own bounds.
*/
.visual-button {
  position: absolute;
  left: var(--button-left);
  top: var(--button-top);
  width: var(--button-width);
  height: var(--button-height);
  border: 1px solid transparent;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(var(--glow), 0);
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.visual-button::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  opacity: 0;
  box-shadow:
    0 0 0 3px rgba(var(--glow), .14),
    0 0 24px rgba(var(--glow), .42);
  transition: opacity .18s ease;
}

.panel-link:hover .visual-button,
.panel-link:focus-visible .visual-button {
  border-color: rgba(255,255,255,.48);
  box-shadow: inset 0 0 14px rgba(var(--glow), .12);
  filter: brightness(1.06);
}

.panel-link:hover .visual-button::before,
.panel-link:focus-visible .visual-button::before {
  opacity: 1;
}

.panel-link:focus-visible .visual-button {
  outline: 3px solid rgba(255,255,255,.92);
  outline-offset: 6px;
}

.mobile-selector { display: none; }

@media (max-width: 840px), (max-height: 520px) and (orientation: portrait) {
  body { overflow: auto; }
  .page-shell { display: block; }
  .desktop-stage { display: none; }

  .mobile-selector {
    display: block;
    min-height: 100svh;
    background: #070916;
  }
  .mobile-header {
    position: relative;
    z-index: 5;
    padding: 28px 20px 24px;
    text-align: center;
    background: linear-gradient(180deg, #111427, #080a16);
  }
  .mobile-header h1 {
    margin: 6px 0 5px;
    font-size: clamp(25px, 7vw, 38px);
    letter-spacing: -.035em;
  }
  .mobile-header p {
    margin: 0;
    color: rgba(255,255,255,.65);
    font-size: 13px;
  }
  .mobile-paw { font-size: 24px; }

  .mobile-panel {
    --accent: #fff;
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(720px, 112svh);
    padding: 28px 18px 38px;
    overflow: hidden;
    background-color: #10101b;
    background-image:
      linear-gradient(180deg, rgba(4,5,14,.02) 38%, rgba(4,5,14,.8) 83%, #060812 100%),
      var(--scene);
    background-size: cover, 100% auto;
    background-position: center, center top;
    background-repeat: no-repeat;
  }
  .mobile-panel--cleaning { --accent: #b950ff; --scene: url("assets/cleaning.webp"); }
  .mobile-panel--transport { --accent: #ff892b; --scene: url("assets/transport.webp"); }
  .mobile-panel--manager { --accent: #24d8d8; --scene: url("assets/manager.webp"); }

  .mobile-card {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 13px 14px;
    width: min(100%, 470px);
    margin: 0 auto;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
    border-radius: 25px;
    background: rgba(9,10,20,.82);
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
    backdrop-filter: blur(18px) saturate(130%);
  }
  .mobile-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 17px;
    background: color-mix(in srgb, var(--accent) 72%, #171827);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 25%, transparent);
    font-size: 24px;
  }
  .mobile-card h2 {
    margin: 0 0 5px;
    font-size: 29px;
    line-height: 1;
    letter-spacing: -.035em;
  }
  .mobile-card p {
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 13px;
    line-height: 1.45;
  }
  .mobile-card a {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    margin-top: 3px;
    padding: 8px 10px 8px 18px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent));
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  .mobile-panel--manager .mobile-card a { color: #062126; }
  .mobile-card a span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
