/* ===== Custom cursor — boxing glove, everywhere (incl. over links/buttons,
   overriding reset.css's plain "pointer") ===== */
html,
body {
  cursor: url("../assets/cursor-glove.png") 5 5, auto;
}

a,
button,
[role="button"],
.app-icon,
label {
  cursor: url("../assets/cursor-glove.png") 5 5, pointer;
}

/* While a click is held down (see js/cursor.js), swap to the "punching"
   variant — a plain CSS cursor can't animate itself, so this class toggle
   is what makes the glove actually react on click. */
html.is-punching,
html.is-punching body,
html.is-punching a,
html.is-punching button,
html.is-punching [role="button"],
html.is-punching .app-icon,
html.is-punching label {
  cursor: url("../assets/cursor-glove-punch.png") 8 8, pointer;
}

/* ===== Page loader — a brief branded splash while the wallpaper/icons
   finish loading (see initPageLoader() in js/main.js) ===== */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#pageLoader img {
  width: min(280px, 60vw);
  height: auto;
}

#pageLoader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===== Wallpaper ===== */
#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #0855e3;
  background-image: url("../assets/images/wallpaper.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== Shells ===== */
.shell {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.shell--desktop {
  display: flex;
  flex-direction: column;
}

/* ===== Menu bar (macOS) ===== */
.menubar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

.menubar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 6px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  font-size: 20px;
  font-weight: 600;
}

.menubar__brand:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Desktop icons ===== */
/* Contact pinned under the name, everyone else as a centered row (per the
   updated brief — was a right-side vertical rail before). */
.desktop-icons {
  position: relative;
  flex: 1 1 auto;
}

.desktop-icon--pinned {
  position: absolute;
  top: 32px;
  left: 32px;
}

.desktop-icons__rail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 52px;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  /* This box spans the whole area (to center its icons) and overlaps the
     pinned Contact icon in the corner — without this it would sit on top
     and swallow clicks meant for Contact. Icons opt back in below. */
  pointer-events: none;
}

.desktop-icons__rail > * {
  pointer-events: auto;
}

/* ===== App icon component (shared between desktop / mobile) ===== */
.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 138px;
}

.app-icon__glyph {
  position: relative;
  width: var(--icon-size-desktop);
  height: var(--icon-size-desktop);
  /* No shadow — it read as a visible dark square behind every icon. */
  transition: transform 0.18s var(--ease-out-soft);
}

/* The rounding/clip lives on this inner wrapper instead of .app-icon__glyph
   itself, so the notification badge (a sibling, see below) can sit on top
   of the icon's corner without getting clipped by it. */
.app-icon__glyph-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--icon-radius);
  overflow: hidden;
  /* Transparent, per the brief — wherever a cutout icon has transparent
     pixels (rounded corners, edges), the black wallpaper shows through
     rather than a colored fallback tile. */
  background: transparent;
}

.app-icon__glyph-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* iOS-style notification badge — project/item count for apps with several
   (Storyboard, Fashion, Editorial, Video, Illustration); see badgeCount() in
   render.js. Plain red circle, white number — no ring, like Apple's own. */
.app-icon__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Video/Contact/Fashion: these three source photos aren't naturally square,
   so cropping them to a same-size square tile like the others cuts into the
   image. Widened instead of enlarged — height stays equal to every other
   icon's (so labels across the row still line up), only width grows. */
.app-icon[data-app-id="video"] .app-icon__glyph,
.app-icon[data-app-id="contact"] .app-icon__glyph,
.app-icon[data-app-id="fashion"] .app-icon__glyph {
  width: calc(var(--icon-size-desktop) * 150 / 116);
  height: var(--icon-size-desktop);
}

.app-icon:hover .app-icon__glyph {
  transform: translateY(-3px) scale(1.18);
}

.app-icon:active .app-icon__glyph,
.app-icon.is-launching .app-icon__glyph {
  transform: scale(0.88);
}

.app-icon__label {
  letter-spacing: 0.01em;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 1023px) {
  .shell--desktop {
    display: none;
  }
}
