/* The stage: wallpaper, menu bar, Dock, desktop files, nags, boot, the hero. */

html, body { margin: 0; background: var(--ink); }
body { font-family: var(--font-body); color: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* Skip link: first in tab order, visible on focus. */
.skip-link {
  position: absolute; left: 12px; top: 12px; z-index: 1000; translate: 0 -200%;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--yellow); color: var(--ink); font: 700 14px var(--font-round); text-decoration: none;
  box-shadow: var(--shadow-float); transition: translate 0.18s ease; opacity: 0;
}
.skip-link:focus { translate: 0 0; opacity: 1; }

/* ---------------------------------------------------------------- stage */
.stage {
  position: relative; width: 100%; height: 100vh; height: 100svh; min-height: 600px;
  overflow: hidden; isolation: isolate; contain: layout paint;
  -webkit-user-select: none; user-select: none; cursor: default;
  font-size: 13px;
}
.no-js .stage { display: none; }
@media (max-width: 819.98px) { .stage { display: none; } }

.layer { position: absolute; inset: 0; pointer-events: none; }
.layer > * { pointer-events: auto; }
.layer-wallpaper { z-index: 0; }
.layer-desktop { z-index: 1; }
.layer-desktop.is-flying { z-index: 6; }   /* screenshots flying into the shelf pass over the menu bar */
.layer-windows { z-index: 3; }
.layer-dock { z-index: 4; }
.layer-menubar { z-index: 5; }
.layer-overlays { z-index: 6; }
.layer-panels { z-index: 7; }
.layer-pointer { z-index: 8; }
.layer-wallpaper > *, .layer-pointer > * { pointer-events: none; }

.stage.has-pointer, .stage.has-pointer * { cursor: none !important; }

/* ------------------------------------------------------------- wallpaper */
.wp-base, .wp-glow, .wp-dots, .wp-veil { position: absolute; inset: 0; }
.wp-base {
  /* Ink to slate, ending slightly warm at the bottom right where the light comes from. */
  background:
    radial-gradient(80% 70% at 6% 0%, rgba(58, 68, 92, 0.32), rgba(58, 68, 92, 0) 70%),
    linear-gradient(160deg, #1D2130 0%, #16181F 55%, #1F1B15 100%);
}
.wp-dots {
  background-image: radial-gradient(circle at 1px 1px, rgba(245, 242, 234, 0.07) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 100% at 30% 20%, #000 30%, rgba(0, 0, 0, 0.45) 75%, rgba(0, 0, 0, 0.2) 100%);
          mask-image: radial-gradient(120% 100% at 30% 20%, #000 30%, rgba(0, 0, 0, 0.45) 75%, rgba(0, 0, 0, 0.2) 100%);
}
/* The light: a wide, low marker-yellow glow rising from the bottom right (900 x 520 at 84% 100%
   on a 1440 x 900 screen, so it scales with the stage). Eased stops, so it never bands. */
.wp-glow-dull, .wp-glow-warm { --glow: 0.17; }   /* over the dull one: 0.24 together */
.wp-glow-dull { --glow: 0.085; }
.wp-glow-dull, .wp-glow-warm {
  background: radial-gradient(62.5% 57.8% at 84% 100%,
    rgb(255 200 61 / calc(var(--glow) * 1)) 0%,
    rgb(255 200 61 / calc(var(--glow) * 0.82)) 12%,
    rgb(255 196 64 / calc(var(--glow) * 0.58)) 26%,
    rgb(255 190 70 / calc(var(--glow) * 0.34)) 40%,
    rgb(255 186 76 / calc(var(--glow) * 0.14)) 52%,
    rgb(255 186 76 / 0) 62%);
}
.wp-glow-warm { opacity: 0; transition: opacity 1.6s ease; }
.wp-veil { background: rgba(58, 58, 62, 0.2); transition: opacity 1.2s ease; }
.stage.is-uzeful .wp-glow-warm { opacity: 1; }
.stage.is-uzeful .wp-veil { opacity: 0; }

/* ----------------------------------------------------------------- glass */
.glass {
  background: var(--glass-veil);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-edge);
  box-shadow: var(--glass-sheen), var(--shadow-float);
}

/* -------------------------------------------------------------- menu bar */
.menubar {
  position: absolute; inset: 0 0 auto 0; height: var(--menubar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 8px 0 18px;
  background: rgba(20, 20, 22, 0.44);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  font-size: 13px; letter-spacing: 0.005em; white-space: nowrap;
}
.mb-left { display: flex; align-items: center; gap: 20px; min-width: 0; overflow: hidden; }
.mb-app { font-weight: 700; color: var(--paper); }
.mb-title { color: rgba(245, 242, 234, 0.6); }
.mb-right { display: flex; align-items: center; gap: 1px; flex: none; }
.mb-clutter, .mb-tray { display: flex; align-items: center; gap: 1px; }
[data-stage="messy"] .mb-tray, [data-stage="transforming"] .mb-tray { display: none; }

.mb-item {
  appearance: none; border: 0; background: none; padding: 0 5px; height: 22px; min-width: 24px;
  display: grid; place-items: center; border-radius: 5px; color: rgba(245, 242, 234, 0.9);
  position: relative;
}
.mb-item:hover, .mb-item.is-open { background: rgba(255, 255, 255, 0.14); }
.mb-item svg { display: block; }
/* The clutter came from fourteen developers: not quite the same weight or brightness. */
.mb-clutter .tray-item:nth-child(3n) { color: rgba(245, 242, 234, 0.78); }
.mb-clutter .tray-item:nth-child(4n + 1) svg { scale: 0.92; }
.mb-clutter .tray-item:nth-child(7) svg { scale: 1.06; }
.tray-item.has-badge::before {
  content: ""; position: absolute; top: 2px; right: 3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 1.5px rgba(20, 20, 22, 0.9);
}
.mb-u { color: var(--yellow); --tray-u-ink: var(--ink); padding: 0 6px; }
.mb-u svg { filter: drop-shadow(0 0 6px rgba(255, 200, 61, 0.25)); }
.mb-speaker { margin-left: 4px; }
.mb-clock { padding: 0 8px 0 6px; font-variant-numeric: tabular-nums; color: var(--paper); }
.mb-download {
  appearance: none; border: 0; height: 20px; padding: 0 11px; margin-left: 2px; border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow) 60%, var(--yellow-lo));
  color: var(--ink); font: 700 12px/20px var(--font-round); letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: filter 0.15s ease, translate 0.15s ease;
}
.mb-download:hover { filter: brightness(1.06); }
.mb-download:active { translate: 0 0.5px; filter: brightness(0.96); }

/* Tooltips: menu-bar items show theirs below, Dock tiles above. */
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; translate: -50% 0; z-index: 10;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
  font: 500 12px/1.3 var(--font-body); color: var(--paper);
  background: rgba(30, 30, 34, 0.92); border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  opacity: 0; transition: opacity 0.12s ease 0s;
}
.mb-item[data-tip]::after { top: calc(100% + 8px); }
.dock-item[data-tip]::after { bottom: calc(100% + 12px); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transition-delay: 0.35s; }

