/*
 * hyd-theme.css
 *
 * One appearance layer for the whole site. Declares the colour tokens (--paper-*, --metal-*, --selected-*,
 * --scene and the wallpaper title and caption tokens) with one palette per wallpaper theme, then applies them
 * to every surface: shell, desktop windows, Places, Area, Player, dialogs and the boot screen. hyd-theme.js
 * picks the theme by setting data-theme on the html element, and may also set --scene inline from a chosen
 * wallpaper photo. The media itself and the silver and charcoal player keep their own colours. The last part of
 * the file holds the decorative souvenirs (lake and landmark sprites, heading and desktop souvenirs) and their
 * motion rules.
 *
 * Dormant: most of those souvenir rules match nothing on the shipped page (6 Oct 2026). .hyd-landmarks and
 * .hyd-neighbourhood are only created by hyd-landmarks.js, which hyd-world.html does not load, and .loose-eye,
 * .hyd-roll-art, .auto-souvenir and .landmark-caption have no producer at all. The live souvenir is the Places
 * heading button (.heading-souvenir). The dormant rules are kept as they were.
 */

/* One appearance layer. The media itself and the silver/charcoal player keep their colours. */
:root {
  --scene: url('media/iphone-picture-0004/display.jpg');
  --scene-preview: url('media/iphone-picture-0004/thumb.jpg');
  --paper-base: #1d171e;
  --paper-surface: #28262c;
  --paper-panel: #353239;
  --paper-inset: #1c1a20;
  --paper-text: #f5f3f6;
  --paper-muted: #c8c4cd;
  --paper-accent: #b8c9e6;
  --paper-edge: #89818f;
  --paper-high: #4a4852;
  --paper-low: #2f2c35;
  --paper-glass: #251630e8;
  --paper-shade: #110b1b8c;
  --metal-top: #efefef;
  --metal-mid: #b8b8b8;
  --metal-end: #d6d6d6;
  --metal-ink: #262626;
  --selected-top: #b89dce;
  --selected-mid: #73548b;
  --selected-end: #a586bb;
  --wallpaper-title-ink: #fff;
  --wallpaper-title-muted: #f0edf5;
  --wallpaper-title-shadow: 0 1px 1px #000c,0 2px 4px #0009;
  --desktop-caption-ink: #fff;
  --desktop-caption-shadow: 0 1px 1px #000e,0 0 3px #000b;
  color-scheme: dark;
}

/*
 * Per-theme palettes. Each block re-declares only the tokens that differ from the default palette above; the
 * active block is chosen by html[data-theme].
 */
:root[data-theme='dusk'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
  --paper-base: #1c1018;
  --paper-surface: #32212b;
  --paper-panel: #483039;
  --paper-inset: #22151e;
  --paper-text: #fff2ec;
  --paper-muted: #e3c8c1;
  --paper-accent: #f2ba9d;
  --paper-edge: #b89187;
  --paper-high: #775055;
  --paper-low: #432832;
  --paper-glass: #301b27ed;
  --paper-shade: #1c10178c;
  --metal-top: #fff1e9;
  --metal-mid: #bfa39d;
  --metal-end: #ebd0c7;
  --metal-ink: #3c252c;
  --selected-top: #ceaa9c;
  --selected-mid: #92645d;
  --selected-end: #b8897a;
}

