/* Macintosh-inspired styles — System 7/8 vibe */

:root {
  /* Black Macintosh theme */
  --desktop: #000000;
  --desktop-dark: #0a0a0a;
  --paper: #0b0b0b;
  --ink: #ffffff;
  --ui: #121212;
  --ui-dark: #1a1a1a;
  --border-dark: #e6e6e6;
  --border-mid: #5a5a5a;
  --border-light: #0a0a0a;
  --shadow: rgba(0, 0, 0, 0.55);
  --link: #ffffff;
  /* Retro Apple font (Chicago, Geneva, Charcoal — classic Mac system fonts) */
  --font-retro: Chicago, Charcoal, Geneva, 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --font-ui: var(--font-retro);
  /* Classic Mac OS / Terminal-ish monospace stack */
  --font-mono: Monaco, Geneva, 'Lucida Console', 'Courier New', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Font for 00's (collection numbers, prices) — keep non-retro */
  --font-00s: Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--desktop) url("assets/background.png") center / cover no-repeat fixed;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* CRT overlay — covers entire viewport */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}

.crt-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Scanlines — lighter, more subtle */
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  opacity: 0.6;
}

.crt-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Lighter vignette + subtle glow to boost vibrancy */
  box-shadow: inset 0 0 80px 20px rgba(0, 0, 0, 0.25),
              inset 0 0 140px 40px rgba(0, 0, 0, 0.15),
              0 0 60px rgba(100, 150, 255, 0.03);
  border: 6px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
}

/* Gate visibility */
#site[aria-hidden="true"] {
  display: none;
}

.gate {
  position: fixed;
  inset: calc(52px + env(safe-area-inset-top, 0px)) 0 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 2200;
}

.gate.hidden {
  display: none;
}

.gate-window {
  width: min(520px, calc(100vw - 32px));
}

.gate-kicker {
  font-size: 13px;
  margin-bottom: 10px;
}

.gate-equation {
  font-family: var(--font-mono);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  background: #0b0b0b;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.10), inset -1px -1px 0 rgba(0,0,0,0.65);
  margin-bottom: 12px;
}

.gate-eq {
  font-variant-numeric: tabular-nums;
}

.gate-form {
  display: grid;
  gap: 8px;
}

.gate-label {
  font-size: 13px;
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.gate-input {
  height: 30px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid var(--border-dark);
  background: #0b0b0b;
  color: var(--ink);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.65), inset -1px -1px 0 rgba(255,255,255,0.10);
}

.gate-input:focus {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.gate-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ui);
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-mid);
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.gate-btn:hover {
  background: #1a1a1a;
}

.gate-btn:active {
  transform: scale(0.97);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.4);
  background: #0a0a0a;
}

.gate-hint {
  font-size: 12px;
  color: #ffffff;
}

.gate-error {
  min-height: 16px;
  font-size: 12px;
  color: #7a0000;
}

/* Desktop + CRT texture */
.mac-desktop {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding-top: calc(52px + env(safe-area-inset-top, 0px)); /* menubar + icons height + notch */
}

.mac-desktop::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    /* lighter vignette — lets content feel more vibrant */
    radial-gradient(ellipse 85% 70% at 50% 45%, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.5) 100%);
  opacity: 1;
}

.mac-desktop::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      rgba(255, 255, 255, 0.00) 2px,
      rgba(255, 255, 255, 0.00) 4px
    );
  opacity: 0.18;
}

/* Intro overlay */
.intro {
  position: fixed;
  inset: 0;
  background: #000000;
  display: grid;
  place-items: center;
  z-index: 10000;
  cursor: pointer;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.intro.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.intro-logo {
  width: min(220px, 50vw);
  height: auto;
  object-fit: contain;
}

.intro-text {
  font-family: var(--font-ui);
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  animation: introBlink 1s steps(1, end) infinite;
}

.intro-date,
.intro-time,
.intro-countdown {
  position: absolute;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.intro-countdown {
  top: max(16px, env(safe-area-inset-top, 0px));
  left: max(18px, env(safe-area-inset-left, 0px));
}

.intro-date {
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(18px, env(safe-area-inset-right, 0px));
}

.intro-time {
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  right: max(18px, env(safe-area-inset-right, 0px));
}

@keyframes introBlink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mac-window--loader {
  width: min(520px, calc(100vw - 32px));
}

.loader-bar {
  width: 100%;
  height: 18px;
  border: 1px solid var(--ink);
  background: var(--ui-dark);
  padding: 2px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0;
  background-color: var(--loader-bar-color, var(--ink));
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.28) 0,
    rgba(0, 0, 0, 0.28) 4px,
    transparent 4px,
    transparent 8px
  );
}