/* The u menu */
.u-menu {
  position: absolute; top: calc(var(--menubar-h) + 5px); min-width: 256px; padding: 6px;
  border-radius: 12px; background: rgba(32, 32, 36, 0.72);
  box-shadow: var(--glass-sheen), 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(0, 0, 0, 0.6);
  font-size: 13px; animation: menu-in 0.14s ease-out;
  /* Twenty-odd rows: on a short stage the menu scrolls inside itself instead of running off the bottom. */
  max-height: calc(100% - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes menu-in { from { opacity: 0; translate: 0 -4px; } }
.menu-head { padding: 6px 10px 3px 30px; font-size: 11.5px; font-weight: 600; color: var(--paper-faint); }
.menu-row {
  appearance: none; border: 0; background: none; width: 100%; text-align: left;
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 4px;
  padding: 5px 10px 5px 6px; border-radius: 6px; color: var(--paper); outline: none;
}
.menu-row:hover, .menu-row:focus-visible { background: var(--yellow); color: var(--ink); }
.menu-row:hover .menu-key, .menu-row:focus-visible .menu-key { color: rgba(20, 20, 22, 0.6); }
.menu-check { text-align: center; font-size: 12px; }
.menu-key { font: 500 12.5px var(--font-body); color: var(--paper-faint); letter-spacing: 0.04em; }
.menu-sep { height: 0.5px; margin: 5px 10px; background: rgba(255, 255, 255, 0.12); }

/* ------------------------------------------------------------------ Dock */
.dock {
  position: absolute; left: 50%; bottom: 10px; translate: -50% 0;
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px 4px;
  border-radius: 22px; background: rgba(36, 36, 42, 0.46);
  border-color: rgba(255, 255, 255, 0.14);
}
.dock-group { display: flex; gap: 9px; }
.dock-sep { width: 1px; height: 46px; margin: 2px 1px 0; background: rgba(255, 255, 255, 0.16); }
.dock-item {
  appearance: none; border: 0; background: none; padding: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 13px;
  transition: translate 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dock-item:hover { translate: 0 -7px; }
.dock-item:active .dock-tile { filter: brightness(0.86); }
.dock-tile {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}
.dock-tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 48%);
}
.dock-tile svg { position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2)); }
.dock-item[data-dock-id="bin"] .dock-tile { border: 0.5px solid rgba(255, 255, 255, 0.16); }
.dock-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--paper); opacity: 0; transition: opacity 0.2s; }
.dock-item.is-running .dock-dot { opacity: 0.85; }