/* lagoon and aurora-aqua share one blue palette; aurora-aqua then gets its own flat grey scene further down. */
:root[data-theme='lagoon'],
:root[data-theme='aurora-aqua'] {
  --scene: linear-gradient(#476c8a,#476c8a);
  --paper-base: #071b27;
  --paper-surface: #112e3d;
  --paper-panel: #1a4053;
  --paper-inset: #092231;
  --paper-text: #edfaff;
  --paper-muted: #b9d6e1;
  --paper-accent: #8edff5;
  --paper-edge: #7ea6b8;
  --paper-high: #37667f;
  --paper-low: #163b50;
  --paper-glass: #102d3aed;
  --paper-shade: #03192385;
  --metal-top: #f2fcff;
  --metal-mid: #a1becd;
  --metal-end: #d3e8f2;
  --metal-ink: #133346;
  --selected-top: #a0d4ed;
  --selected-mid: #397ba2;
  --selected-end: #79b9d7;
}

/* Base page colour; the wallpaper scene is painted over it by body::before. */
html[data-theme] {
  background: var(--paper-base);
}

/*
 * Themes that keep the default palette: each only picks its scene, here the shared photograph. A photo chosen
 * in the Personalise dialog overrides --scene inline.
 */
:root[data-theme='snow-aurora'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='snow-aurora-blue'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='snow-pond-reeds'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='snow-leopard'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='night'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='xp-ripple'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='xp-crystal'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='win-clouds'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='xp-ascent'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

:root[data-theme='aurora'] {
  --scene: url('media/iphone-picture-0004/display.jpg');
}

/* aurora-aqua: a flat grey scene instead of the lagoon blue set above. */
:root[data-theme='aurora-aqua'] {
  --scene: linear-gradient(#4b4b4b,#4b4b4b);
}

/* Wallpaper lettering is independent of the dark application windows. */
:root:is(
  [data-theme='snow-leopard'],
  [data-theme='snow-pond-reeds'],
  [data-theme='win-clouds'],
  [data-theme='xp-ripple'],
  [data-theme='dusk']
) {
  --wallpaper-title-ink: #162431;
  --wallpaper-title-muted: #24384a;
  --wallpaper-title-shadow: 0 1px 1px #ffffffb3,0 0 4px #ffffff80;
  /* These images have both bright and dark regions behind the icon columns. */
  --desktop-caption-shadow: 0 1px 1px #000,0 0 3px #000,0 0 5px #0009;
}

/* --- Page background and wallpaper scene --- */
html[data-theme] body {
  background: var(--paper-base);
  color: var(--paper-text);
  isolation: isolate;
}

/*
 * The wallpaper: a fixed layer behind the page. The full photo is drawn over a light preview image and drifts
 * slowly (scene-drift below); will-change keeps the drift on its own layer so the page is not repainted.
 */
body::before {
  content: '';
  position: fixed;
  inset: -2%;
  z-index: -1;
  pointer-events: none;
  background-image: var(--scene),var(--scene-preview,none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  animation: scene-drift 28s ease-in-out infinite alternate;
  animation-play-state: var(--motion,running);
  will-change: transform;
}

/*
 * Component tokens (--surface, --card-dark, --edge, --soft, --bright, --aqua-metal) derived from the active
 * theme and scoped to #world.
 */
html[data-theme] #world {
  background: transparent;
  --surface: var(--paper-surface);
  --card-dark: var(--paper-panel);
  --edge: var(--paper-edge);
  --soft: var(--paper-muted);
  --bright: var(--paper-accent);
  --aqua-metal: linear-gradient(var(--metal-top),var(--metal-mid) 48%,var(--metal-end));
  color: var(--paper-text);
}

/*
 * !important group: the desktop and its wallpaper layer must stay clear so the page-level scene shows through,
 * whatever other desktop sheets paint on them (hyd-aqua.css and hyd-player.css give .web-desktop a background
 * per data-wallpaper; hyd-desktop.css and hyd-personal-web.css give .desktop-corner a solid colour).
 */
html[data-theme] :is(#home, .desktop-corner, .portal-collage),
html[data-theme] #home .web-desktop[data-wallpaper] {
  background: transparent !important;
}

/* !important: same reason as the group above, for the wallpaper layer inside the desktop. */
html[data-theme] #home .desktop-wallpaper {
  background: none !important;
}

html[data-theme] #home .star-dust {
  background: none;
  opacity: 0.25;
}

html[data-theme] :is(#places, #roll, #area, #cinema) {
  background: transparent;
  color: var(--paper-text);
}

/* --- Top shell and footer --- */
html[data-theme] .shell {
  background: linear-gradient(var(--paper-panel),var(--paper-inset) 49%,var(--paper-base) 51%,var(--paper-surface));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] .shell :is(.brand, nav button, .motion) {
  color: var(--paper-text);
}

html[data-theme] .shell :is(.brand .dot, .logo-star) {
  color: var(--paper-accent);
}

html[data-theme] .shell nav button.active {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
  text-shadow: 0 1px #0008;
  box-shadow: inset 0 1px #ffffff38;
}

html[data-theme] .shell .deck-launch {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] .site-footer {
  background: var(--paper-glass);
  border-color: var(--paper-edge);
  color: var(--paper-muted);
}

html[data-theme] .site-footer :is(a, button) {
  color: var(--paper-muted);
}

html[data-theme] .shell .nav-postcard {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shell .nav-postcard svg {
  width: 22px;
  height: 22px;
}

/* Window chrome and insets share the same material across desktop and Finder. */
html[data-theme] #home .desktop-window {
  background: var(--paper-panel);
  border-color: var(--metal-top) var(--paper-edge) var(--paper-edge) var(--metal-top);
  color: var(--paper-text);
}

/*
 * !important: hyd-aqua.css paints .desktop-titlebar with its own !important backgrounds, so the themed metal
 * gradient has to be !important to replace them. hyd-mac-windows.css has a more specific !important rule for
 * the same title bars and takes precedence over this one where both apply.
 */
html[data-theme] #home .desktop-titlebar,
html[data-theme] #home #desk-entry .desktop-titlebar {
  background: linear-gradient(var(--metal-top),var(--metal-mid) 46%,var(--metal-end) 56%,var(--metal-mid)) !important;
  color: var(--metal-ink);
  border-color: var(--paper-edge);
  text-shadow: 0 1px #fff9;
}

html[data-theme] #home .window-grab {
  color: var(--metal-ink);
  text-shadow: 0 1px #fff9;
}

html[data-theme] #home :is(.desktop-titlebar > div > button, .entry-play) {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  border-color: var(--paper-edge);
  color: var(--metal-ink);
}

