/* =========================================================
   DANSEPLUS.CA — SHUFFLE EDITION
   Sister site to the iPod build. Same screen language,
   (PRODUCT)RED shuffle body, no menus.
   ========================================================= */

:root {
  /* anodized red body */
  --red-1:#ef4a44;
  --red-2:#cf1a2b;
  --red-3:#a30f1f;
  --red-4:#7a0a17;

  /* etched markings */
  --etch:rgba(255,255,255,.88);
  --etch-dim:rgba(255,255,255,.55);

  /* display, carried over from the iPod site */
  --screen:#fff;
  --blue-1:#8ab7ff;
  --blue-2:#2764c5;
  --blue-3:#17478f;
  --line:#dedede;
  --text:#0b0b0b;
  --muted:#6a6a6a;

  --mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  --ui:-apple-system,BlinkMacSystemFont,"Lucida Grande","Helvetica Neue",Arial,sans-serif;
}

* {
  box-sizing:border-box;
}

html,
body {
  min-height:100%;
}

body {
  margin:0;
  min-height:100svh;
  padding:18px 10px;
  overflow-x:hidden;
  display:grid;
  place-items:center;
  background:#000;
  color:#fff;
  font-family:var(--ui);
}

button {
  font:inherit;
}


/* =========================================================
   FULL-PAGE BACKGROUND VIDEO
   ========================================================= */

.site-background {
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:-3;
  pointer-events:none;
  background:#000;
  filter:brightness(.68) saturate(.9);
}

.site-background-overlay {
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:
    radial-gradient(
      circle at center,
      rgba(0,0,0,.02) 0%,
      rgba(0,0,0,.18) 62%,
      rgba(0,0,0,.45) 100%
    );
}


/* =========================================================
   SHELL
   ========================================================= */

.site-shell {
  width:100%;
  display:grid;
  place-items:center;
}

.shuffle-wrap {
  display:grid;
  justify-items:center;
  gap:10px;
}

.shuffle {
  width:min(310px,80vw);

  padding:0 16px 18px;

  position:relative;

  border:1px solid #6d0812;
  border-radius:16px;

  background:
    linear-gradient(
      152deg,
      var(--red-1) 0%,
      var(--red-2) 34%,
      var(--red-3) 74%,
      var(--red-4) 100%
    );

  box-shadow:
    0 30px 70px rgba(0,0,0,.66),
    0 4px 12px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -2px 6px rgba(0,0,0,.35);
}

.shuffle.is-off {
  filter:saturate(.82) brightness(.9);
}


/* =========================================================
   TOP EDGE — LED / SWITCH / VOICEOVER
   ========================================================= */

.top-edge {
  height:38px;

  margin:0 -16px 14px;
  padding:0 14px;

  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:10px;

  position:relative;
  z-index:2;

  border-radius:15px 15px 0 0;

  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,.2) 0%,
      rgba(0,0,0,.05) 46%,
      rgba(0,0,0,.28) 100%
    );

  border-bottom:1px solid rgba(0,0,0,.32);
}

/* headphone jack — on the top edge, where the real one is */

.jack-hole {
  width:9px;
  height:9px;

  border-radius:50%;

  background:radial-gradient(
    circle at 35% 30%,
    #3a3a3a 0%,
    #0c0c0c 70%
  );

  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.9),
    0 1px 0 rgba(255,255,255,.15);
}


/* status LED — small window that blinks green/amber */

.led {
  width:6px;
  height:6px;

  border-radius:50%;

  background:#4a0710;

  box-shadow:inset 0 1px 1px rgba(0,0,0,.7);
}

.led.is-play {
  background:#5dff8a;
  box-shadow:
    0 0 5px rgba(93,255,138,.9),
    0 0 10px rgba(93,255,138,.5);
}

.led.is-pause {
  background:#ffc24a;
  box-shadow:
    0 0 4px rgba(255,194,74,.85),
    0 0 9px rgba(255,194,74,.4);
}


/* three-position slider: off / play in order / shuffle,
   moulded white like the real switch */

.switch {
  width:80px;
  height:15px;

  justify-self:center;

  position:relative;

  display:grid;
  grid-template-columns:repeat(3,1fr);

  border-radius:8px;

  background:
    linear-gradient(
      to bottom,
      #d8d8d8 0%,
      #f4f4f4 12%,
      #fbfbfb 50%,
      #e6e6e6 100%
    );

  box-shadow:
    inset 0 1px 2px rgba(0,0,0,.35),
    0 1px 0 rgba(255,255,255,.2);
}

