:root {
  --bg: #101013;
  --accent: #74000e;
  --accent-rgb: 116 0 14;
  --name-color: #ffffff;
  --fg: #ffffff;
  --card-bg: rgba(0, 0, 0, 0.6);
  --card-blur: 10px;
  --card-border: rgba(255, 255, 255, 0.08);
  --border-width: 2px;
  --border-radius: 0.3rem;
  --glow: 0 0 24px rgb(var(--accent-rgb) / 0.55);
  --glow-strong: 0 0 36px rgb(var(--accent-rgb) / 0.8);
  --font: "Mali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cursor-size: 48px;
}

@media (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }
}

@media (pointer: coarse) {
  .custom-cursor { display: none !important; }
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transition: opacity 180ms ease-out;
  will-change: transform;
}

.custom-cursor.visible { opacity: 1; }

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

html {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

body {
  width: 100%;
  height: 100%;
  background: transparent;
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--bg); color: var(--accent); }

#background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px);
  z-index: 0;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: opacity;
}

.sparkles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  opacity: 0;
  transition: opacity 500ms ease-out;
  z-index: 2;
  perspective: 1400px;
}

#app.visible { opacity: 1; }
#app[hidden] { display: none; }

/* ---- splash ---- */

#splash {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 400ms ease-out;
}

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

.splash-text {
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
  text-shadow: 0 0 18px rgb(var(--accent-rgb) / 0.55);
  animation: splash-pulse 3s ease-in-out infinite;
  text-align: center;
  padding: 0 24px;
}

@keyframes splash-pulse {
  0%, 100% { opacity: 0.85; text-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.4); }
  50%      { opacity: 1;    text-shadow: 0 0 28px rgb(var(--accent-rgb) / 0.75); }
}

/* ---- tilt group (wraps card-stack + music-player so they tilt together) ---- */

.tilt-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---- card-stack and faces (3D flip, nested inside tilt-group) ---- */

.card-stack {
  position: relative;
  width: 100%;
  max-width: 420px;
  perspective: 1600px;
  transform-style: preserve-3d;
  transition: transform 0.7s ease-in-out;
}

.card-stack.flipped-projects { transform: rotateY(180deg); }
.card-stack.flipped-crypto   { transform: rotateY(-180deg); }

.face {
  display: flex;
  flex-direction: column;
  gap: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.face.back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  justify-content: center;
}

/* ---- card base style (shared) ---- */

.profile-card,
.discord-card,
.projects-card,
.crypto-card,
.music-player {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: var(--border-width) solid var(--card-border);
  border-radius: var(--border-radius);
  box-shadow: var(--glow);
  color: var(--fg);
  transition: box-shadow 300ms ease-out;
}

.profile-card:hover,
.discord-card:hover,
.projects-card:hover,
.crypto-card:hover,
.music-player:hover {
  box-shadow: var(--glow-strong);
}

/* ---- profile card ---- */

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 16px;
  overflow: hidden;
  position: relative;
  isolation: isolate; /* own stacking context, so children's z-index can never be
                          out-ranked by anything outside this card */
}

.profile-card .banner {
  width: 100%;
  height: 116px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.82);
  position: relative;
  z-index: 1;
}

/* Fade at the bottom of the banner so it blends into the card instead of
   ending in a hard edge. */
.profile-card .banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.75) 100%);
}

.profile-card .pfp {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  margin-top: -52px;
  box-shadow: 0 0 18px rgb(var(--accent-rgb) / 0.55);
  position: relative;
  z-index: 3;
  background: var(--card-bg, #101013); /* opaque backing so the banner never
                                           shows through the pfp's own edges */
}

.name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 1.8rem;
  font-weight: 700;
}

.verified {
  width: 22px;
  height: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.75));
  flex-shrink: 0;
}

.name {
  color: var(--name-color);
  letter-spacing: 1px;
  text-shadow:
    0 1px 0 rgb(var(--accent-rgb) / 0.95),
    0 2px 0 rgb(var(--accent-rgb) / 0.85),
    0 3px 0 rgb(var(--accent-rgb) / 0.72),
    0 4px 0 rgb(var(--accent-rgb) / 0.58),
    0 5px 0 rgb(var(--accent-rgb) / 0.45),
    0 6px 0 rgb(var(--accent-rgb) / 0.32),
    0 7px 0 rgb(var(--accent-rgb) / 0.2),
    0 10px 18px rgb(var(--accent-rgb) / 0.85),
    0 0 24px rgb(var(--accent-rgb) / 0.5);
}

.bio {
  margin-top: 4px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
  min-height: 1.3em;
}

.bio .cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.views {
  position: absolute;
  top: 124px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

.views-icon {
  width: 13px;
  height: 13px;
  color: rgb(var(--accent-rgb) / 0.9);
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.6));
}

.views-count {
  letter-spacing: 0.3px;
}

.socials {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  transition: background 200ms, transform 200ms, box-shadow 200ms;
}

.socials a:hover {
  background: rgb(var(--accent-rgb) / 0.35);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgb(var(--accent-rgb) / 0.7);
}

.socials svg {
  width: 18px;
  height: 18px;
}

.flip-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px;
  margin-top: 14px;
}