html[data-theme]
  #home
  :is(
    .visual-entry,
    .about-manad,
    .desk-recordings,
    #desk-view .desktop-sky,
    .desktop-contact-strip,
    .sticker-play,
    .places-finder-tabs,
    #desktop-area-folders
  ) {
  background: var(--paper-surface);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #home :is(.desktop-status, .desktop-photo-tools) {
  background: var(--paper-panel);
  border-color: var(--paper-edge);
  color: var(--paper-muted);
}

html[data-theme]
  #home
  :is(
    .about-manad h2,
    .about-manad h2 > span,
    .about-manad p,
    .shuffle-object b,
    .area-terminal > label > b,
    .desk-video-label,
    .desktop-sky > span
  ) {
  color: var(--paper-text);
}

html[data-theme] #home .desktop-icons b {
  background: transparent;
  color: var(--desktop-caption-ink);
}

html[data-theme] #home .about-manad p {
  color: var(--paper-muted);
}

html[data-theme]
  #home
  :is(.about-actions button, .desktop-photo-tools button, .sticker-actions button) {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #home :is(.desk-recordings > button, .desktop-contact-strip button) {
  background: var(--paper-panel);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #home :is(.desktop-menu, .places-finder-toolbar, .places-finder-footer) {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme]
  #home
  :is(.desktop-menu button, .places-finder-tabs button, .places-finder-footer button) {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  border-color: var(--paper-edge);
  color: var(--metal-ink);
}

html[data-theme] #home .places-finder-toolbar input {
  background: var(--metal-top);
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme]
  #home
  :is(
    .places-finder-tabs button[aria-pressed='true'],
    .desktop-contact-strip button[aria-pressed='true']
  ) {
  background: linear-gradient(var(--selected-top),var(--selected-mid) 48%,var(--selected-end));
  color: #fff;
  border-color: var(--metal-top);
}

html[data-theme] #home :is(.terminal-input, .area-suggestions, .area-suggestions.has-query) {
  background: var(--paper-inset);
  border-color: var(--paper-edge);
  scrollbar-color: var(--paper-edge) var(--paper-inset);
}

html[data-theme] #home .terminal-input input {
  color: var(--paper-text);
}

html[data-theme] #home .terminal-input > button {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] #home :is(.area-suggestions .discovery-result, .finder-area, .finder-all-areas) {
  color: var(--paper-text);
}

html[data-theme]
  #home
  :is(
    .area-suggestions .discovery-result > small,
    .finder-area small,
    .finder-empty,
    .sticker-play > small
  ) {
  color: var(--paper-muted);
}

html[data-theme]
  #home
  :is(
    .area-suggestions .discovery-result:hover,
    .area-suggestions .discovery-result:focus-visible,
    .finder-area:hover
  ) {
  background: var(--paper-high);
  border-color: var(--paper-accent);
}

html[data-theme] #desktop-area-folders {
  scrollbar-color: var(--paper-edge) var(--paper-inset);
}

html[data-theme] .portal-brand h1 em {
  background-image: linear-gradient(var(--metal-top),var(--paper-accent) 28%,var(--paper-high) 44%,var(--metal-top) 55%,var(--paper-accent) 85%);
}

html[data-theme] #home .pixel-spark {
  color: var(--paper-accent);
}

html[data-theme] .wallpaper-switch {
  background: var(--paper-glass);
  color: var(--paper-accent);
  border-color: var(--paper-edge);
}

/* Places, collections and photos use the wallpaper behind readable inset surfaces. */
html[data-theme] :is(.atlas-legend, .area-directory-head, .area-top, .area-heading) {
  background: var(--paper-glass);
  color: var(--paper-text);
}

html[data-theme]
  :is(
    .places-heading h1,
    .roll-heading h1,
    .roll-heading h1 span,
    .area-heading h1,
    .area-directory-head h2
  ) {
  color: var(--paper-text);
  text-shadow: 0 2px var(--paper-base);
}

html[data-theme]
  :is(
    .map-invitation,
    .map-status,
    .atlas-legend small,
    .map-footnote,
    .map-footnote a,
    .area-directory-head > span,
    .roll-caption,
    .area-location,
    .area-top,
    .area-bottom
  ) {
  color: var(--paper-muted);
}

html[data-theme]
  :is(
    .map-tools > button,
    .atlas-legend button,
    .collection-tools button,
    #roll #shuffle-scraps,
    .area-actions button,
    .frame-watch,
    .photo-shuffle
  ) {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme]
  :is(.collection-tools button[aria-pressed='true'], .atlas-legend button[aria-pressed='true']) {
  background: linear-gradient(var(--selected-top),var(--selected-mid) 48%,var(--selected-end));
  border-color: var(--metal-top);
  color: #fff;
}

html[data-theme]
  :is(#places .map-tools label, .area-finder input, .photo-browse select, .photo-browse input) {
  background: var(--paper-inset);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] :is(#places .map-tools input, .map-tools label > span) {
  color: var(--paper-text);
}