.loader.is-active .loader-bar-fill {
  animation: loaderFill 0.9s ease-in-out forwards;
}

@keyframes loaderFill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Menubar */
.mac-menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
  background: var(--ui);
  color: var(--ink);
  z-index: 2000;
  border-bottom: 1px solid var(--border-mid);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.mac-menubar-left,
.mac-menubar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mac-menubar-right {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.menubar-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menubar-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menubar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  opacity: 0.9;
  transition: opacity 0.1s ease, transform 0.08s ease;
}

button.menubar-icon {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

.menubar-icon:hover {
  opacity: 1;
}

.menubar-icon:active {
  transform: scale(0.95);
}

.menubar-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.menubar-icon-img--invert {
  filter: invert(1);
}

.logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
}

.logo-img {
  display: block;
  height: 18px;
  width: auto;
  image-rendering: pixelated;
}

.logo:focus-visible {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 2px;
  transition: background 0.1s ease, transform 0.08s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.10);
}

.nav a:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.15);
}

.cart-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.08s ease;
}

.cart-btn:hover {
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.08);
}

.cart-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.12);
}

.cart-count {
  margin-left: 4px;
  font-family: var(--font-00s);
  font-size: 12px;
}

.mac-menubar-clock {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.1s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle:active {
  transform: scale(0.95);
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
}

/* Mac window components */
.mac-window {
  background: var(--paper);
  border: 1px solid var(--border-dark);
  box-shadow: 2px 2px 0 var(--shadow);
  position: relative;
}

.mac-window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.08),
    inset -1px -1px 0 rgba(0,0,0,0.65);
}

.mac-titlebar {
  height: 22px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  background: var(--ui);
  border-bottom: 1px solid var(--border-mid);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 0 6px;
}

.mac-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-control {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border-dark);
  background: var(--ui-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.10);
}

.mac-control--btn {
  cursor: pointer;
  transition: transform 0.08s ease, background 0.1s ease;
}

.mac-control--btn:hover {
  background: #252525;
}

.mac-control--btn:active {
  transform: scale(0.9);
  background: #0a0a0a;
}

.mac-title {
  font-size: 13px;
  text-align: center;
  font-weight: 700;
  user-select: none;
  font-family: var(--font-retro);
}

.mac-window-body {
  padding: 16px;
}

/* Layout */
.main {
  padding: 18px 14px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  padding: 18px 0 10px;
}

.mac-window--hero .mac-window-body {
  padding: 26px 18px;
  text-align: center;
  position: relative;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.sparkle {
  position: absolute;
  color: #ffffff;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85), 0 0 14px rgba(255, 255, 255, 0.45);
  animation: sparkleTwinkle 2.4s ease-in-out infinite;
}

@keyframes sparkleTwinkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle {
    animation: none;
    opacity: 0.85;
  }

  .hero-subtitle {
    animation: none;
  }
}

.hero-title {
  display: block;
  line-height: 0;
}

.hero-logo-img {
  display: block;
  width: min(1040px, 100%);
  height: auto;
  margin: 0 auto;
  transform: scaleX(1.14);
  transform-origin: center;
  mix-blend-mode: screen;
}

