:root {
  --bg: #050505;
  --fg: #e8e6ee;
  --muted: #9691aa;
  --quiet: #676174;
  --line: rgba(137, 111, 255, 0.24);
  --line-soft: rgba(137, 111, 255, 0.1);
  --panel: rgba(0, 0, 0, 0.64);
  --accent: #866cff;
  --accent-2: #6fb8ff;
  --hot: #b9a9ff;
  --mx: 50vw;
  --my: 50vh;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --shift-x: 0px;
  --shift-y: 0px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  color: var(--fg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  background: var(--bg);
  cursor: none;
  overflow: hidden;
}

body::before,
body::after,
.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 1;
  content: "";
  background:
    radial-gradient(circle at 58% 48%, rgba(134, 108, 255, 0.09), transparent 34rem),
    radial-gradient(circle at 28% 72%, rgba(111, 184, 255, 0.045), transparent 28rem),
    linear-gradient(90deg, transparent 0 8%, rgba(134, 108, 255, 0.028) 8.1%, transparent 8.2%),
    linear-gradient(180deg, transparent 0 74%, rgba(111, 184, 255, 0.025) 74.1%, transparent 74.2%);
}

body::after {
  z-index: 3;
  content: "";
  background: radial-gradient(circle at center, transparent 0 34%, rgba(0, 0, 0, 0.58) 100%);
}

body.grain .texture {
  z-index: 4;
  opacity: 0.14;
  background:
    repeating-linear-gradient(0deg, rgba(199, 184, 255, 0.032) 0 1px, transparent 1px 5px),
    radial-gradient(rgba(111, 184, 255, 0.28) 0.42px, transparent 0.42px);
  background-size: auto, 6px 6px;
  mix-blend-mode: screen;
}

#background {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

#cursor {
  position: fixed;
  z-index: 6;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(232, 230, 238, 0.68);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 160ms ease, border-color 160ms ease;
  mix-blend-mode: normal;
}

#cursor::before,
#cursor::after {
  position: absolute;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

#cursor::before {
  inset: 5px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--accent-2);
  border-right-color: rgba(134, 108, 255, 0.72);
  background: transparent;
  animation: cursorLoad 1s linear infinite;
}

#cursor::after {
  inset: 9px;
  background: rgba(232, 230, 238, 0.68);
}

body.cursor-dot #cursor {
  width: 18px;
  height: 18px;
  background: transparent;
  border-color: rgba(232, 230, 238, 0.68);
}

body.cursor-none {
  cursor: auto;
}

body.cursor-none #cursor {
  display: none;
}

body:not(.cursor-none) button,
body:not(.cursor-none) a {
  cursor: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px 18px;
  perspective: 1200px;
}

.console {
  position: relative;
  width: min(720px, calc(100vw - 36px));
  min-height: min(720px, calc(100vh - 84px));
  padding: clamp(18px, 3vw, 30px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(134, 108, 255, 0.055), transparent 30%),
    linear-gradient(180deg, rgba(10, 10, 15, 0.9), rgba(4, 4, 7, 0.95));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.38),
    0 0 28px rgba(134, 108, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.028);
  transform: translate3d(calc(var(--shift-x) * 0.18), calc(var(--shift-y) * 0.16), 0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 220ms ease-out, border-color 180ms ease, box-shadow 180ms ease;
  animation: consoleAura 8s ease-in-out infinite;
}

.console::before,
.console::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.console::before {
  inset: 8px;
  border: 1px solid rgba(143, 107, 255, 0.12);
}

.console::after {
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), transparent);
  opacity: 0.74;
  animation: railScan 4.8s ease-in-out infinite;
}

.masthead {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 10px 0 18px;
  text-align: center;
  transform: translate3d(calc(var(--shift-x) * -0.22), calc(var(--shift-y) * -0.12), 34px);
}

.discord-avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-label,
.console-foot,
.links a,
button,
#audio-title {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

h1 {
  position: relative;
  margin: 0;
  color: var(--fg);
  font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", "Snell Roundhand", cursive;
  font-size: clamp(62px, 11vw, 112px);
  font-weight: 700;
  line-height: 0.76;
  letter-spacing: 0;
  text-transform: none;
  text-shadow:
    0 0 12px rgba(199, 184, 255, 0.14),
    0 0 30px rgba(134, 108, 255, 0.16);
  transform: rotate(-2deg);
  animation: titleBreathe 4.6s ease-in-out infinite;
}

