/* ============================================================
   ANATHEMA LABS — desktop/mobile shell
   1. Base   2. Shared brand
   3. Desktop (classic macOS)   4. Mobile (iOS)   5. Sheet

   Design primitives (colour, type, space, radii, borders,
   elevation, motion, z-index) live in css/design-system.css and
   MUST be linked before this file. This file only styles the shell.
   ============================================================ */

/* ---------- 1. Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-ui);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow: hidden; }

.screen { display: none; }

/* Toggle layouts by viewport. Desktop metaphor >= 900px. */
@media (min-width: 900px) {
  #desktop { display: block; }
}
@media (max-width: 899px) {
  #mobile { display: block; }
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- 2. Shared brand ---------- */
.brand {
  font-family: var(--font-logo);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 0.95;
  color: var(--orange);
}
.brand__thin {
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 600;
  font-size: 0.78em;
  letter-spacing: -0.015em;
  color: var(--black);
  margin-left: 0.16em;
}
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-3);
  margin-top: 10px;
}

/* ============================================================
   3. DESKTOP — classic macOS
   ============================================================ */
#desktop {
  position: fixed;
  inset: 0;
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(120% 120% at 100% 0%, #ffffff 0%, var(--white) 42%, #eceae4 100%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
}

/* --- Menu bar --- */
.menubar {
  position: relative;
  z-index: var(--z-menubar);
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--paper);
  border-bottom: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.menubar__left { display: flex; align-items: baseline; gap: 22px; }
.menubar__logo {
  font-family: var(--font-logo);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.menubar__menus { display: flex; gap: 4px; }
.menu-item {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  color: var(--ink);
}
.menu-item:hover { background: var(--black); color: var(--paper); }

.menubar__right {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

/* --- Dropdown menus --- */
.menu { position: relative; }
.menu-trigger { cursor: pointer; }
.menubar__logo.menu-trigger { padding: 0; }
.menu.open > .menu-item { background: var(--black); color: var(--paper); }
.menu--app.open .menubar__logo { color: var(--orange); }
.menu-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: var(--z-dropdown);
  display: none;
  min-width: 214px;
  padding: 5px;
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow-hard);
}
.menu.open .menu-dropdown { display: block; }
.menu-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
}
.menu-opt:hover { background: var(--black); color: var(--paper); }
.menu-opt__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--gray-3);
}
.menu-opt:hover .menu-opt__sub { color: var(--gray-2); }
.menu-opt__note { color: var(--orange); font-size: 10px; }
.menu-sep { height: 1px; background: var(--gray-1); margin: 5px 8px; }

/* --- Desktop surface --- */
.desktop-surface { position: absolute; inset: 30px 0 0 0; }

/* --- Classic window --- */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow-hard);
  min-width: 260px;
}
.win__bar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border-bottom: var(--line);
  cursor: grab;
  user-select: none;
}
.win__bar:active { cursor: grabbing; }
.win__close {
  width: 13px; height: 13px;
  border: var(--line);
  background: var(--paper);
  flex: none;
}
.win__close:hover { background: var(--orange); }
.win__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 10px;
  background: var(--paper);
  z-index: 1;
}
/* pinstripe fill behind title */
.win__lines {
  position: absolute;
  inset: 5px 8px 5px 8px;
  background: repeating-linear-gradient(
    var(--black) 0 1px, transparent 1px 3px);
  opacity: 0.55;
  z-index: 0;
}
.win__title, .win__close { position: relative; z-index: 2; }

.win__body { padding: 22px 22px 24px; overflow-y: auto; min-height: 0; }
.win__body .brand { font-size: 40px; }
.win__body .tag { margin-bottom: 16px; }
.copy {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 42ch;
}
.win__meta { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border: var(--line);
  border-radius: 20px;
  color: inherit;
  text-decoration: none;
}
a.chip { transition: transform 0.12s; }
a.chip:hover { transform: translateY(-1px); }
.chip--accent { background: var(--orange); color: var(--paper); border-color: var(--orange); }