.flip-link {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 200ms;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.flip-link:hover { color: var(--accent); }

.flip-icon {
  width: 14px;
  height: 14px;
}

/* ---- music player ---- */

.music-player {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
}

.song-title {
  font-size: 0.95rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  padding: 2px 0 8px;
}

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

.player-controls button {
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 200ms, box-shadow 200ms;
}

.player-controls button:hover {
  background: rgb(var(--accent-rgb) / 0.35);
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.6);
}

.player-controls button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.progress-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 8px rgb(var(--accent-rgb) / 0.8);
  transition: width 100ms linear;
}

.volume-control {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 0;
  margin-left: 0;
  opacity: 0;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--vol-pct, 50%),
    rgba(255, 255, 255, 0.12) var(--vol-pct, 50%),
    rgba(255, 255, 255, 0.12) 100%
  );
  cursor: pointer;
  transition: width 200ms ease, opacity 200ms ease, margin-left 200ms ease;
}

.volume-control:hover .volume-slider,
.volume-control:focus-within .volume-slider {
  width: 70px;
  opacity: 1;
  margin-left: 6px;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgb(var(--accent-rgb) / 0.8);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgb(var(--accent-rgb) / 0.8);
  cursor: pointer;
}

.volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: transparent;
}

/* Touch devices already control media volume with the hardware buttons,
   so the on-screen slider is desktop-only clutter there. */
@media (hover: none), (pointer: coarse) {
  .volume-slider { display: none; }
}

.time-display {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.65);
  min-width: 70px;
  text-align: right;
}

/* ---- discord card ---- */

.discord-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px;
  min-height: 62px;
}

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

.discord-placeholder {
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.55);
  flex-shrink: 0;
}

.discord-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.discord-tag {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #3ccf60;  /* green text for the handle — matches the reference screenshot */
}

.discord-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.discord-activity {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord-button {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  background: transparent;
  border: 1px solid rgb(var(--accent-rgb) / 0.6);
  border-radius: 4px;
  text-decoration: none;
  transition: background 200ms, box-shadow 200ms, border-color 200ms;
}

.discord-button:hover {
  background: rgb(var(--accent-rgb) / 0.35);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.7);
}

/* ---- discord activity detail (spotify track / game, with cover art) ---- */

.discord-activity-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.activity-cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.5);
}

.activity-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.06);
}

.activity-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.activity-kind {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.45);
}

.activity-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- projects card ---- */

.projects-card {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  min-height: 260px;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.projects-title {
  font-weight: 700;
  font-size: 1.25rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.projects-list::-webkit-scrollbar { width: 4px; }
.projects-list::-webkit-scrollbar-thumb { background: rgb(var(--accent-rgb) / 0.5); border-radius: 2px; }

.project-tile {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}

.project-tile:hover {
  background: rgb(var(--accent-rgb) / 0.25);
  border-color: rgb(var(--accent-rgb) / 0.6);
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.5);
}

.project-tile-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.project-tile-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.project-tile-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.45);
}

.project-tile-desc {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* ---- crypto card ---- */

.crypto-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  min-height: 160px;
}

.crypto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.crypto-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.crypto-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.crypto-list::-webkit-scrollbar { width: 4px; }
.crypto-list::-webkit-scrollbar-thumb { background: rgb(var(--accent-rgb) / 0.5); border-radius: 2px; }

.crypto-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  transition: background 200ms, border-color 200ms, box-shadow 200ms;
}

.crypto-tile:hover {
  background: rgb(var(--accent-rgb) / 0.25);
  border-color: rgb(var(--accent-rgb) / 0.6);
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.5);
}

.crypto-tile-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crypto-tile-symbol {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.crypto-tile-address {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  font-family: monospace;
  word-break: break-all;
  line-height: 1.35;
  cursor: pointer;
  transition: color 200ms;
}

.crypto-tile-address:hover {
  color: rgba(255, 255, 255, 0.85);
}

.crypto-tile-copied {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 200ms;
}

.crypto-tile-copied.show { opacity: 1; }

/* ---- flip interaction ---- */

.card-stack.is-flipping { pointer-events: none; }
.projects-card[hidden],
.crypto-card[hidden] { display: none !important; }

/* ---- responsive ---- */

@media (max-width: 480px) {
  .card-stack { max-width: calc(100% - 8px); }
  .music-player { max-width: calc(100% - 8px); }

  .profile-card .banner { height: 72px; }
  .profile-card .pfp { width: 76px; height: 76px; margin-top: -38px; }
  .name-row { font-size: 1.35rem; }
  .views { top: 78px; left: 10px; font-size: 0.7rem; padding: 3px 8px; }

  .splash-text { font-size: 1.5rem; }

  .player-controls { gap: 8px; }
  .time-display { min-width: 58px; font-size: 0.7rem; }

  .discord-top { flex-wrap: wrap; }
  .discord-button { margin-left: auto; }

  .projects-card { padding: 16px 16px; min-height: 220px; }
  .projects-list { max-height: 280px; }
}

/* ---- language toggle (top-right) ---- */

.lang-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.lang-toggle:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .lang-toggle { top: 10px; right: 10px; padding: 5px 10px; }
}