.hero-subtitle {
  position: relative;
  z-index: 2;
  margin-top: clamp(-80px, -7vw, -30px);
  font-size: 13px;
  letter-spacing: 0.06em;
  background-image: linear-gradient(
    100deg,
    #6e7480 0%,
    #c7ccd4 18%,
    #ffffff 32%,
    #aeb4be 46%,
    #7c828d 60%,
    #eef0f3 76%,
    #b9bec7 92%,
    #8a909b 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: liquidPlatinum 6s ease-in-out infinite;
}

@keyframes liquidPlatinum {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.scroll-indicator {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scroll-indicator span {
  font-size: 12px;
  color: #ffffff;
}

.scroll-line {
  width: 60px;
  height: 1px;
  background: #000;
  opacity: 0.6;
  animation: scroll-pulse 1.6s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.65; }
  50% { transform: scaleX(0.45); opacity: 0.35; }
}

.section {
  padding: 14px 0;
}

/* Media */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-item {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

.media-item.is-new .media-placeholder {
  animation: virus-flash 0.42s steps(2, end) infinite;
}

.media-item.is-new {
  animation: virus-shake 0.14s steps(2, end) infinite;
  transform-origin: 50% 50%;
}

.media-item.is-new::before {
  content: "NEW  NEW";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-retro);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-size: clamp(38px, 6.2vw, 96px);
  line-height: 1;
  color: #ffffff;
  text-shadow:
    1px 0 rgba(0,0,0,0.9),
    -1px 0 rgba(0,0,0,0.9),
    0 1px rgba(0,0,0,0.9),
    0 -1px rgba(0,0,0,0.9);
  z-index: 2;
  pointer-events: none;
  /* stretched + crunchy “bad jpeg” vibe */
  transform: scaleY(2.05) scaleX(0.82);
  transform-origin: 50% 50%;
  filter: contrast(1.35) saturate(0) blur(0.55px);
}

.media-item.is-new .media-placeholder::before {
  /* overlay macroblocks over “NEW NEW” like compression */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 3px, rgba(0,0,0,0) 3px 10px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.35) 0 2px, rgba(0,0,0,0) 2px 9px);
  mix-blend-mode: overlay;
  z-index: 1;
}

.media-item.is-new:hover::before,
.media-item.is-new:focus-visible::before,
.media-item.is-new:focus-visible::before {
  opacity: 0;
}

@keyframes virus-flash {
  0% { filter: contrast(1.05) brightness(1.0); }
  25% { filter: contrast(1.22) brightness(1.12); }
  50% { filter: contrast(1.10) brightness(1.04); }
  75% { filter: contrast(1.28) brightness(1.16); }
  100% { filter: contrast(1.05) brightness(1.0); }
}

@keyframes virus-shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

.media-placeholder {
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-dark);
  background: repeating-linear-gradient(
    45deg,
    #0f0f0f 0px,
    #0f0f0f 6px,
    #151515 6px,
    #151515 12px
  );
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.10), inset -1px -1px 0 rgba(0,0,0,0.65);
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}

.media-item[data-collection="001"] .media-placeholder {
  background: url("assets/collection-001.png") center / cover no-repeat;
}

.media-item[data-collection="001"] .media-placeholder span {
  text-shadow:
    2px 0 rgba(0,0,0,0.85),
    -2px 0 rgba(0,0,0,0.85),
    0 2px rgba(0,0,0,0.85),
    0 -2px rgba(0,0,0,0.85),
    0 0 18px rgba(0,0,0,0.6);
  filter: contrast(1.35) saturate(0) blur(0.2px);
}

.media-item[data-collection="001"] .media-placeholder::after {
  /* keep overlay subtle on image tile */
  mix-blend-mode: overlay;
}

.media-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background:
    /* blocky compression grid */
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0 1px, rgba(0,0,0,0) 1px 7px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.35) 0 1px, rgba(0,0,0,0) 1px 9px),
    /* a few darker macroblocks */
    linear-gradient(90deg, rgba(0,0,0,0) 0 32%, rgba(0,0,0,0.25) 32% 36%, rgba(0,0,0,0) 36% 100%),
    linear-gradient(0deg, rgba(0,0,0,0) 0 46%, rgba(0,0,0,0.22) 46% 52%, rgba(0,0,0,0) 52% 100%);
  mix-blend-mode: overlay;
}

.media-placeholder span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(2px) scaleY(1.75) scaleX(0.92);
  transform-origin: 50% 55%;
  transition: opacity 0.15s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
  font-family: var(--font-00s);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 140px);
  line-height: 1;
  /* crunchy artifacting */
  text-shadow:
    1px 0 rgba(255,255,255,0.18),
    -1px 0 rgba(0,0,0,0.55),
    0 1px rgba(0,0,0,0.45),
    0 -1px rgba(255,255,255,0.10),
    2px 1px rgba(0,0,0,0.25),
    -2px -1px rgba(255,255,255,0.06);
  filter: contrast(1.25) saturate(0) blur(0.25px);
  z-index: 1;
}