/* primary contact button (opens the mail composer) */
.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 16px;
  border: var(--line);
  border-radius: 22px;
  background: var(--orange);
  border-color: var(--orange);
  color: var(--paper);
  text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.btn-contact:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* project window extras */
.win__body .proj-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}
.win__icon {
  width: 56px; height: 56px; margin-bottom: 14px;
  display: grid; place-items: center;
  border: var(--line);
  overflow: hidden;
}
.win__icon svg { width: 32px; height: 32px; }

/* real image icons, full-bleed in any tile container */
.ios-app__icon--img, .sheet__icon--img, .dock__tile--img { padding: 0; }
.win__icon img, .ios-app__icon img, .sheet__icon img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* project feature list + contact (window + sheet) */
.proj-features {
  list-style: none;
  margin: 16px 0 2px;
  display: grid;
  gap: 9px;
}
.proj-features li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.proj-features li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 6px; height: 6px;
  background: var(--orange);
}
.feat__t { font-weight: 600; }
.proj-contact {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gray-3);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-2);
}
.proj-contact:hover { color: var(--orange); border-color: var(--orange); }
.sheet__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.sheet__meta .sheet__status { margin-top: 0; }
.sheet__status--accent {
  background: var(--orange);
  color: var(--paper);
  border-color: var(--orange);
  text-decoration: none;
}

/* --- Dock (frosted glass) --- */
.dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 26px;
  background: rgba(250,249,246,0.3);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    0 18px 44px -10px rgba(24,18,12,0.34),
    0 2px 8px -2px rgba(24,18,12,0.16),
    inset 0 1px 1px rgba(255,255,255,0.9),
    inset 0 -1px 2px rgba(0,0,0,0.05);
  backdrop-filter: blur(30px) saturate(1.9);
  -webkit-backdrop-filter: blur(30px) saturate(1.9);
}
/* top specular sheen */
.dock::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 26px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.5) 0%,
    rgba(255,255,255,0.06) 44%,
    rgba(255,255,255,0) 62%);
}
/* faint inner rim light */
.dock::after {
  content: "";
  position: absolute; inset: 1px;
  border-radius: 25px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.dock__item {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
}

/* the icon tile */
.dock__tile {
  width: 54px; height: 54px;
  border-radius: 14px;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--orange);
  border: 1.5px solid var(--black);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 9px -3px rgba(20,15,10,0.4);
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1), filter 0.18s;
  /* promote to its own GPU layer so the SVG-glyph tiles don't re-rasterize
     (and shimmer) sub-pixel while lifting over the dock's backdrop blur */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.dock__item--mono .dock__tile { background: var(--paper); }
.dock__tile svg { width: 30px; height: 30px; color: var(--paper); }
.dock__item--mono .dock__tile svg { color: var(--black); }

/* studio "home" tile — off-white with orange Garamond wordmark */

/* studio "home" wordmark tiles on iOS (dock icon + About sheet) */