html[data-theme]
  :is(.map-tools input::placeholder, .area-finder input::placeholder, .photo-browse label) {
  color: var(--paper-muted);
}

html[data-theme] .atlas-stage .map-wrap {
  background: var(--paper-surface);
  border-color: var(--metal-top) var(--paper-edge) var(--paper-edge) var(--metal-top);
}

html[data-theme] :is(.atlas-window-bar, .frame-shelf-bar, .frame-titlebar) {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] .frame-shelf-bar #roll-status {
  color: var(--metal-ink);
}

html[data-theme] .map-wrap .map-marker-inner b {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] .map-wrap .map-marker-inner > img {
  border-color: var(--metal-top);
}

html[data-theme] .map-wrap .leaflet-control-zoom a {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] .map-wrap .map-key {
  background: var(--paper-glass);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme]
  :is(
    #map-selection,
    .map-selection-body,
    .discovery-results .discovery-result,
    .area-recording,
    .note-paper,
    .objects-link,
    .area-postcard
  ) {
  background: var(--paper-surface);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] :is(.map-selection-bar, #map-selection-lines button) {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] :is(#map-selection-title, .directory-card strong, .frame-footer strong) {
  color: var(--paper-text);
}

html[data-theme]
  :is(
    #map-selection-description,
    #map-sample-note,
    #map-empty,
    .discovery-result small,
    .directory-card small,
    .directory-action,
    .area-recording small,
    .area-postcard span
  ) {
  color: var(--paper-muted);
}

/* !important: hyd-retro.css and hyd-actions.css paint .directory-card with their own !important backgrounds. */
html[data-theme] .directory-card {
  background: linear-gradient(140deg,var(--paper-panel),var(--paper-inset)) !important;
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme]
  #area
  :is(.area-location, .area-heading .hand-label, .area-postcard span, .objects-link small) {
  color: var(--paper-muted);
}

html[data-theme] #area :is(.film-top, .area-note-icon, .area-postcard, .objects-link) {
  background: var(--paper-panel);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #area .hero-journey {
  border-color: var(--paper-edge);
}

html[data-theme] #cinema .cinema-below {
  background: var(--paper-glass);
}

html[data-theme]
  #cinema
  :is(
    .cinema-nav,
    .cinema-nav button,
    .cinema-brand,
    .cinema-below p,
    .cinema-below .sample-label,
    .chapters,
    .next-stop
  ) {
  color: var(--paper-muted);
  border-color: var(--paper-edge);
}

html[data-theme] #cinema .pixel-toolbar {
  background: var(--paper-panel);
  border-color: var(--paper-edge);
}

html[data-theme] #cinema :is(.pixel-toolbar > button, .chapters button) {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #cinema :is(.pixel-toolbar b, .pixel-toolbar small, .pixel-toolbar .day-glyph) {
  color: var(--paper-text);
}

html[data-theme] #cinema .chapters button[aria-pressed='true'] {
  background: var(--paper-high);
  color: var(--paper-text);
}

html[data-theme] #roll .keepsake-wall {
  background: var(--paper-glass);
  border-color: var(--paper-edge);
}

/* !important: hyd-retro.css paints .frame-window with its own !important gradient. */
html[data-theme] #roll .keepsake-wall .frame-window {
  background: linear-gradient(120deg,var(--metal-top),var(--metal-mid)) !important;
  border-color: var(--paper-edge);
}

html[data-theme] :is(.frame-footer, #roll-empty) {
  background: var(--paper-surface);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] .frame-titlebar .keep-frame {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] .frame-titlebar .keep-frame[aria-pressed='true'] {
  background: var(--paper-high);
  color: var(--paper-text);
}