.media-item:hover .media-placeholder {
  filter: contrast(1.05);
}

.media-item:hover .media-placeholder span,
.media-item:focus-visible .media-placeholder span {
  opacity: 1;
  transform: translateY(0) scaleY(1.9) scaleX(0.92);
}

.media-item:hover .media-placeholder::after,
.media-item:focus-visible .media-placeholder::after {
  opacity: 0.55;
}

/* Modal */
.mac-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.mac-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.mac-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 2700;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.mac-modal.visible {
  opacity: 1;
  visibility: visible;
}

.mac-window--modal {
  width: min(420px, calc(100vw - 32px));
}

.modal-text {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-playlists {
  font-size: 13px;
  margin-bottom: 8px;
}

.playlist-links {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.playlist-links a {
  color: var(--link);
  text-decoration: underline;
  font-size: 13px;
}

.playlist-links a {
  transition: opacity 0.1s ease, transform 0.08s ease;
}

.playlist-links a:hover {
  opacity: 0.9;
}

.playlist-links a:active {
  transform: scale(0.97);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-mid);
}

.tab {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--ui-dark);
  border: 1px solid var(--border-mid);
  border-bottom: none;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  cursor: pointer;
  position: relative;
  top: 1px;
  opacity: 0.65;
  transition: opacity 0.1s ease, background 0.1s ease;
}

.tab:hover {
  opacity: 0.85;
}

.tab.is-active {
  background: var(--ui);
  border-color: var(--border-dark);
  opacity: 1;
}

.tab-panel.hidden {
  display: none;
}

/* Shop */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.10), inset -1px -1px 0 rgba(0,0,0,0.65);
  padding: 12px;
  background: #0f0f0f;
}

.product-card--flash {
  animation: virus-shake 0.14s steps(2, end) infinite;
  transform-origin: 50% 50%;
}

.product-card--archived .product-image {
  position: relative;
}

.archived-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.archived-overlay-svg {
  display: block;
  width: 92%;
  height: 92%;
}

.archived-overlay-svg text {
  fill: #ffffff;
  font-family: var(--font-retro);
  font-weight: 700;
  font-size: 78px;
}

.product-card--archived:hover .archived-overlay,
.product-card--archived:focus-within .archived-overlay {
  opacity: 1;
}

.product-card--flash .product-image {
  animation: virus-flash 0.42s steps(2, end) infinite;
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border-dark);
  background-color: #0b0b0b;
  background-image: url('assets/hero-logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 78%;
  background-blend-mode: screen;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  margin-bottom: 10px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.10), inset -1px -1px 0 rgba(0,0,0,0.65);
}

.product-image:has(.product-photo) {
  background-image: none;
}

.quick-add {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ui);
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-mid);
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background 0.08s ease;
}

.quick-add:hover {
  background: #1a1a1a;
}

.product-card--flash:hover .quick-add,
.product-card--flash:focus-within .quick-add {
  opacity: 1;
  pointer-events: auto;
}

.product-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image--black {
  background-color: #1a1a1a;
}

.product-image--gray {
  background-color: #4a4a4a;
}

.product-card h3 {
  font-size: 13px;
  margin-bottom: 6px;
}

.price {
  font-family: var(--font-00s);
  font-size: 12px;
  color: #ffffff;
  margin-bottom: 10px;
}

body.prices-hidden .price {
  display: none;
}

body.prices-hidden #panelItems .product-card h3 {
  display: none;
}

/* Retro price toggle switch */
.price-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tabs .price-switch {
  margin-left: auto;
  align-self: center;
  margin-bottom: 4px;
}

