/* ==========================================================================
   Ghost Ear — Link-in-bio stylesheet
   --------------------------------------------------------------------------
   Table of contents:
     1.  Design tokens (CSS custom properties)
     2.  Reset & base
     3.  Animated background layers
     4.  Page layout & fade-in
     5.  Profile (avatar ring, name, bio)
     6.  Link cards (glassmorphism, hover, shine, icons)
     7.  Footer
     8.  Accessibility (skip link, focus, reduced motion)
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS — edit the palette / sizes in one place
   ========================================================================== */
:root {
  /* Surfaces */
  --bg-deep:      #050310;   /* page base */
  --bg-panel:     #0b0620;   /* avatar "notch" color */

  /* Text */
  --text-1:       #f4f2ff;   /* primary */
  --text-2:       #a8a3c4;   /* secondary / muted */
  --text-faint:   rgba(168, 163, 196, 0.72);

  /* Accent gradient (used for the ring, glow, gradients) */
  --accent-1:     #8b5cf6;   /* violet */
  --accent-2:     #d946ef;   /* fuchsia */
  --accent-3:     #22d3ee;   /* cyan */

  /* Glass surfaces */
  --glass-bg:      rgba(255, 255, 255, 0.055);
  --glass-border:  rgba(255, 255, 255, 0.10);
  --glass-hover:   rgba(255, 255, 255, 0.10);
  --glass-border-hover: rgba(255, 255, 255, 0.20);

  /* Brand tints (icon chips) */
  --brand-instagram: #e1306c;
  --brand-whatsapp:  #25d366;
  --brand-website:   #8b5cf6;
  --brand-youtube:   #ff2d55;

  /* Shape & motion */
  --radius-card:  18px;
  --radius-chip:  14px;
  --container:    540px;
  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);   /* smooth "expo" ease */
  --dur:          0.35s;

  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono",
                Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: dark;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

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

ul {
  list-style: none;
}

/* ==========================================================================
   3. ANIMATED BACKGROUND
   A fixed, decorative layer: slowly panning gradient + three blurred
   "aurora" orbs + film grain + vignette. Purely visual (aria-hidden).
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-deep);
}

/* Slowly panning base gradient */
.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
              #0a0619 0%, #150b2e 28%, #1d0f3d 52%, #120826 76%, #0a0619 100%);
  background-size: 250% 250%;
  animation: bg-pan 24s ease-in-out infinite alternate;
}

@keyframes bg-pan {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* Blurred aurora blobs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.orb-1 {
  width: 46vmax; height: 46vmax;
  left: -14vmax; top: -16vmax;
  background: radial-gradient(circle at 35% 35%, rgba(139, 92, 246, 0.55), transparent 65%);
  animation: drift-1 26s ease-in-out infinite alternate;
}

.orb-2 {
  width: 40vmax; height: 40vmax;
  right: -12vmax; top: 20%;
  background: radial-gradient(circle at 60% 40%, rgba(217, 70, 239, 0.38), transparent 65%);
  animation: drift-2 32s ease-in-out infinite alternate;
}

.orb-3 {
  width: 44vmax; height: 44vmax;
  left: 16%; bottom: -18vmax;
  background: radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.22), transparent 65%);
  animation: drift-3 38s ease-in-out infinite alternate;
}

@keyframes drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, 7vmax) scale(1.15); }
}
@keyframes drift-2 {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-8vmax, 5vmax) scale(0.95); }
}
@keyframes drift-3 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vmax, -8vmax) scale(1.2); }
}

/* Subtle film grain (inline SVG noise — no extra requests) */
.bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Soft vignette to focus attention on the card column */
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(3, 2, 10, 0.6) 100%);
}

/* ==========================================================================
   4. PAGE LAYOUT & FADE-IN
   ========================================================================== */
.page {
  width: min(100% - 2.5rem, var(--container));   /* mobile-first fluid width */
  margin-inline: auto;
  padding: clamp(3rem, 9vh, 5.5rem) 0 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Entrance: fade + slight rise, once */
  opacity: 0;
  animation: page-in 1s var(--ease-out) forwards;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   5. PROFILE
   ========================================================================== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* --- Avatar with rotating conic-gradient ring + gentle float --- */
.avatar {
  position: relative;
  width: clamp(104px, 28vw, 124px);
  aspect-ratio: 1;
  margin-bottom: 1.4rem;
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* The ring is the rotating element; the photo sits on top of it */
.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg,
              var(--accent-1), var(--accent-2),
              var(--accent-3), var(--accent-1));
  animation: ring-spin 12s linear infinite;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.45));
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.avatar img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-panel);   /* creates the "notch" between ring & photo */
}