html[data-theme] :is(.pair-card .pair-back, .pair-card:nth-child(3n) .pair-back) {
  background:
    repeating-radial-gradient(ellipse at 0 0,#ffffff14 0 1px,transparent 1px 9px),var(--paper-panel);
  color: var(--paper-accent);
}

/* Top-layer windows inherit the same tokens from html, rather than the desktop div. */
html[data-theme]
  :is(
    #desktop-personalise,
    #hyd-postcard,
    #email-manad,
    #photo-dialog,
    #story-dialog,
    #credits-dialog
  ) {
  background: var(--paper-surface);
  color: var(--paper-text);
  border-color: var(--metal-top) var(--paper-edge) var(--paper-edge) var(--metal-top);
}

html[data-theme] dialog::backdrop {
  background: var(--paper-shade);
  backdrop-filter: blur(3px);
}

html[data-theme]
  :is(.desktop-personalise-bar, .personal-titlebar, #hyd-postcard .postcard-titlebar) {
  background: linear-gradient(var(--metal-top),var(--metal-mid) 48%,var(--metal-end));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] :is(#hyd-postcard h2, .desktop-personalise-bar h2) {
  color: var(--metal-ink);
}

html[data-theme]
  :is(
    #hyd-postcard legend,
    #desktop-personalise legend,
    #hyd-postcard .postcard-form > label,
    .personal-email-body h2,
    #photo-dialog h2
  ) {
  color: var(--paper-text);
}

html[data-theme]
  :is(#hyd-postcard .postcard-form, #desktop-personalise fieldset, .personal-email-body label) {
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme]
  :is(
    .desktop-privacy,
    #desktop-settings-status,
    #hyd-postcard .postcard-hint,
    #hyd-postcard output,
    #hyd-postcard #postcard-status,
    #hyd-postcard #postcard-sticker-count,
    .personal-email-body p,
    .personal-email-body small,
    #photo-dialog p,
    #photo-source
  ) {
  color: var(--paper-muted);
}

html[data-theme]
  :is(
    #desktop-personalise .wallpaper-options button,
    #hyd-postcard .postcard-photos button,
    #hyd-postcard .postcard-sticker-tray
  ) {
  background: var(--paper-panel);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme]
  :is(
    #desktop-personalise .wallpaper-options button[aria-pressed='true'],
    #hyd-postcard .postcard-photos button[aria-pressed='true']
  ) {
  background: var(--paper-high);
  border-color: var(--paper-accent);
  box-shadow: 0 0 0 1px var(--paper-accent);
  color: var(--paper-text);
}

html[data-theme]
  :is(
    #desktop-personalise .desktop-preference-actions button,
    #desktop-personalise .desktop-personalise-bar > button,
    #hyd-postcard .postcard-close,
    #hyd-postcard .postcard-actions button,
    #hyd-postcard .postcard-sticker-controls button,
    .personal-email-body > button,
    .personal-close
  ) {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
  text-shadow: 0 1px #fff8;
}

html[data-theme] :is(#hyd-postcard #postcard-email, #hyd-postcard #postcard-share) {
  background: linear-gradient(var(--selected-top),var(--selected-mid) 49%,var(--selected-end));
  color: #fff;
  text-shadow: 0 1px #0005;
}

html[data-theme]
  :is(
    #hyd-postcard .postcard-form > input,
    #hyd-postcard textarea,
    .personal-email-body input,
    .personal-email-body textarea
  ) {
  background: var(--paper-inset);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme]
  :is(
    #hyd-postcard input::placeholder,
    #hyd-postcard textarea::placeholder,
    #hyd-postcard #postcard-selected-sticker,
    #hyd-postcard #postcard-open
  ) {
  color: var(--paper-muted);
}

/*
 * Wallpaper swatches in the Personalise dialog. Most show the shared photograph; lagoon and aurora-aqua show
 * the flat colour used as their scene.
 */
.wallpaper-options .swatch-snow-aurora {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-snow-aurora-blue {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-snow-pond-reeds {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-snow-leopard {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-night {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-xp-ripple {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-xp-crystal {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-win-clouds {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-xp-ascent {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-dusk {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-lagoon {
  background: linear-gradient(#476c8a, #476c8a) center/cover;
}

.wallpaper-options .swatch-aurora {
  background: url('media/iphone-picture-0004/display.jpg') center/cover;
}

.wallpaper-options .swatch-aurora-aqua {
  background: linear-gradient(#4b4b4b, #4b4b4b) center/cover;
}

/* --- Cat helper panel --- */
html[data-theme] .hyd-cat-panel {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  border-color: var(--paper-edge);
}

html[data-theme] .hyd-cat-titlebar {
  color: var(--metal-ink);
}

html[data-theme] #hyd-cat-panel .hyd-cat-titlebar button {
  color: var(--metal-ink);
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  border-color: var(--paper-edge);
}

html[data-theme] :is(.hyd-cat-actions, .hyd-cat-nap, .hyd-cat-bubble) {
  background: var(--paper-glass);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] .hyd-cat-actions > button:hover {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
}

html[data-theme] :is(#hyd-cat, #hyd-cat-panel) :is(button, p) {
  color: var(--paper-text);
}

html[data-theme] .shell .motion span {
  color: var(--paper-accent);
}

/* --- Video cover, photo browser and shuffle surfaces --- */
html[data-theme] #home :is(.desk-video-cover, .area-suggestions .discovery-result:nth-child(even)) {
  background: var(--paper-inset);
}

html[data-theme] #home .desk-video-cover i {
  background: var(--paper-shade);
  border-color: var(--paper-edge);
}

html[data-theme] .atlas-window-bar #metro-layer-toggle {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] :is(.photo-browse, #kept-count) {
  background: var(--paper-glass);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #photo-subjects button {
  background: var(--paper-panel);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] #photo-subjects button > span {
  color: var(--paper-accent);
}

html[data-theme] #photo-subjects button[aria-pressed='true'] {
  background: linear-gradient(var(--selected-top),var(--selected-mid),var(--selected-end));
  border-color: var(--metal-top);
  color: #fff;
}

html[data-theme] #roll .photo-browse #shuffle-scraps {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] :is(.frame-preview, .frame-time) {
  background: var(--paper-inset);
  border-color: var(--paper-edge);
}

html[data-theme] :is(.shuffle-box, .shuffle-caption) {
  background: var(--paper-surface);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] .shuffle-bar {
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
}

html[data-theme] #shuffle-overlay {
  background: var(--paper-shade);
}

/* The startup scene matches the appearance restored before the page paints. */
html[data-theme] #hyd-boot.hyd-boot {
  background: var(--paper-base);
  color: var(--paper-text);
}

html[data-theme] #hyd-boot .hyd-boot-stage {
  background: none;
}

html[data-theme] #hyd-boot .hyd-boot-wallpaper {
  background-image: var(--scene),var(--scene-preview,none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

html[data-theme] #hyd-boot .hyd-boot-wallpaper:before,
html[data-theme] #hyd-boot .hyd-boot-wallpaper:after {
  display: none;
}

html[data-theme] #hyd-boot .hyd-boot-window {
  background: var(--paper-glass);
  border-color: var(--paper-edge);
}

html[data-theme] #hyd-boot :is(.hyd-boot-bar, .hyd-boot-skip) {
  background: linear-gradient(var(--metal-top),var(--metal-mid),var(--metal-end));
  color: var(--metal-ink);
  border-color: var(--paper-edge);
}

html[data-theme] #hyd-boot .hyd-boot-orb {
  background:
    radial-gradient(at 35% 20%,#ffffff77,transparent 55%),linear-gradient(var(--paper-high),var(--paper-low));
  border-color: var(--paper-edge);
  box-shadow:
    inset 0 1px #fff9,
    0 8px 18px #0008;
}

html[data-theme] #hyd-boot :is(#hyd-boot-description, .hyd-boot-bottom, .hyd-boot-caption) {
  color: var(--paper-muted);
}