/* dock divider between studio home and the projects */
.dock__divider {
  align-self: center;
  width: 1.5px;
  height: 44px;
  margin: 0 3px;
  background: rgba(11,11,12,0.22);
  border-radius: 1px;
}
.dock__tile--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* real image icons carry their own shape + shadow — strip the tile chrome */
.dock__tile--img, .ios-app__icon--img, .sheet__icon--img {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.dock__item:hover .dock__tile { transform: translate3d(0, -6px, 0); filter: brightness(1.05); }

/* reflections removed for the clean glass look */
.dock__reflect { display: none; }

/* click bounce */
@keyframes dockBounce {
  0%   { transform: translate3d(0, -5px, 0); }
  28%  { transform: translate3d(0, -18px, 0); }
  55%  { transform: translate3d(0, 0, 0); }
  75%  { transform: translate3d(0, -7px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.dock__tile.is-bouncing { animation: dockBounce 0.55s ease; }

/* dock tooltip */
.dock__label {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  background: var(--black);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}
.dock__item:hover .dock__label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   4. MOBILE — iOS home screen
   ============================================================ */
#mobile {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(140% 100% at 50% -10%, #ffffff 0%, var(--white) 45%, #e8e6e1 100%);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
@media (max-width: 899px) {
  #mobile { display: flex; }
}
#mobile::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0;
}

/* status bar */
.ios-status {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 26px;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 14px;
}
.ios-status__icons { display: flex; align-items: center; gap: 6px; }
.ios-ic { height: 12px; width: auto; fill: var(--black); color: var(--black); }

/* home area */
.ios-home {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column;
  padding: 8px 26px 0;
  min-height: 0;
}
.ios-hero { text-align: center; padding: 26px 0 30px; }

/* when there are no grid apps (all pinned to the dock), center the hero */
.ios-home.is-empty { justify-content: center; padding-bottom: 40px; }
.ios-home.is-empty .ios-hero { padding: 0; }
.brand--ios { font-size: 46px; }
.tag--ios { margin-top: 12px; }

.ios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 14px;
  align-content: start;
  padding-top: 6px;
}

.ios-app { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.ios-app__icon {
  width: 58px; height: 58px;
  border-radius: 30%; /* squircle-ish */
  display: grid; place-items: center;
  background: var(--paper);
  border: var(--line);
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  transition: transform 0.12s;
  overflow: hidden;
}
.ios-app:active .ios-app__icon { transform: scale(0.9); }
.ios-app__icon svg { width: 30px; height: 30px; color: var(--black); }
.ios-app__icon--accent { background: var(--orange); }
.ios-app__icon--accent svg { color: var(--paper); }
.ios-app__label {
  font-family: var(--font-ui);
  font-size: 11.5px; font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* iOS dock */
.ios-dock {
  position: relative; z-index: 2;
  margin: 14px 14px calc(14px + env(safe-area-inset-bottom));
  padding: 14px 18px;
  display: flex; justify-content: center; gap: 30px;
  background: rgba(251,250,248,0.55);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: var(--line);
  border-radius: var(--radius-ios);
}
.ios-dock .ios-app__label { display: none; }

/* ============================================================
   5. Sheet (mobile app detail)
   ============================================================ */
.sheet {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: none;
}
.sheet.is-open { display: block; }
.sheet__scrim {
  position: absolute; inset: 0;
  background: rgba(11,11,12,0.35);
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: var(--line);
  border-radius: 22px 22px 0 0;
  padding: 10px 26px calc(30px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.2,.9,.2,1);
  max-height: 82vh; overflow: auto;
}
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__grab {
  width: 40px; height: 5px; border-radius: 3px;
  background: var(--gray-2);
  margin: 0 auto 20px;
}
.sheet__icon {
  width: 72px; height: 72px; border-radius: 30%;
  display: grid; place-items: center;
  border: var(--line); background: var(--paper);
  margin-bottom: 16px;
  overflow: hidden;
}
.sheet__icon--accent { background: var(--orange); }
.sheet__icon--accent svg { color: var(--paper); }
.sheet__icon svg { width: 38px; height: 38px; }
.sheet__name { font-family: var(--font-ui); font-size: 26px; font-weight: 700; }
.sheet__tagline {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--orange); margin: 6px 0 16px;
}
.sheet__about { font-size: 15px; line-height: 1.6; color: var(--ink); }
.sheet__status {
  display: inline-block; margin-top: 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  padding: 5px 12px; border: var(--line); border-radius: 20px;
}

/* ============================================================
   6. DARK THEME — component surfaces that hardcode colours.
   The token flip lives in css/design-system.css (html.theme-dark);
   the rules below only cover surfaces the tokens can't reach
   (frosted glass, gradients, backdrops).
   ============================================================ */

/* backdrops — dark vignette; the grid flips via --grid-line */
html.theme-dark #desktop {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(120% 120% at 100% 0%, #20202b 0%, var(--white) 46%, #060608 100%);
}
html.theme-dark #mobile {
  background: radial-gradient(140% 100% at 50% -10%, #20202b 0%, var(--white) 45%, #060608 100%);
}

/* frosted docks → dark glass */
html.theme-dark .dock {
  background: rgba(26,26,32,0.42);
  border-color: rgba(255,255,255,0.14);
  box-shadow:
    0 18px 44px -10px rgba(0,0,0,0.6),
    0 2px 8px -2px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.10),
    inset 0 -1px 2px rgba(0,0,0,0.35);
}
html.theme-dark .dock::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 44%, rgba(255,255,255,0) 62%);
}
html.theme-dark .dock::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
html.theme-dark .ios-dock {
  background: rgba(26,26,32,0.5);
  border-color: rgba(255,255,255,0.14);
}