/* ---------------------------------------------------------- desktop files */
.desktop-files { position: absolute; inset: 0; pointer-events: none; }
.file {
  position: absolute; width: 96px; height: 100px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transform-origin: 50% 50%;
}
.file-icon { height: 60px; display: flex; align-items: flex-end; justify-content: center; padding: 3px; border-radius: 6px; }
.file-thumb {
  overflow: hidden; border-radius: 1.5px; background: #fff;
  box-shadow: 0 0 0 1.25px rgba(255, 255, 255, 0.92), 0 5px 12px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.45);
}
.file-thumb svg { display: block; width: 100%; height: 100%; }
.file-name {
  display: flex; flex-direction: column; align-items: center; width: 120px; margin: 0 -12px;
  font: 500 11px/13px var(--font-body); color: #fff; text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 8px rgba(0, 0, 0, 0.45);
}
.file-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 3px; border-radius: 3px; }
.file.is-buried .file-name { visibility: hidden; }
.file.is-selected .file-icon { background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.file.is-selected .file-name span { background: #2D6BD3; text-shadow: none; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: absolute; left: 50%; top: 47%; translate: -50% -50%;
  width: min(760px, 86%); display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none;
}
.hero > * { pointer-events: auto; }
.hero-h {
  margin: 0; font: 800 clamp(46px, 5.3vw, 80px)/1 var(--font-round); letter-spacing: -0.025em;
  color: var(--paper); text-shadow: 0 2px 40px rgba(0, 0, 0, 0.45); text-wrap: balance;
}
.hero-h .hl { position: relative; white-space: nowrap; }
.hero-h .hl::after {
  /* A marker swipe under "help.", like the underline in the app's wordmark. */
  content: ""; position: absolute; left: -2%; right: 4%; bottom: -0.13em; height: 0.2em; z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 11.5C40 6.5 98 3.6 196 6.2' fill='none' stroke='%23FFC83D' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.hero-p { margin: 18px 0 32px; max-width: 36ch; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.45; color: var(--paper-dim); text-wrap: balance; }

.cta {
  appearance: none; border: 0; position: relative; isolation: isolate;
  padding: 18px 32px 19px; border-radius: var(--r-pill);
  font: 750 18px/1 var(--font-round); letter-spacing: 0.005em; color: var(--ink);
  background: linear-gradient(180deg, var(--yellow-hi) 0%, var(--yellow) 55%, var(--yellow-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(150, 95, 0, 0.22),
              0 12px 32px -8px rgba(255, 200, 61, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: translate 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), scale 0.12s ease, box-shadow 0.25s ease;
}
.cta::before {
  content: ""; position: absolute; inset: -18px -22px; border-radius: inherit; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 200, 61, 0.42), rgba(255, 200, 61, 0));
  animation: cta-glow 3.4s ease-in-out infinite;
}
@keyframes cta-glow { 0%, 100% { opacity: 0.55; scale: 0.94; } 50% { opacity: 1; scale: 1.05; } }
.cta:hover { translate: 0 -2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(150, 95, 0, 0.22), 0 18px 40px -8px rgba(255, 200, 61, 0.7), 0 3px 8px rgba(0, 0, 0, 0.35); }
.cta:active { translate: 0 1px; scale: 0.975; transition-duration: 0.06s; }

/* ---------------------------------------------------------- notifications */
.notif-column { position: absolute; top: calc(var(--menubar-h) + 10px); right: 12px; width: 348px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notif-column > * { pointer-events: auto; }
.notif {
  display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start;
  padding: 11px 14px 12px 12px; border-radius: 16px; background: rgba(40, 40, 46, 0.6);
}
.notif-icon svg { display: block; width: 34px; height: 34px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)); }
.notif-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--paper-faint); margin-bottom: 1px; }
.notif-app { font-weight: 600; letter-spacing: 0.01em; }
.notif-title { font-weight: 650; font-size: 13px; line-height: 1.3; color: var(--paper); }
.notif-body { font-size: 12.5px; line-height: 1.35; color: var(--paper-dim); margin-top: 1px; }