h1::after {
  position: absolute;
  inset: 0;
  content: attr(data-text);
  color: transparent;
  -webkit-text-stroke: 1px rgba(111, 184, 255, 0.14);
  transform: translate(5px, 4px);
  opacity: 0.72;
  pointer-events: none;
  animation: titleTrace 3.8s ease-in-out infinite;
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.module {
  min-width: 0;
  transform: translate3d(calc(var(--shift-x) * 0.05), calc(var(--shift-y) * 0.05), 18px);
}

.module-label {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.module-label small {
  color: var(--quiet);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.media-card,
.time-card,
.account-card,
.audio-card,
.links a {
  position: relative;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 100% 0, rgba(134, 108, 255, 0.055), transparent 45%),
    rgba(255, 255, 255, 0.018);
  color: var(--fg);
  overflow: hidden;
  transform: rotateX(var(--card-x, 0deg)) rotateY(var(--card-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.media-card::before,
.time-card::before,
.account-card::before,
.audio-card::before,
.links a::before {
  position: absolute;
  inset: -1px;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(120deg, transparent, rgba(199, 184, 255, 0.075), transparent);
  transform: translateX(-120%);
  transition: opacity 180ms ease;
}

.media-card,
.account-card {
  min-height: 78px;
  padding: 12px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.time-card {
  min-height: 78px;
  padding: 12px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.media-card:hover,
.account-card:hover,
.links a:hover,
.media-card:focus-visible,
.account-card:focus-visible,
.links a:focus-visible,
#audio-toggle:hover,
#audio-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(199, 184, 255, 0.42);
  background:
    radial-gradient(circle at 100% 0, rgba(111, 184, 255, 0.09), transparent 42%),
    rgba(134, 108, 255, 0.045);
  box-shadow: 0 0 16px rgba(134, 108, 255, 0.08);
  outline: 0;
}

.media-card:hover::before,
.time-card:hover::before,
.account-card:hover::before,
.audio-card:hover::before,
.links a:hover::before {
  opacity: 1;
  animation: cardSheen 900ms ease;
}

.media-art,
.discord-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--bg);
  background:
    linear-gradient(135deg, var(--accent-2), var(--accent));
  font: 800 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: iconPulse 3.4s ease-in-out infinite;
}

.media-copy,
.account-copy,
.time-card span:last-child {
  display: grid;
  gap: 6px;
}

.media-copy b,
.account-copy b,
.time-card b {
  color: var(--fg);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.media-copy small,
.account-copy small,
.time-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.module-arrow {
  color: var(--quiet);
  font: 800 18px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.clock-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 48%, var(--line) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, var(--line) 49% 51%, transparent 52%);
  animation: clockSpin 9s linear infinite;
}

.module-discord .account-card {
  min-height: 84px;
}

.player {
  display: grid;
  gap: 4px;
}

.audio-card {
  min-height: 52px;
  padding: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

#audio-toggle {
  min-height: 34px;
  padding: 0 12px;
  color: var(--fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line-soft);
  background: transparent;
}

.player-line {
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), transparent);
  opacity: 0.68;
  animation: linePulse 2.6s ease-in-out infinite;
}

#audio-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.module-links {
  align-self: end;
}

.links {
  display: grid;
  gap: 8px;
}

.links a {
  min-height: 42px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--fg);
  text-decoration: none;
  text-transform: uppercase;
}

.links a i {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: var(--hot);
  font-style: normal;
  border: 1px solid rgba(143, 107, 255, 0.22);
  background: rgba(143, 107, 255, 0.08);
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease;
}

.links a:hover i {
  color: var(--accent-2);
  border-color: rgba(87, 190, 255, 0.5);
  transform: rotate(-8deg) scale(1.08);
}

.links a span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.links a small {
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.console-foot {
  min-height: 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  color: var(--fg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@keyframes consoleAura {
  0%, 100% {
    box-shadow:
      0 34px 90px rgba(0, 0, 0, 0.44),
      0 0 36px rgba(143, 107, 255, 0.12),
      inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  }
  50% {
    box-shadow:
      0 38px 105px rgba(0, 0, 0, 0.48),
      0 0 62px rgba(143, 107, 255, 0.22),
      inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }
}

@keyframes cursorLoad {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cardSheen {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes railScan {
  0%, 100% {
    opacity: 0.34;
    transform: scaleX(0.76);
  }
  50% {
    opacity: 0.88;
    transform: scaleX(1);
  }
}

@keyframes titleBreathe {
  0%, 100% {
    filter: brightness(1);
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    filter: brightness(1.18);
    transform: rotate(-1.15deg) translateY(-2px);
  }
}

@keyframes titleTrace {
  0%, 100% {
    transform: translate(5px, 4px);
    opacity: 0.38;
  }
  50% {
    transform: translate(9px, 2px);
    opacity: 0.78;
  }
}

@keyframes iconPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(143, 107, 255, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(143, 107, 255, 0.22);
  }
}

@keyframes clockSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes linePulse {
  0%, 100% {
    opacity: 0.36;
  }
  50% {
    opacity: 0.9;
  }
}

.console-foot span:nth-child(2) {
  color: var(--muted);
  text-align: center;
}

.console-foot span:last-child {
  text-align: right;
}

@media (max-width: 760px) {
  body {
    overflow-y: auto;
  }

  .wrap {
    min-height: 100svh;
    align-items: start;
    padding: 16px;
  }

  .console {
    width: 100%;
    min-height: calc(100svh - 32px);
    padding: 16px;
    gap: 12px;
    transform: none;
    animation: none;
  }

  .masthead {
    justify-items: start;
    text-align: left;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .media-card,
  .account-card {
    grid-template-columns: 48px 1fr auto;
  }

  .media-art,
  .discord-avatar {
    width: 48px;
    height: 48px;
  }

  .console-foot {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .console-foot span,
  .console-foot span:nth-child(2),
  .console-foot span:last-child {
    text-align: left;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 60px;
  }

  .links a {
    grid-template-columns: 1fr;
  }

  .links a i {
    display: none;
  }
}

@media (pointer: coarse) {
  body {
    cursor: auto;
  }

  #cursor {
    display: none;
  }

  button,
  a {
    cursor: pointer;
  }
}

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

  .console,
  .masthead,
  .module,
  .media-card,
  .time-card,
  .account-card,
  .audio-card,
  .links a {
    transform: none !important;
  }
}