/* studio "home" wordmark tiles → dark surface (orange text stays) */
html.theme-dark .dock__divider { background: rgba(255,255,255,0.18); }

/* ============================================================
   7. LOGO FX — the wordmark draws itself on/off in a loop.
   Centered on the desktop, behind the windows and non-interactive.

   The real wordmark (Garamond "Anathema" + Grotesk "Labs") is drawn
   to an offscreen canvas and used as a MASK: a fine grid of small
   ascii characters fills only the cells that land inside the letter
   shapes, inheriting the sampled colour. Characters scramble on
   left-to-right, hold, then scramble off — see js/logofx.js.
   ============================================================ */
.logo-fx {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);     /* behind windows (which start at z 10) */
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;       /* never blocks dragging the desktop */
  user-select: none;
  padding: 0 5vw;
}
.logo-fx__canvas {
  display: block;
  max-width: 90vw;
  height: auto;
}

/* ============================================================
   8. ETHEREAL — monochrome-iPod music player.

   A self-contained "device": a brushed silver body (space-gray in
   dark mode) with a backlit grey LCD that stays lit in both themes,
   and a click wheel. Orange (the brand accent) is the ONLY colour —
   used for the menu selection bar, the now-playing marker, and the
   scrubber fill. Rendered inside a desktop window body OR the iOS
   sheet, both of which get a padding-free "player" variant.
   ============================================================ */
.sheet__content--player {
  padding: 20px 18px 24px;
  display: flex;
  justify-content: center;
}
.sheet__content--player { padding-bottom: 8px; }

.ipod {
  --pod-body-1: #f3f3f5;
  --pod-body-2: #cfcfd4;
  --pod-body-edge: #a9a9b0;
  --pod-lcd-1: #ffffff;   /* clean white LCD, top */
  --pod-lcd-2: #fafafa;   /* LCD, bottom */
  --pod-lcd-ink: #0b0b0c; /* black foreground text */
  --pod-lcd-dim: #6b6b70; /* muted grey for secondary labels */
  --pod-wheel-1: #ececef;
  --pod-wheel-2: #d3d3d8;
  --pod-key: #6a6a72;
  /* iPod-only type: a clean sans for content, a high-tech mono for LCD chrome */
  --pod-font-sans: "Inter", -apple-system, system-ui, sans-serif;
  --pod-font-mono: "Share Tech Mono", ui-monospace, "SF Mono", monospace;
  width: 248px;
  max-width: 100%;
  padding: 22px 20px 24px;
  border-radius: 34px;
  background: linear-gradient(160deg, var(--pod-body-1), var(--pod-body-2));
  border: 1px solid var(--pod-body-edge);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.9),
    inset 0 -2px 6px rgba(0,0,0,0.12),
    0 10px 26px -8px rgba(0,0,0,0.4);
  outline: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* --- screen --- */