/* ----------------------------------------------------- toasts and callouts */
.toast {
  position: absolute; left: 50%; bottom: 108px; translate: -50% 0;
  padding: 12px 22px 13px; border-radius: var(--r-pill);
  font: 700 16px/1 var(--font-round); color: var(--paper); white-space: nowrap;
  background: rgba(30, 30, 34, 0.7);
}
.toast-yellow { background: var(--yellow); color: var(--ink); }
.callout {
  position: absolute; translate: -50% 0; transform-origin: 50% 0;
  padding: 6px 11px 7px; border-radius: var(--r-pill); white-space: nowrap;
  font: 600 13px/1.1 var(--font-round); color: var(--ink);
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px rgba(0, 0, 0, 0.4);
}
.callout b { font-weight: 800; }
.callout-arrow { opacity: 0.6; margin: 0 1px; }

/* ------------------------------------------------------------------ boot */
.boot {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(34% 30% at 50% 47%, rgba(255, 200, 61, 0.055), rgba(255, 200, 61, 0) 72%),
    radial-gradient(62.5% 57.8% at 84% 100%, rgba(255, 200, 61, 0.035), rgba(255, 200, 61, 0) 62%),
    radial-gradient(55% 50% at 50% 44%, #1C1C21 0%, #0D0D0F 100%);
}
.boot-mark { margin-bottom: 36px; filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 40px rgba(255, 200, 61, 0.08)); }
.boot-mark svg { display: block; }
.boot-bar { width: 196px; height: 5px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.1); overflow: hidden; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.06); }
.boot-fill { height: 100%; border-radius: inherit; transform-origin: left center; scale: 0 1; background: linear-gradient(90deg, var(--yellow-lo), var(--yellow-hi)); }
.boot-line { margin: 20px 0 0; min-height: 1.4em; font-size: 14px; color: var(--paper-dim); letter-spacing: 0.005em; }
.boot-skip { position: absolute; bottom: 26px; margin: 0; font-size: 12px; color: rgba(245, 242, 234, 0.3); }

/* ------------------------------------------------------- shelf stand-in */
.shelf-tray {
  position: absolute; top: calc(var(--menubar-h) + 8px); left: 50%; translate: -50% 0;
  width: min(600px, 54%); padding: 10px 12px 12px; border-radius: 16px; background: rgba(34, 34, 40, 0.66);
}
.ss-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 9px; }
.ss-title { font: 700 13px var(--font-round); color: var(--paper); }
.ss-count { font-size: 12px; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.shelf-tray.is-full .ss-count { color: var(--yellow); font-weight: 600; }
.ss-strip { display: flex; gap: 8px; height: 48px; align-items: center; overflow: hidden; justify-content: flex-end; }
.ss-mini { flex: none; width: 70px; height: 44px; border-radius: 3px; overflow: hidden; position: relative; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75), 0 3px 8px rgba(0, 0, 0, 0.4); }
.ss-mini svg { display: block; width: 100%; height: 100%; }
.ss-mini.is-keeper { box-shadow: 0 0 0 2px var(--yellow), 0 3px 8px rgba(0, 0, 0, 0.4); }
.shelf-handle {
  position: absolute; top: var(--menubar-h); left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 7px; height: 20px; padding: 0 12px 1px 10px;
  border-radius: 0 0 10px 10px; border-top: 0; background: rgba(30, 30, 34, 0.6);
  font: 600 11px/1 var(--font-round); color: var(--paper-dim); appearance: none;
}
.ss-handle-grip { width: 16px; height: 3px; border-radius: 2px; background: rgba(245, 242, 234, 0.4); }
.shelf-handle:hover { color: var(--paper); }

/* ------------------------------------------------------------ stage chip */
.stage-chip {
  position: absolute; left: 14px; bottom: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 13px; border-radius: var(--r-pill);
  font: 600 12px/1 var(--font-round); color: var(--paper-dim); text-decoration: none;
  background: rgba(30, 30, 34, 0.5); box-shadow: var(--glass-sheen), 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: color 0.15s ease, translate 0.2s ease;
}
.stage-chip:hover { color: var(--paper); translate: 0 -1px; }

/* ------------------------------------------------------- still and calm */
.still *, .still *::before, .still *::after { animation-play-state: paused !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cta::before { animation: none; }
  .dock-item, .cta, .wp-glow-warm, .wp-veil { transition-duration: 0.01s; }
  .u-menu { animation: none; }
}