.price-switch-icon {
  order: -1;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.psw-icon {
  width: 16px;
  height: 16px;
}

.price-switch-icon .icon-info {
  display: none;
}

.price-switch-input:checked ~ .price-switch-icon .icon-info {
  display: inline-block;
}

.price-switch-input:checked ~ .price-switch-icon .icon-tshirt {
  display: none;
}

.price-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.price-switch-track {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 22px;
  background: linear-gradient(#2c2c2c, #141414);
  border: 1px solid #000000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12), inset -1px -2px 3px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.price-switch-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 21px;
  height: 18px;
  background: linear-gradient(#ededed, #9c9c9c);
  border: 1px solid #000000;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -2px 2px rgba(0, 0, 0, 0.4);
  transition: left 0.1s steps(2, end);
}

.price-switch-knob::after {
  content: "";
  position: absolute;
  inset: 3px 5px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0 1px, transparent 1px 3px);
}

.price-switch-input:checked + .price-switch-track {
  background: linear-gradient(#1f3a1f, #0f240f);
}

.price-switch-input:checked + .price-switch-track .price-switch-knob {
  left: 23px;
}

.price-switch-input:focus-visible + .price-switch-track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.colorway {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.colorway-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25), inset -1px -1px 0 rgba(0, 0, 0, 0.55);
}

.colorway-swatch--camo {
  background-color: #2f3327;
  background-image:
    radial-gradient(circle at 22% 28%, #444c35 0 30%, transparent 31%),
    radial-gradient(circle at 72% 22%, #1c2015 0 28%, transparent 29%),
    radial-gradient(circle at 38% 72%, #525a3d 0 26%, transparent 27%),
    radial-gradient(circle at 82% 78%, #141710 0 30%, transparent 31%);
}

.add-to-cart,
.checkout-btn,
.view-item,
.product-add {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ui);
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-mid);
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.view-item {
  display: block;
  text-align: center;
  text-decoration: none;
}

.add-to-cart:hover,
.checkout-btn:hover,
.view-item:hover,
.product-add:hover {
  background: #1a1a1a;
}

.add-to-cart:active,
.checkout-btn:active,
.view-item:active,
.product-add:active {
  transform: scale(0.97);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.4);
  background: #0a0a0a;
}

/* Floating quick-checkout widget */
.cart-widget {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  background: var(--ui);
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-mid), 0 6px 18px rgba(0,0,0,0.45);
  animation: cart-widget-in 0.18s ease;
}

.cart-widget[hidden] {
  display: none;
}

.cart-widget--bump {
  animation: cart-widget-bump 0.3s ease;
}

.cart-widget-bag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ui-dark);
  color: #ffffff;
  border: 1px solid var(--border-mid);
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
}

.cart-widget-bag:hover {
  background: #242424;
}

.cart-widget-bag-icon {
  font-size: 15px;
  line-height: 1;
}

.cart-widget-count {
  font-family: var(--font-00s);
  font-size: 12px;
  min-width: 16px;
  text-align: center;
}

.cart-widget-checkout {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ui);
  border: 1px solid var(--border-dark);
  box-shadow: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-mid);
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.08s ease;
}

.cart-widget-checkout:hover {
  background: #1a1a1a;
}

.cart-widget-checkout:active {
  transform: scale(0.97);
  background: #0a0a0a;
}

@keyframes cart-widget-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cart-widget-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Size picker */
.size-modal-product {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.size-modal-hint {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 14px;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-option {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ui-dark);
  border: 1px solid var(--border-mid);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 42px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.08s ease, transform 0.08s ease;
}

.size-option:hover {
  background: var(--ui);
}

.size-option:active {
  transform: scale(0.96);
}

.size-option.is-selected {
  background: var(--ink);
  color: #000000;
  border-color: var(--border-dark);
}

/* Product detail page */
.product-detail-section {
  padding-top: 90px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--link);
  text-decoration: underline;
  font-size: 13px;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.product-detail-image {
  width: 100%;
}

.product-detail-name {
  font-size: 18px;
  margin-bottom: 8px;
}

.size-select {
  margin: 6px 0 16px;
}

.size-select-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 8px;
}

.product-add {
  width: 100%;
}

.product-detail-msg {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
}

@media (max-width: 640px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.shop-all {
  display: inline-block;
  margin-top: 10px;
  color: var(--link);
  text-decoration: underline;
  font-size: 13px;
}

/* Discount challenge */
.hidden {
  display: none !important;
}

.discount-content {
  max-width: 400px;
}

.quiz-start {
  padding: 6px 0;
}

.quiz-start-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quiz-btn,
.radio-btn {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  padding: 8px 16px;
}

.quiz-no-attempt-msg {
  font-size: 13px;
  color: #ffffff;
  margin-top: 8px;
}

.quiz-no-attempt-msg.hidden {
  display: none !important;
}

.discount-puzzle {
  display: grid;
  gap: 10px;
}

.discount-equation {
  font-family: var(--font-mono);
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-dark);
  background: var(--ui);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.65), inset -1px -1px 0 rgba(255,255,255,0.10);
}