html[data-theme] #hyd-boot #hyd-boot-name em {
  background: none;
  color: var(--paper-accent);
  -webkit-text-fill-color: currentColor;
}

html[data-theme] #hyd-boot .hyd-boot-track {
  background: var(--paper-inset);
  border-color: var(--paper-edge);
}

html[data-theme] #hyd-boot .hyd-boot-track > span {
  background: repeating-linear-gradient(118deg,var(--selected-mid) 0 8px,var(--selected-top) 8px 16px,var(--selected-end) 16px 24px);
}

/* --- Refresh indicator and focus ring --- */
html[data-theme] #hyd-refresh {
  background: linear-gradient(var(--paper-high),var(--paper-low));
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] .hyd-refresh-spinner i {
  background: var(--paper-accent);
}

html[data-theme] :is(button, a, input, textarea, select):focus-visible {
  outline-color: var(--paper-accent);
}

/* The expanded (fullscreen) player gets the same dark backdrop in every theme. */
html[data-theme] .cinema-expanded #world,
html[data-theme] .cinema-expanded #cinema-view {
  background: #0a1117;
}

/* Slow pan and zoom of the wallpaper scene. */
@keyframes scene-drift {
  from {
    transform: scale(1.015) translate(-0.35%, 0);
  }
  to {
    transform: scale(1.04) translate(0.35%, -0.4%);
  }
}

@media (max-width: 620px) {
  /* Phone widths: a tighter top navigation. */
  html[data-theme] .shell nav {
    justify-content: space-between;
    gap: 0;
  }

  html[data-theme] .shell nav button {
    padding: 5px 7px;
    font-size: 11px;
  }

  .shell .nav-postcard svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Reduced motion and the motion-off setting: the scene stays still. */
  body::before {
    animation: none;
    will-change: auto;
  }
}

body.motion-off::before {
  animation: none;
  will-change: auto;
}

@media (min-width: 621px) and (max-width: 900px) {
  /* Tablet widths: a tighter top navigation. */
  .shell {
    gap: 9px;
  }

  .shell nav {
    gap: 0;
  }

  .shell nav button {
    padding: 5px 7px;
  }
}

/* Local souvenirs use the same Aqua materials as the windows. */
/* Dormant: .hyd-neighbourhood and .loose-eye (see the header). */
.portal-collage .hyd-neighbourhood {
  position: absolute;
  z-index: 3;
  right: 4%;
  top: 4px;
  width: 180px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 7px 9px #0005);
  transition: transform 0.25s ease;
}

.hyd-neighbourhood img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.hyd-neighbourhood::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/aqua/hyd-lake-diorama-sprite.webp') 0 0/2400% 100% no-repeat;
  animation: lake-reflection 4.8s steps(24, end) infinite;
  pointer-events: none;
}

.hyd-neighbourhood img {
  opacity: 0;
}

/* The sprite animation is paused while the desktop is hidden. */
#home[hidden] .hyd-neighbourhood::before {
  animation-play-state: paused;
}

/*
 * Plays the 24-frame sprite sheet (background-size 2400%). 104.347826% is 24/23 of 100%, the end offset that
 * lets steps(24, end) show each frame once.
 */
