/* =========================================================
   RAÚL VILLASEÑOR — LINK IN BIO
   Design tokens: deep-space navy background, electric-blue
   glass/neumorphic cards, cursive signature name, glowing
   pill controls. Restraint: glow is reserved for the avatar
   ring, primary buttons and the active carousel dot only.
   ========================================================= */

:root {
  /* Color */
  --bg-deep: #04070f;
  --bg-blue-1: #060f24;
  --bg-blue-2: #0c1f4a;
  --glow-blue: #2f6fff;
  --glow-blue-soft: #4fb3ff;
  --glass-fill: rgba(18, 34, 70, 0.5);
  --glass-fill-strong: rgba(22, 42, 84, 0.62);
  --glass-border: rgba(130, 175, 255, 0.22);
  --text-primary: #f3f7ff;
  --text-muted: #9fb2d6;
  --text-faint: #6c7fa3;
  --danger-focus: #7fd0ff;

  /* Type */
  --font-display: "Alex Brush", cursive;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --max-width: 480px;
  --gap-section: 2.5rem;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: radial-gradient(120% 90% at 50% -10%, var(--bg-blue-2) 0%, var(--bg-blue-1) 45%, var(--bg-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, p {
  margin: 0;
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--glow-blue);
  color: #041028;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--danger-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Ambient background glow ---------- */
.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(38% 22% at 50% 10%, rgba(47, 111, 255, 0.35), transparent 70%),
    radial-gradient(30% 20% at 85% 60%, rgba(79, 179, 255, 0.12), transparent 70%),
    radial-gradient(30% 20% at 10% 80%, rgba(47, 111, 255, 0.1), transparent 70%);
}

/* ---------- Layout wrapper ---------- */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
}

/* main must also be a flex column so the section gap actually
   applies between About / Links / Player / Portfolio / QR —
   without this, .wrapper's gap only separates header/main/footer */
main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
}

/* ---------- Glass card base ---------- */
.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   HERO / PROFILE CARD
   ========================================================= */
.hero {
  display: flex;
  justify-content: center;
}

.profile-card {
  width: 100%;
  padding: 2.25rem 1.75rem 2.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.avatar-ring {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  padding: 6px;
  margin-bottom: 0.5rem;
  background: conic-gradient(from 180deg, var(--glow-blue), var(--glow-blue-soft), var(--glow-blue));
  box-shadow: 0 0 0 1px rgba(130, 175, 255, 0.25), 0 0 45px 6px rgba(47, 111, 255, 0.45);
  animation: pulse-ring 4.5s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 1px rgba(130, 175, 255, 0.25), 0 0 45px 6px rgba(47, 111, 255, 0.45); }
  50%      { box-shadow: 0 0 0 1px rgba(130, 175, 255, 0.35), 0 0 60px 12px rgba(47, 111, 255, 0.65); }
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-blue-1);
}

.signature-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 26px rgba(79, 179, 255, 0.55);
}

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  padding: 1.75rem;
}

.about h2,
.player h2,
.qr h2,
.portfolio h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--glow-blue-soft);
  margin-bottom: 0.9rem;
}

.about p {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.about p strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* =========================================================
   SOCIAL / CONTACT PILL BUTTONS
   ========================================================= */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.4rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(28, 50, 96, 0.75), rgba(14, 26, 54, 0.75));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 10px 24px -14px rgba(0, 0, 0, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pill-btn:hover,
.pill-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(130, 175, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(79, 179, 255, 0.25),
    0 14px 30px -12px rgba(47, 111, 255, 0.55);
}

.pill-btn:active {
  transform: translateY(0);
}

.pill-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: var(--glow-blue-soft);
}

.pill-email .pill-icon {
  fill: none;
  stroke: none;
}
.pill-email .pill-icon path {
  fill: var(--glow-blue-soft);
}

/* =========================================================
   SOUNDCLOUD PLAYER
   ========================================================= */
.player {
  padding: 1.5rem 1.5rem 1.75rem;
}

.soundcloud-embed {
  border-radius: var(--radius-md);
  display: block;
  border: 1px solid var(--glass-border);
}

/* =========================================================
   PORTFOLIO CAROUSEL
   ========================================================= */
.portfolio {
  padding: 0 0.1rem;
}

.portfolio h2 {
  padding-left: 0.5rem;
}

.carousel {
  position: relative;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
}

.carousel-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  touch-action: pan-y;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg-blue-1);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-fill-strong);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
  background: rgba(47, 111, 255, 0.35);
  box-shadow: 0 0 20px rgba(47, 111, 255, 0.55);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.94);
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(159, 178, 214, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
}

.carousel-dot[aria-selected="true"] {
  background: var(--glow-blue-soft);
  box-shadow: 0 0 10px rgba(79, 179, 255, 0.8);
  width: 20px;
  border-radius: var(--radius-pill);
}

/* =========================================================
   QR CODE
   ========================================================= */
.qr {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.qr-code {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  padding: 10px;
  background: #ffffff; /* white quiet zone keeps the code scannable */
  box-shadow: 0 0 24px rgba(47, 111, 255, 0.25);
  width: 150px;
  height: 150px;
}

.qr-link {
  font-weight: 600;
  color: var(--glow-blue-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.qr-link:hover,
.qr-link:focus-visible {
  text-decoration: underline;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.82rem;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer a {
  color: var(--glow-blue-soft);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVE — small phones
   ========================================================= */
@media (max-width: 360px) {
  .signature-name { font-size: 2.1rem; }
  .pill-btn { font-size: 0.88rem; padding: 0.85rem 1.1rem; }
}

/* =========================================================
   RESPONSIVE — tablet / desktop
   ========================================================= */
@media (min-width: 720px) {
  .wrapper {
    max-width: 560px;
    padding-top: 4rem;
  }

  .avatar-ring {
    width: 172px;
    height: 172px;
  }

  .carousel-arrow {
    width: 46px;
    height: 46px;
  }
}