.ipod__screen {
  height: 196px;
  border-radius: 5px;
  padding: 0;
  background: linear-gradient(180deg, var(--pod-lcd-1), var(--pod-lcd-2));
  border: 1px solid rgba(0,0,0,0.28);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.28),
    inset 0 2px 6px rgba(0,0,0,0.16);
  color: var(--pod-lcd-ink);
  font-family: var(--pod-font-sans);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* brushed-silver status strip flush across the top of the screen */
.ipod__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 4px 9px;
  border-bottom: 1px solid rgba(0,0,0,0.3);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.35) 0 1px, rgba(0,0,0,0.03) 1px 2px),
    linear-gradient(180deg, #f7f7f9 0%, #e4e4e9 46%, #cfcfd6 54%, #dcdce1 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  color: #2c2c33;
  font-family: var(--pod-font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ipod__bar-title { font-weight: 600; }
/* play/pause status glyph — sits inline before "Now Playing" in the now view */
.ipod__status { display: none; align-items: center; line-height: 0; }
.ipod__status svg { display: block; }
.ipod[data-mode="now"] .ipod__status { display: inline-flex; }
.ipod__stage { position: relative; flex: 1; min-height: 0; }

/* --- menu (track list) view --- */
.ipod__menu { position: absolute; inset: 0; overflow-y: auto; }
.ipod[data-mode="now"] .ipod__menu { display: none; }
.ipod__list { list-style: none; margin: 0; padding: 0; }
.ipod__row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 9px;
  font-size: 12px;
  line-height: 1.25;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
}
.ipod__row-t {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ipod__row-caret { flex: none; font-size: 12px; opacity: 0.5; }
.ipod__row.is-sel {
  background: linear-gradient(180deg, #ff7a30, var(--orange));
  color: #fff;
  border-bottom-color: transparent;
}
.ipod__row.is-sel .ipod__row-caret { opacity: 0.85; }
.ipod__msg {
  padding: 22px 14px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--pod-lcd-dim);
}

/* --- now-playing view --- */
.ipod__now {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 14px 12px;
}
.ipod[data-mode="now"] .ipod__now { display: flex; }
.ipod__now-count {
  font-family: var(--pod-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pod-lcd-dim);
  margin-bottom: 8px;
}
.ipod__art {
  position: relative;
  width: 74px; height: 74px;
  display: grid; place-items: center;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  color: var(--pod-lcd-dim);
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.14);
}
.ipod.is-playing .ipod__art { color: var(--orange); }
.ipod__art-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.ipod__art.has-art .ipod__art-img { display: block; }
.ipod__art.has-art .ipod__art-ph { display: none; }
.ipod__now-title,
.ipod__now-artist {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}
.ipod__now-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.ipod__now-artist { font-size: 11px; color: var(--pod-lcd-dim); margin-top: 3px; }
/* marquee inner: scrolls only when the text is wider than the screen */
.ipod__marq { display: inline-block; white-space: nowrap; will-change: transform; }
.ipod__now-title.is-scroll .ipod__marq,
.ipod__now-artist.is-scroll .ipod__marq {
  animation: ipodMarq var(--marq-dur, 8s) ease-in-out infinite;
}
@keyframes ipodMarq {
  0%, 12%   { transform: translateX(0); }
  48%, 60%  { transform: translateX(var(--marq-shift, 0)); }
  96%, 100% { transform: translateX(0); }
}
.ipod__scrub {
  display: flex; align-items: center; gap: 6px;
  width: 100%; margin-top: auto;
  font-family: var(--pod-font-mono); font-size: 10px; color: var(--pod-lcd-dim);
}
.ipod__track {
  flex: 1; height: 5px; border-radius: 3px;
  background: rgba(0,0,0,0.16);
  overflow: hidden;
}
.ipod__fill {
  display: block; height: 100%; width: 0;
  background: var(--orange);
  transition: width 0.25s linear;
}

/* --- click wheel --- */
.ipod__wheel {
  position: relative;
  width: 168px; height: 168px;
  margin: 22px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--pod-wheel-1), var(--pod-wheel-2));
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.8),
    inset 0 -3px 6px rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.12);
  touch-action: none;
}
.ipod__key {
  position: absolute;
  color: var(--pod-key);
  font-family: var(--pod-font-mono);
  font-size: 11px; font-weight: 400; letter-spacing: 0.12em;
  display: grid; place-items: center;
  cursor: pointer;
  transition: color 0.12s, transform 0.08s;
}
.ipod__key:hover { color: var(--orange); }
.ipod__key:active { transform: scale(0.88); }
.ipod__key--menu { top: 12px; left: 50%; transform: translateX(-50%); font-weight: 600; }
.ipod__key--menu:active { transform: translateX(-50%) scale(0.88); }
.ipod__key--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.ipod__key--prev:active { transform: translateY(-50%) scale(0.88); }
.ipod__key--next { right: 14px; top: 50%; transform: translateY(-50%); }
.ipod__key--next:active { transform: translateY(-50%) scale(0.88); }
.ipod__key--play { bottom: 12px; left: 50%; transform: translateX(-50%); }
.ipod__key--play:active { transform: translateX(-50%) scale(0.88); }
.ipod__center {
  position: absolute;
  top: 50%; left: 50%;
  width: 62px; height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fafafb, #dededf);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.9),
    inset 0 -2px 4px rgba(0,0,0,0.12),
    0 1px 3px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.08s;
}
.ipod__center:active { transform: scale(0.94); }