.discount-eq {
  font-variant-numeric: tabular-nums;
}

.discount-timer {
  font-family: var(--font-00s);
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
}

.discount-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.discount-input {
  flex: 1;
  height: 30px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid var(--border-dark);
  background: #0b0b0b;
  color: var(--ink);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.65), inset -1px -1px 0 rgba(255,255,255,0.10);
}

.discount-input:focus {
  outline: 2px dotted #000;
  outline-offset: 2px;
}

.discount-message {
  min-height: 18px;
  font-size: 12px;
  color: #7a0000;
}

.discount-message.success {
  color: #0a7a0a;
}

.discount-success {
  padding: 6px 0;
}

.discount-success-text {
  font-size: 13px;
  color: #ffffff;
}

.discount-success-code {
  margin-top: 6px;
  font-size: 13px;
  color: #ffffff;
}

.discount-success-code span {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--link);
}

.discount-success-note {
  margin-top: 2px;
  font-size: 11px;
  color: #9a9a9a;
}

/* Cart */
.cart-sidebar {
  position: fixed;
  top: 64px;
  right: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 52px);
  max-height: calc(100dvh - 52px);
  background: var(--paper);
  z-index: 3000;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.28s ease;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-window-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 52px - 22px);
  max-height: calc(100dvh - 52px - 22px);
}

.cart-items {
  overflow: auto;
  max-height: 45vh;
  max-height: 45dvh;
  padding-right: 4px;
}

.cart-empty {
  font-size: 13px;
  color: #ffffff;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dotted #555;
  font-size: 13px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-remove-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, background 0.1s ease;
}

.cart-remove-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cart-remove-btn:active {
  transform: scale(0.9);
  background: rgba(200, 80, 80, 0.3);
}

.cart-item-info h4 {
  font-size: 13px;
  margin-bottom: 4px;
}

.cart-item-info p {
  font-family: var(--font-00s);
  font-size: 12px;
  color: #ffffff;
}

.cart-footer {
  border-top: 1px solid rgba(242,242,242,0.25);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.cart-total {
  font-family: var(--font-00s);
  font-size: 12px;
  line-height: 1.6;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cart-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Footer */
.footer {
  max-width: 1100px;
  margin: 12px auto 24px;
  padding: 12px 14px;
  font-size: 12px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  color: var(--link);
  text-decoration: underline;
  font-size: 12px;
  transition: opacity 0.1s ease, transform 0.08s ease;
}

.footer-links a:hover {
  opacity: 0.9;
}

.footer-links a:active {
  transform: scale(0.97);
}

/* Mobile menu: turn menubar nav into overlay list */
@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav.open {
    display: grid;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--ui);
    border-bottom: 1px solid var(--border-mid);
    padding: 10px;
    gap: 6px;
    z-index: 2100;
  }

  .media-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

/* Hide the hamburger when there is no nav to toggle (e.g. landing page) */
header:not(:has(.nav)) .menu-toggle {
  display: none !important;
}

/* Touch devices: hover-only controls can't be hovered, so reveal them */
@media (hover: none) {
  .product-card--flash .quick-add {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Phone tweaks */
@media (max-width: 560px) {
  .mac-menubar {
    padding: 4px 8px;
  }

  .mac-menubar-clock {
    display: none;
  }

  .intro-countdown,
  .intro-date,
  .intro-time {
    font-size: 11px;
  }

  .intro-countdown,
  .intro-date {
    top: max(12px, env(safe-area-inset-top, 0px));
  }

  .intro-countdown {
    left: max(12px, env(safe-area-inset-left, 0px));
  }

  .intro-date {
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  .intro-time {
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  .intro-text {
    font-size: 15px;
    letter-spacing: 0.12em;
    text-align: center;
    padding: 0 16px;
  }

  .tabs .price-switch {
    margin-bottom: 6px;
  }

  .quiz-start-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-btn,
  .radio-btn {
    width: 100%;
  }

  .product-detail-section {
    padding-top: 80px;
  }
}