/* --- Name & bio --- */
.profile h1 {
  font-size: clamp(1.75rem, 7vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  /* Gradient text with a slow shimmer */
  background: linear-gradient(90deg,
              #ffffff 0%, #d8ccff 30%, #f3a7ff 60%, #ffffff 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

.profile p {
  margin-top: 0.45rem;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   6. LINK CARDS
   ========================================================================== */
.links {
  width: 100%;
  margin-top: 1.5rem;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
}

/* Staggered entrance: --i is set inline per item (0..3) */
.link-list > li {
  opacity: 0;
  animation: item-in 0.7s var(--ease-out) forwards;
  animation-delay: calc(200ms + var(--i) * 110ms);
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- The card itself --- */
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 72px;               /* large, touch-friendly target */
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-card);

  /* Glassmorphism */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);

  /* Depth: soft drop shadow + inner top highlight */
  box-shadow:
    0 10px 32px rgba(4, 2, 14, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  text-decoration: none;
  color: var(--text-1);
  overflow: hidden;               /* clips the shine sweep */

  transition:
    transform var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}

/* Hover: lift + brighten + brand glow */
.link-card:hover {
  transform: translateY(-3px);
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  box-shadow:
    0 16px 44px rgba(4, 2, 14, 0.5),
    0 0 28px rgba(139, 92, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* Tap feedback */
.link-card:active {
  transform: translateY(-1px) scale(0.985);
}

/* Keyboard focus — highly visible ring */
.link-card:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
  border-color: rgba(139, 92, 246, 0.5);
}

/* Light "shine" sweeping across the card on hover/focus */
.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
              transparent 40%, rgba(255, 255, 255, 0.09) 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease-out);
  pointer-events: none;
}

.link-card:hover::before,
.link-card:focus-visible::before {
  transform: translateX(130%);
}

/* --- Icon chip --- */
.icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-chip);
  font-size: 1.35rem;
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}

/* Brand tinting per card (keyed by data-key, same keys as CONFIG in JS) */
.link-card[data-key="instagram"] .icon { color: var(--brand-instagram); background: rgba(225, 48, 108, 0.14); }
.link-card[data-key="whatsapp"]  .icon { color: var(--brand-whatsapp);  background: rgba(37, 211, 102, 0.12); }
.link-card[data-key="website"]   .icon { color: var(--brand-website);   background: rgba(139, 92, 246, 0.15); }
.link-card[data-key="youtube"]   .icon { color: var(--brand-youtube);   background: rgba(255, 45, 85, 0.13); }

.link-card:hover .icon,
.link-card:focus-visible .icon {
  transform: scale(1.08) rotate(-4deg);
}

.link-card[data-key="instagram"]:hover .icon,
.link-card[data-key="instagram"]:focus-visible .icon { box-shadow: 0 0 20px rgba(225, 48, 108, 0.45); }
.link-card[data-key="whatsapp"]:hover .icon,
.link-card[data-key="whatsapp"]:focus-visible .icon  { box-shadow: 0 0 20px rgba(37, 211, 102, 0.4); }
.link-card[data-key="website"]:hover .icon,
.link-card[data-key="website"]:focus-visible .icon   { box-shadow: 0 0 20px rgba(139, 92, 246, 0.5); }
.link-card[data-key="youtube"]:hover .icon,
.link-card[data-key="youtube"]:focus-visible .icon   { box-shadow: 0 0 20px rgba(255, 45, 85, 0.45); }

/* --- Label --- */
.label {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --- Trailing chevron: slides in on hover/focus --- */
.arrow {
  margin-left: auto;
  color: var(--text-2);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.link-card:hover .arrow,
.link-card:focus-visible .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Touch devices have no hover: keep the chevron faintly visible */
@media (hover: none) {
  .arrow {
    opacity: 0.55;
    transform: translateX(0);
  }
  .link-card:hover { transform: none; }
}

/* --- Font Awesome offline fallback (see <link onerror> in index.html) --- */
.fa-fallback-icon { display: none; }

html.fa-fallback .fa-fallback-icon {
  display: inline-block;
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.2em;
}

html.fa-fallback .fa-icon { display: none; }

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer {
  margin-top: 2.75rem;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

/* ==========================================================================
   7.5 TRADING DETAILS — divider & ticker (all decorative)
   ========================================================================== */

/* --- Divider with three mini candles --- */
.market-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 320px);
  margin: 2.1rem auto 0;
}

.market-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.market-divider svg {
  width: 36px;
  height: 18px;
  opacity: 0.85;
}

/* --- Faint scrolling market tape --- */
.ticker {
  width: 100%;
  margin-top: 2.4rem;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.ticker-track {
  display: flex;
  /* NOTE: no gap/padding here — each item carries its own right margin,
     so the two identical halves have EXACTLY equal widths and the
     -50% translate loops seamlessly (gap/padding + border-box would
     break the seam and cause a visible jump). */
  width: max-content;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  opacity: 0.5;
  animation: ticker-scroll 42s linear infinite;
  will-change: transform;
}

.tk-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-right: 2.6rem;   /* spacing is per-item → seamless -50% loop */
  flex-shrink: 0;         /* items must never compress */
  white-space: nowrap;
}

.tk-item em {
  font-style: normal;
  font-weight: 700;
}

.tk-item em.up   { color: #34d399; }
.tk-item em.down { color: #f43f5e; }

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

/* ==========================================================================
   8. ACCESSIBILITY & POLISH
   ========================================================================== */
/* Skip link: visually hidden until focused */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  background: var(--accent-1);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.25s var(--ease-out);
}

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

/* Wider screens: slightly roomier cards */
@media (min-width: 640px) {
  .link-card { min-height: 78px; padding: 0.85rem 1.3rem; }
  .link-list { gap: 1rem; }
  .profile h1 { font-size: 2.3rem; }
}

/* Respect users who prefer reduced motion: freeze everything */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .page { opacity: 1; }                 /* make sure content is visible */
  .link-list > li { opacity: 1; }
  .avatar { animation: none; }
  .profile h1 { animation: none; }
}