@keyframes lake-reflection {
  to {
    background-position-x: 104.347826%;
  }
}

.hyd-neighbourhood > span {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font:
    10px Tahoma,
    sans-serif;
  color: var(--paper-text);
  background: var(--paper-shade);
  padding: 3px 7px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.hyd-neighbourhood:hover,
.hyd-neighbourhood:focus-visible {
  transform: translateY(-4px);
}

.hyd-neighbourhood:hover > span,
.hyd-neighbourhood:focus-visible > span {
  opacity: 1;
}

.portal-collage .loose-eye svg {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 4px 3px #0006);
}

.portal-collage .loose-eye {
  width: 96px;
}

/* Illustration in the corner of the Roll (photos) page; it is hidden on phones further down.
   Dormant: no .hyd-roll-art markup, and the Roll page is retired. */
html[data-theme] #roll .hyd-roll-art {
  opacity: 0.9;
  top: 12px;
  right: 26px;
  width: 100px;
}

html[data-theme] #roll .hyd-roll-art svg {
  display: block;
  width: 100%;
  height: 90px;
  filter: drop-shadow(0 4px 4px #0005);
}

html[data-theme] #roll .hyd-roll-art > span {
  font:
    10px Tahoma,
    sans-serif;
  letter-spacing: 2px;
  text-shadow: none;
  color: var(--paper-accent);
}

/* --- Desktop stickers window colours --- */
html[data-theme] #home #desk-stickers .sticker-board {
  background: var(--paper-inset);
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #home #desk-stickers .sticker-tray > button {
  background: linear-gradient(var(--paper-panel),var(--paper-surface));
  border-color: var(--paper-edge);
  color: var(--paper-text);
}

html[data-theme] #home #desk-stickers .sticker-tray > button:is(:hover, .is-selected) {
  background: linear-gradient(var(--paper-high),var(--paper-low));
}

html[data-theme] #home #desk-stickers .sticker-preview-copy b {
  color: var(--paper-text);
}

html[data-theme] #home #desk-stickers :is(.sticker-preview-copy small, #sticker-status) {
  color: var(--paper-muted);
}

html[data-theme] :is(.recording-toolbar, .area-film-copy, .screen-info, .journey-meta) {
  background: var(--paper-surface);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] .chapters button {
  background: var(--paper-panel);
  color: var(--paper-text);
  border-color: var(--paper-edge);
}

html[data-theme] .chapters button[aria-pressed='true'] {
  background: var(--paper-high);
}

/* --- Souvenir placement and motion at tablet and phone widths ---
   Dormant: the lake, eye and Roll art souvenirs these place have no markup. */
@media (min-width: 621px) and (max-width: 900px) {
  .portal-collage .hyd-neighbourhood {
    width: 200px;
    right: 3%;
    top: 147px;
  }
}

@media (max-width: 620px) {
  .portal-collage .hyd-neighbourhood {
    width: 95px;
    right: -4px;
    top: 49px;
  }

  .hyd-neighbourhood > span {
    display: none;
  }

  .portal-collage .loose-eye svg {
    width: 85px;
    height: 85px;
  }

  .portal-collage .loose-eye {
    width: 85px;
  }

  html[data-theme] #roll .hyd-roll-art {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hyd-neighbourhood,
  .hyd-neighbourhood > span {
    transition: none;
  }

  .hyd-neighbourhood:hover,
  .hyd-neighbourhood:focus-visible {
    transform: none;
  }

  .hyd-neighbourhood::before {
    display: none;
    animation: none;
  }

  .hyd-neighbourhood img {
    opacity: 1;
  }
}

.motion-off .hyd-neighbourhood,
.motion-off .hyd-neighbourhood > span {
  transition: none;
}

.motion-off .hyd-neighbourhood:hover,
.motion-off .hyd-neighbourhood:focus-visible {
  transform: none;
}

.motion-off .hyd-neighbourhood::before {
  display: none;
  animation: none;
}

.motion-off .hyd-neighbourhood img {
  opacity: 1;
}

/* Recognisable local landmarks replace the previous generic skyline model. */
/* Dormant: hyd-landmarks.js, which builds .hyd-landmarks, is not loaded (see the header). */
.portal-collage .hyd-landmarks {
  position: absolute;
  z-index: 3;
  right: 4%;
  top: -7px;
  width: 180px;
  --landmark-sprite: url('assets/aqua/hyd-cyber-towers-sprite.webp');
}

.portal-collage .hyd-landmarks[data-landmark='bridge'] {
  --landmark-sprite: url('assets/aqua/hyd-durgam-bridge-sprite.webp');
}

.portal-collage .hyd-landmarks[data-landmark='charminar'] {
  --landmark-sprite: url('assets/aqua/hyd-charminar-sprite.webp');
}

.portal-collage .hyd-landmarks .hyd-neighbourhood {
  position: relative;
  right: auto;
  top: auto;
  width: 100%;
}

