/*
  Rahul Karkera — Premium Links
  Design language: minimalist, high-contrast, Apple/Stripe-inspired
*/

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

/* Typography & Theme Tokens */
:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';

  /* Light theme */
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --text: #0a0a0a;
  --muted: #5f6368;
  --card: rgba(255,255,255,0.7);
  --border: rgba(10,10,10,0.08);
  --shadow: 0 2px 10px rgba(10,10,10,0.06), 0 12px 24px rgba(10,10,10,0.06);

  /* Accent gradient */
  --accent-1: #5b8cff;
  --accent-2: #7a5af8;
  --accent-3: #2dd4bf;
  --accent: linear-gradient(135deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --container-w: 840px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --bg-elev: #121216;
    --text: #f5f5f7;
    --muted: #a1a1aa;
    --card: rgba(18,18,22,0.6);
    --border: rgba(255,255,255,0.09);
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0f;
  --bg-elev: #121216;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --card: rgba(18,18,22,0.6);
  --border: rgba(255,255,255,0.09);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --text: #0a0a0a;
  --muted: #5f6368;
  --card: rgba(255,255,255,0.7);
  --border: rgba(10,10,10,0.08);
  --shadow: 0 2px 10px rgba(10,10,10,0.06), 0 12px 24px rgba(10,10,10,0.06);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* Background layers */
.bg-layers {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vw 60vw at 100% -20%, rgba(91,140,255,0.18), transparent 55%),
    radial-gradient(60vw 60vw at -20% 0%, rgba(122,90,248,0.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  filter: saturate(115%);
}

.bg-layers::before,
.bg-layers::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28; pointer-events: none; mix-blend-mode: plus-lighter;
  animation: floatGlow 16s ease-in-out infinite alternate;
}
.bg-layers::before { left: -10vmax; top: -8vmax; background: radial-gradient(circle at 30% 30%, rgba(91,140,255,0.6), transparent 60%); }
.bg-layers::after { right: -12vmax; bottom: -10vmax; background: radial-gradient(circle at 70% 70%, rgba(45,212,191,0.5), transparent 60%); animation-duration: 18s; }

@keyframes floatGlow {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(4%, -3%, 0) scale(1.05); }
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* Hero */
.hero { text-align: center; padding: 24px 0 12px; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar {
  width: 128px; height: 128px; object-fit: cover; border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-elev);
}
.status-dot {
  position: absolute; right: 6px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 4px var(--bg);
}
.hero h1 { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 14px 0 6px; }
.subhead { color: var(--muted); margin: 0 auto 12px; max-width: 40ch; }
.hero-ctas { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elev); color: var(--text); padding: 10px 16px; font-weight: 600;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: var(--shadow);
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: white; border: none; }
.btn.ghost { background: var(--bg-elev); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(91,140,255,.5); outline-offset: 2px; }

/* Links Grid */
.links { display: grid; gap: 14px; margin: 26px 0 10px; }
.link-card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.link-card > summary { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 16px; padding: 16px; list-style: none; cursor: pointer; }
.link-card > summary::-webkit-details-marker { display: none; }
.link-card .icon { width: 32px; height: 32px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); display: grid; place-items: center; }
.link-card .icon i { font-size: 18px; color: var(--brand); }
.link-card .meta strong { font-weight: 700; }
.link-card .meta span { color: var(--muted); font-size: 14px; }
.link-card .cta { color: #3b82f6; font-weight: 700; text-decoration: none; }
.link-card:hover { transform: translateY(-2px); border-color: rgba(91,140,255,0.35); box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.08); }
.link-card:active { transform: translateY(0); }
.link-card[open] > .preview { padding: 12px; border-top: 1px solid var(--border); background: var(--bg-elev); display: grid; place-items: center; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.link-card[open] > .preview .ratio { margin: 4px 0; max-width: 780px; width: 100%; }
.link-card[open] > .preview .instagram-media,
.link-card[open] > .preview .tiktok-embed,
.link-card[open] > .preview .linkedin-badge { max-width: 780px; width: 100%; border-radius: 12px; }

  /* Brand accents */
  .link-card.linkedin { --brand: #0a66c2; }
  .link-card.youtube { --brand: #ff0033; }
  .link-card.instagram { --brand: #d62976; }
  .link-card.tiktok { --brand: #00f2ea; }
  .link-card.snapchat { --brand: #fffc00; }
  .link-card.website { --brand: #0ea5e9; }
  .link-card .icon { background: radial-gradient(circle at 30% 30%, var(--brand), transparent 60%), var(--bg-elev); }

  /* Aspect ratio utility */
  .ratio { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000; }
  .ratio iframe { width: 100%; height: 100%; display: block; border: 0; }

  /* Image preview (generic website) */
  .image-preview {
    max-width: 780px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--bg-elev);
  }

  /* Clickable image link wrapper */
  .image-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
  }

 /* LinkedIn badge wrapper for rounded look */
 .linkedin-badge { background: var(--bg-elev); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
 :root[data-theme="dark"] .linkedin-badge { filter: brightness(0.95); }

 [hidden] { display: none !important; }
 .modal { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; background: rgba(0,0,0,0.45); backdrop-filter: blur(8px) saturate(120%); }
 .modal-dialog { width: min(960px, 92vw); max-height: 88vh; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; position: relative; }
 .modal-content { padding: 0; }
 .modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }

/* Media accordion (for dropdown embeds) */
.media { margin-top: 24px; }
.media-accordion { border-radius: var(--radius-xl); overflow: clip; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.media-accordion > summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 700; display: flex; align-items: center; }
.media-accordion > summary::-webkit-details-marker { display: none; }
.media-accordion > summary::after { content: "\25BC"; margin-left: auto; font-size: 12px; opacity: .7; transition: transform .2s ease; }
.media-accordion[open] > summary { border-bottom: 1px solid var(--border); }
.media-accordion[open] > summary::after { transform: rotate(180deg); }
.media-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 12px; }

/* Footer */
.footer { text-align: center; color: var(--muted); margin-top: 24px; }

/* Responsive */
@media (min-width: 560px) {
  .media-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .media-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