.switch-stop {
  height:100%;

  padding:0;

  position:relative;
  z-index:2;

  border:0;
  border-radius:8px;

  background:transparent;

  cursor:pointer;

  -webkit-tap-highlight-color:transparent;
}

/* etched icons: dot for off, bar for play-in-order, crossed
   arrows for shuffle — same three glyphs as the real switch */

.switch-stop::after {
  content:"";

  position:absolute;
  top:50%;
  left:50%;

  transform:translate(-50%,-50%);

  width:9px;
  height:1.5px;

  border-radius:1px;

  background:#8c8c8c;
}

.switch-stop[data-mode="off"]::after {
  width:6px;
  height:6px;

  border:1.3px solid #8c8c8c;
  border-radius:50%;

  background:transparent;
}

.switch-stop[data-mode="shuffle"]::before,
.switch-stop[data-mode="shuffle"]::after {
  content:"";

  position:absolute;
  top:50%;
  left:50%;

  width:9px;
  height:1.3px;

  border-radius:1px;

  background:#8c8c8c;
}

.switch-stop[data-mode="shuffle"]::before {
  transform:translate(-50%,-50%) rotate(24deg);
}

.switch-stop[data-mode="shuffle"]::after {
  transform:translate(-50%,-50%) rotate(-24deg);
}

.switch-knob {
  width:calc(33.333% - 3px);
  height:11px;

  position:absolute;
  top:2px;
  left:2px;

  z-index:1;

  border-radius:6px;

  background:var(--red-2);

  box-shadow:
    0 1px 2px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.4);

  transition:transform .14s ease-out;
}

.switch-knob[data-pos="order"] {
  transform:translateX(calc(100% + 3px));
}

.switch-knob[data-pos="shuffle"] {
  transform:translateX(calc(200% + 6px));
}


/* VoiceOver — a small oval button on its own, unlabeled,
   the way it sits on the real device's edge */

.voiceover {
  width:30px;
  height:14px;

  padding:0;

  border:0;
  border-radius:8px;

  background:
    linear-gradient(
      to bottom,
      #f6f6f6 0%,
      #e2e2e2 55%,
      #cfcfcf 100%
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 1px 2px rgba(0,0,0,.35);

  cursor:pointer;

  -webkit-tap-highlight-color:transparent;
}

.voiceover.pressed,
.voiceover:active {
  background:#cfcfcf;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.3);
}


/* =========================================================
   ONE LINE DISPLAY
   Same grey bezel / white glass / scanlines as the iPod screen
   ========================================================= */

.display-bezel {
  padding:3px;

  border-radius:7px;

  background:#7f7f7f;

  box-shadow:
    inset 0 1px 5px rgba(0,0,0,.42),
    0 1px 0 rgba(255,255,255,.4);
}

.display {
  height:30px;

  display:grid;
  grid-template-columns:20px minmax(0,1fr) auto;
  align-items:center;
  gap:6px;

  padding:0 7px;

  position:relative;
  overflow:hidden;

  border-radius:4px;

  background:rgba(255,255,255,.45);

  color:var(--text);
}

.display-video {
  position:absolute;
  inset:0;

  width:100%;
  height:100%;

  object-fit:cover;

  z-index:0;

  opacity:.16;

  pointer-events:none;

  filter:brightness(.9) saturate(.75);
}

/* scanlines */
.display::after {
  content:"";

  position:absolute;
  inset:0;

  z-index:4;

  pointer-events:none;

  opacity:.14;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,.16) 0,
      rgba(0,0,0,.16) 1px,
      transparent 1px,
      transparent 3px
    );

  mix-blend-mode:multiply;
}

.display-glyph {
  position:relative;
  z-index:2;

  display:grid;
  place-items:center;

  height:16px;

  border-radius:2px;

  background:
    linear-gradient(
      to bottom,
      var(--blue-1) 0%,
      var(--blue-2) 58%,
      var(--blue-3) 100%
    );

  color:#fff;

  font-size:7px;
  line-height:1;
}

.display-track {
  position:relative;
  z-index:2;

  min-width:0;

  overflow:hidden;

  -webkit-mask-image:linear-gradient(
    to right,
    transparent 0,
    #000 8px,
    #000 calc(100% - 8px),
    transparent 100%
  );

  mask-image:linear-gradient(
    to right,
    transparent 0,
    #000 8px,
    #000 calc(100% - 8px),
    transparent 100%
  );
}

.display-line {
  display:inline-flex;
  align-items:center;

  white-space:nowrap;

  font:10px/1 var(--mono);
  letter-spacing:.6px;
  font-weight:700;

  text-shadow:0 1px 0 rgba(255,255,255,.6);
}

.display-line.is-static {
  display:flex;
  justify-content:center;
}