/* --- dark mode: space-gray chassis, LCD stays lit --- */
html.theme-dark .ipod {
  --pod-body-1: #34343a;
  --pod-body-2: #17171b;
  --pod-body-edge: #000;
  --pod-wheel-1: #3a3a41;
  --pod-wheel-2: #232328;
  --pod-key: #b9b9c0;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.14),
    inset 0 -2px 6px rgba(0,0,0,0.5),
    0 12px 30px -8px rgba(0,0,0,0.7);
}
html.theme-dark .ipod__center {
  background: radial-gradient(circle at 50% 40%, #46464d, #26262b);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 1px 3px rgba(0,0,0,0.5);
}

/* --- standalone float: the iPod lives directly on the desktop, no window
   frame. Grab the chassis to drag; screen + wheel stay interactive. --- */
.ipod-float {
  position: absolute;
  z-index: var(--z-window);
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.ipod-float:active { cursor: grabbing; }
.ipod-float .ipod { margin: 0; }
.ipod-float .ipod__screen,
.ipod-float .ipod__wheel { cursor: default; }
/* a classic window title bar (close + title + pinstripes), detached and
   floating just above the device. The .win__bar/.win__close/.win__title/
   .win__lines classes supply the shared window look; these rules make it a
   self-contained, bordered strip with a gap below it. */
.ipod-float__bar {
  margin-bottom: 9px;
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow-hard);
}

/* ============================================================
   9. SPECTRA — music visualizer (reacts to Ethereal's playback)

   A dark "scope" screen: a synthesised, beat-driven orange spectrum
   with peak-hold caps and a mono readout. Dark in both themes, like a
   piece of studio gear. Rendered in a window body OR the iOS sheet.
   ============================================================ */
.win__body--viz, .sheet__content--viz { padding: 0; overflow: hidden; }
.viz { display: block; background: #0b0c0e; }
.viz__canvas { display: block; width: 100%; height: 230px; }
.sheet__content--viz .viz__canvas { height: 200px; }
.viz__readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 13px;
  background: #0b0c0e;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--pod-font-mono, var(--font-mono));
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #efece6;
}
.viz__mode {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--orange);
}
.viz__next {
  flex: none;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #efece6;
  padding: 3px 9px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.viz__next:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
