/* ===========================================================
   Glassmorphic Bio — main site styles
   Theme variables are driven from config by app.js
   =========================================================== */
:root {
  --g1: #f6c177;
  --g2: #eb6f92;
  --grad: linear-gradient(135deg, var(--g1), var(--g2));
  --dim: 0.35;
  --bg-blur: 0px;
  --card-blur: 22px;
  --card-alpha: 0.32;
  --text: #fbf8ff;
  --muted: rgba(240, 234, 255, 0.68);
  --faint: rgba(240, 234, 255, 0.42);
  --line: rgba(255, 255, 255, 0.13);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

[hidden] { display: none !important; }

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: #0b0912;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 20% 0%, color-mix(in srgb, var(--g1) 22%, transparent), transparent 60%),
    radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--g2) 24%, transparent), transparent 60%),
    #0b0912;
}

.bg-canvas,
.bg-video {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
}

.bg-video {
  object-fit: cover;
  filter: blur(var(--bg-blur));
  transform: scale(calc(1 + var(--bg-blur-scale, 0)));
  opacity: 0;
  transition: opacity 0.9s ease;
}
body.video-ready .bg-video { opacity: 1; }

.bg-canvas { opacity: 0; transition: opacity 0.9s ease; }
body.show-glow .bg-canvas { opacity: 1; }

.bg-dim {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 10, var(--dim));
  pointer-events: none;
}

/* ---------- Sound toggle ---------- */
.sound-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 30;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(20, 16, 30, 0.35);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.sound-toggle:hover { transform: scale(1.06); background: rgba(40, 32, 56, 0.45); }
.sound-toggle:active { transform: scale(0.95); }
.sound-toggle svg { width: 21px; height: 21px; }
.sound-toggle .ic-on { display: none; }
.sound-toggle[aria-pressed="true"] .ic-on { display: block; }
.sound-toggle[aria-pressed="true"] .ic-off { display: none; }
.sound-toggle[aria-pressed="true"] { color: var(--g1); }

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(76px, calc(env(safe-area-inset-top) + 64px)) 16px max(40px, env(safe-area-inset-bottom));
}

/* ---------- Glass card ---------- */
.card {
  position: relative;
  width: 100%;
  max-width: 425px;
  border-radius: 30px;
  padding: 34px 22px 22px;
  text-align: center;
  background: rgba(16, 12, 26, var(--card-alpha));
  backdrop-filter: blur(var(--card-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 40px 90px -30px rgba(0, 0, 0, 0.75);
  animation: cardIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card::before {
  /* soft top highlight */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 32%);
}
.card > * { position: relative; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Avatar */
.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  padding: 3px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04), 0 12px 40px -8px color-mix(in srgb, var(--g2) 60%, transparent);
}
.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #17121f;
  display: grid;
  place-items: center;
  border: 3px solid rgba(12, 9, 18, 0.9);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar svg { width: 58%; height: 58%; }

/* Name */
.name {
  margin: 0;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sparkle {
  font-size: 0.7em;
  animation: twinkle 2.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0); }
  50% { opacity: 0.55; transform: scale(0.82) rotate(20deg); }
}
.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}

/* Pills */
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, color-mix(in srgb, var(--g1) 22%, transparent), color-mix(in srgb, var(--g2) 26%, transparent));
  border: 1px solid color-mix(in srgb, var(--g2) 45%, transparent);
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--g2) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--g1);
  box-shadow: 0 0 10px var(--g1);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.bio {
  margin: 16px auto 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-line;
}

/* Divider labels */
.section { margin-top: 24px; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--faint);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* Minecraft box */
.mc-box {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  overflow: hidden;
  text-align: left;
}
.mc-note {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.mc-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.mc-row:last-child { border-bottom: 0; }
.mc-row:hover, .mc-row:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.mc-label { font-size: 13px; color: var(--faint); font-weight: 600; }
.mc-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14.5px;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  min-width: 0;
}
.mc-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-value i { font-style: normal; color: var(--faint); font-size: 13px; }

/* Social links */
.links { display: grid; gap: 10px; }
.link {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 11px 14px 11px 11px;
  border-radius: 18px;
  text-decoration: none;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.link:hover, .link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--brand, var(--g1)) 45%, transparent);
  outline: none;
}
.link:active { transform: scale(0.985); }
.link-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--brand, #fff);
  background: color-mix(in srgb, var(--brand, #fff) 14%, rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--brand, #fff) 24%, transparent);
}
.link-icon svg { width: 21px; height: 21px; }
.link-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.link-title { font-weight: 750; font-size: 15px; }
.link-handle { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-action {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  transition: color 0.2s, background 0.2s;
}
.link:hover .link-action { color: var(--text); background: rgba(255, 255, 255, 0.12); }

.footer {
  margin-top: 22px;
  font-size: 12px;
  color: var(--faint);
}

/* Maintenance */
.card-maint { padding: 44px 28px; }
.maint-emoji {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: var(--glass-hi);
  border: 1px solid var(--line);
}
.maint-title { margin: 0 0 10px; font-size: 26px; font-weight: 800; }
.maint-msg { margin: 0; color: var(--muted); line-height: 1.6; white-space: pre-line; }

/* ---------- Entry splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 4, 12, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 0.6s ease, visibility 0.6s;
}
.splash.is-leaving { opacity: 0; visibility: hidden; }
.splash-card {
  width: 100%;
  max-width: 340px;
  padding: 30px 24px 18px;
  border-radius: 28px;
  text-align: center;
  background: rgba(17, 13, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.splash-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a1020;
  background: var(--grad);
  box-shadow: 0 12px 34px -8px color-mix(in srgb, var(--g2) 75%, transparent);
  animation: bob 3s ease-in-out infinite;
}
.splash-badge svg { width: 28px; height: 28px; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.splash-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.splash-sub { margin: 8px 0 22px; color: var(--muted); font-size: 14px; }
.btn-primary {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15.5px;
  color: #1a1020;
  background: var(--grad);
  cursor: pointer;
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--g2) 80%, transparent);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: scale(0.98); }
.btn-text {
  margin-top: 8px;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-text:hover { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(20, 16, 30, 0.8);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--g1); }

.noscript { position: relative; z-index: 20; text-align: center; padding: 40px; }

:focus-visible { outline: 2px solid var(--g1); outline-offset: 3px; }

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