.display-line.is-scrolling {
  animation:marquee linear infinite;
}

.display-text + .display-text {
  padding-left:38px;
}

@keyframes marquee {
  from { transform:translateX(0); }
  to   { transform:translateX(-50%); }
}

.display-time {
  position:relative;
  z-index:2;

  color:var(--muted);

  font:9px var(--mono);
  font-variant-numeric:tabular-nums;
}

.display.is-dark .display-glyph,
.display.is-dark .display-line,
.display.is-dark .display-time {
  opacity:.18;
}


/* =========================================================
   CONTROL PAD
   ========================================================= */

.pad {
  width:min(228px,66vw);
  height:min(228px,66vw);

  margin:22px auto 6px;

  position:relative;

  border-radius:50%;

  background:
    radial-gradient(
      circle at 34% 24%,
      #ffffff 0%,
      #f6f6f6 38%,
      #e7e7e7 74%,
      #d4d4d4 100%
    );

  box-shadow:
    0 3px 8px rgba(0,0,0,.4),
    0 1px 2px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -3px 8px rgba(0,0,0,.07);

  touch-action:none;
  user-select:none;
}

.pad-hit {
  position:absolute;

  padding:6px;

  border:0;

  background:transparent;
  color:#8a8a8a;

  cursor:pointer;

  font-size:13px;
  font-weight:800;
  line-height:1;

  -webkit-tap-highlight-color:transparent;
}

.pad-hit:hover,
.pad-hit:focus-visible {
  color:#3a3a3a;
}

.pad-hit.pressed {
  color:#3a3a3a;
  filter:brightness(.94);
}

.pad-up {
  top:11px;
  left:50%;
  transform:translateX(-50%);
  font-size:16px;
}

.pad-down {
  bottom:11px;
  left:50%;
  transform:translateX(-50%);
  font-size:16px;
}

.pad-left {
  top:50%;
  left:11px;
  transform:translateY(-50%);
}

.pad-right {
  top:50%;
  right:11px;
  transform:translateY(-50%);
}

.pad-center {
  width:36%;
  height:36%;

  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);

  display:grid;
  place-items:center;

  border:1px solid rgba(0,0,0,.15);
  border-radius:50%;

  background:
    linear-gradient(
      150deg,
      var(--red-1) 0%,
      var(--red-2) 55%,
      var(--red-3) 100%
    );

  color:#fff;

  cursor:pointer;

  font-size:11px;
  font-weight:800;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    0 1px 3px rgba(0,0,0,.25);

  -webkit-tap-highlight-color:transparent;
}

.pad-center:active,
.pad-center.pressed {
  background:var(--red-3);
}

.pad-center-mark {
  text-shadow:0 1px 1px rgba(0,0,0,.25);
}


/* =========================================================
   LABELS
   ========================================================= */

.shuffle-caption {
  margin:2px 0 0;

  color:rgba(255,255,255,.62);

  text-align:center;

  font-size:11px;
  line-height:1.4;
}

.cross-link {
  color:#ff8d8d;
  text-decoration:none;
  border-bottom:1px solid rgba(255,141,141,.45);
}

.cross-link:hover,
.cross-link:focus-visible {
  color:#fff;
  border-bottom-color:rgba(255,255,255,.6);
}

.outside-note {
  color:rgba(255,255,255,.35);

  font:8px var(--mono);

  letter-spacing:1.2px;
}


/* =========================================================
   FOCUS
   ========================================================= */

:focus-visible {
  outline:2px solid #ffd7d7;
  outline-offset:2px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion:reduce) {
  *,
  *::before,
  *::after {
    transition:none!important;
  }

  .display-line.is-scrolling {
    animation:none!important;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:600px) {

  body {
    padding:
      max(7px,env(safe-area-inset-top))
      5px
      max(12px,env(safe-area-inset-bottom));
  }

  .shuffle {
    width:min(290px,86vw);
    padding:0 13px 15px;
  }

  .top-edge {
    margin:0 -13px 12px;
    padding:0 11px;
  }

  .pad {
    width:min(210px,62vw);
    height:min(210px,62vw);
  }

  .display {
    height:28px;
  }
}

/* =========================================================
   DETACHED DISPLAY
   Same display component as the original Neocities design,
   physically separated from the shuffle body.
   ========================================================= */
.detached-screen {
  width:min(310px,80vw);
  margin:0 0 8px;
  position:relative;
  z-index:3;
}

.detached-screen .display-bezel {
  width:100%;
}

@media (max-width:600px) {
  .detached-screen {
    width:min(290px,86vw);
    margin-bottom:7px;
  }
}