.hyd-landmarks .hyd-neighbourhood::before {
  background-image: var(--landmark-sprite);
  background-size: 3200% 100%;
  animation: landmark-light 6.4s steps(32, end) infinite;
}

/* Plays the 32-frame landmark sprite: 103.225806% is 32/31 of 100%, so steps(32, end) shows each frame once. */
@keyframes landmark-light {
  to {
    background-position-x: 103.225806%;
  }
}

.landmark-caption {
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--paper-text);
  font:
    10px Tahoma,
    sans-serif;
  background: var(--paper-glass);
  border: 1px solid var(--paper-edge);
  border-radius: 15px;
  padding: 3px 4px 3px 9px;
  box-shadow: 0 2px 5px #0005;
}

.landmark-caption button {
  display: grid;
  place-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--paper-edge);
  border-radius: 50%;
  background: linear-gradient(var(--metal-top),var(--metal-mid));
  color: var(--metal-ink);
  font: 17px Arial;
  cursor: pointer;
}

@media (min-width: 621px) and (max-width: 900px) {
  .portal-collage .hyd-landmarks {
    width: 180px;
    right: 3%;
    top: 112px;
  }
}

@media (max-width: 620px) {
  .portal-collage .hyd-landmarks {
    width: 112px;
    right: 18px;
    top: 242px;
  }

  .landmark-caption {
    font-size: 8px;
    padding: 2px 3px 2px 6px;
    gap: 2px;
    bottom: 0;
  }

  .landmark-caption button {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
}

/* Landmark sprite switched off when motion is off or reduced. */
.motion-off .hyd-landmarks .hyd-neighbourhood::before {
  animation: none;
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hyd-landmarks .hyd-neighbourhood::before {
    animation: none;
    display: none;
  }
}

/* Page titles sit directly on the chosen wallpaper; souvenirs do the decorating. */
html[data-theme] :is(#places .places-heading, #places .map-tools, #roll .roll-heading) {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

#places .places-heading,
#roll .roll-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#places .places-heading h1,
#roll .roll-heading h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

html[data-theme] .heading-souvenir {
  position: relative;
  flex: 0 0 128px;
  display: block;
  width: 128px;
  height: 124px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  rotate: 0deg;
  transform: none;
  color: var(--paper-text);
  cursor: pointer;
}

.heading-souvenir img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 4px #0004);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.heading-souvenir > span {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  border-radius: 9px;
  padding: 3px 7px;
  background: var(--paper-glass);
  color: var(--paper-text);
  font:
    9px Tahoma,
    sans-serif;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.heading-souvenir:hover img,
.heading-souvenir:focus-visible img {
  transform: translateY(-4px) rotate(-2deg);
}

.heading-souvenir:hover > span,
.heading-souvenir:focus-visible > span {
  opacity: 1;
}

#roll .roll-heading > .hyd-cat-slot {
  margin-left: 0;
}

/* --- Auto souvenir on the desktop ---
   Dormant: nothing creates .auto-souvenir. The blocks after these three rules are mostly
   live: they size the Places heading and its .heading-souvenir on phones and switch off the
   souvenir hover motion; only their .auto-souvenir and #roll rules are dormant. */
.portal-collage .auto-souvenir {
  width: 130px;
  rotate: -5deg;
}

.portal-collage .auto-souvenir img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 4px #0005);
}

.portal-collage .auto-souvenir .object-label {
  font-size: 9px;
  margin-top: -8px;
}

@media (max-width: 620px) {
  #places .places-heading,
  #roll .roll-heading {
    gap: 8px;
  }

  html[data-theme] .heading-souvenir {
    flex-basis: 88px;
    width: 88px;
    height: 96px;
  }

  #places .places-heading h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  #roll .roll-heading h1 {
    font-size: 38px;
    letter-spacing: -1.8px;
    line-height: 1.02;
  }

  .heading-souvenir > span {
    font-size: 8px;
  }

  .portal-collage .auto-souvenir {
    width: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .heading-souvenir img,
  .heading-souvenir > span {
    transition: none;
  }

  .heading-souvenir:hover img,
  .heading-souvenir:focus-visible img {
    transform: none;
  }
}

.motion-off .heading-souvenir img,
.motion-off .heading-souvenir > span {
  transition: none;
}

.motion-off .heading-souvenir:hover img,
.motion-off .heading-souvenir:focus-visible img {
  transform: none;
}

@media (min-width: 621px) and (max-width: 900px) {
  .portal-collage .auto-souvenir {
    left: 58%;
    top: 184px;
    width: 95px;
    rotate: -5deg;
  }
}

/* The caption stacks above the landmark artwork. Dormant: nothing creates .landmark-caption. */
.landmark-caption {
  z-index: 4;
}

/* The Charminar artwork is inset inside its landmark frame. Dormant (.hyd-landmarks). */
.portal-collage .hyd-landmarks[data-landmark='charminar'] .hyd-neighbourhood {
  width: calc(100% - 18px);
  margin: 0 9px 18px;
}
