/* ==========================================================================
   CAMO — Design System
   Twitch purple primary, warm beige/gold secondary (used sparingly), near-black base.
   ========================================================================== */

:root {
  /* Brand */
  --color-primary: #9147ff;
  --color-primary-hover: #a970ff;
  --color-primary-muted: rgba(145, 71, 255, 0.16);

  /* Secondary accent — warm beige/gold, sparing use only (Obscura touches, focus rings) */
  --color-secondary: #c9a876;
  --color-secondary-hover: #dcc090;
  --color-secondary-muted: rgba(201, 168, 118, 0.16);

  /* Surfaces */
  --color-bg: #0a0a0a;
  --color-bg-gradient: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(145, 71, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 100% 50% at 50% 110%, rgba(201, 168, 118, 0.06), transparent 60%), var(--color-bg);
  --color-surface: #151318;
  --color-surface-hover: #1e1a24;
  --color-border: rgba(255, 255, 255, 0.08);

  /* Text */
  --color-text: #f5f3ef;
  --color-text-muted: #a79e90;

  /* Typography */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --max-width: 480px;

  /* Effects */
  --shadow-primary-glow: 0 0 0 1px var(--color-primary-muted), 0 8px 24px rgba(145, 71, 255, 0.2);
  --grain-opacity: 0.05;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--color-bg-gradient);
  color: var(--color-text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* Subtle grain texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.hub {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  padding: 40px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  position: relative;
  text-align: center;
  margin-bottom: 28px;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  top: 44px;
  left: 50%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(145, 71, 255, 0.55), rgba(145, 71, 255, 0) 70%);
  filter: blur(36px);
  transform: translate(-50%, -50%) scale(1);
  animation: hero-glow-pulse 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hero-glow-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.18);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow {
    animation: none;
  }
}

.avatar-frame {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto;
}

.avatar,
.avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  box-shadow: 0 0 0 4px var(--color-primary-muted), 0 8px 24px rgba(145, 71, 255, 0.18);
}

.avatar {
  object-fit: cover;
  background: var(--color-surface);
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-surface), var(--color-surface-hover));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--color-primary);
  visibility: hidden;
}

.avatar.is-broken {
  visibility: hidden;
}

.avatar.is-broken + .avatar-fallback {
  visibility: visible;
}

.wordmark {
  margin: 18px 0 6px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(145, 71, 255, 0.35);
}

.tagline {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.link-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary-glow);
  transform: scale(1.02) translateY(-1px);
}

.link-card:active {
  transform: scale(0.99);
}

.link-card:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.link-primary {
  background: linear-gradient(135deg, var(--color-primary), #7c2ff0);
  border-color: var(--color-primary);
  color: #fff;
  font-size: 1.05rem;
  padding: 19px 24px;
  box-shadow: 0 0 0 1px rgba(145, 71, 255, 0.4), 0 10px 30px rgba(145, 71, 255, 0.35);
}

.link-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), #8b3ffb);
  box-shadow: 0 0 0 1px rgba(145, 71, 255, 0.55), 0 14px 36px rgba(145, 71, 255, 0.5);
  transform: scale(1.03) translateY(-2px);
}

.contact {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
}

.contact-link:hover {
  color: var(--color-secondary);
  border-color: var(--color-secondary);
  background: var(--color-secondary-muted);
}

.contact-link:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.footer-wordmark {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.footer-easter-egg {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-style: italic;
  opacity: 0.6;
}

/* Scroll-in entrance animation, driven by IntersectionObserver toggling .is-visible */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Tablet and up */
@media (min-width: 600px) {
  .hub {
    padding: 64px 24px 48px;
  }

  .avatar-frame {
    width: 104px;
    height: 104px;
  }

  .wordmark {
    font-size: 2rem;
  }

  .link-card {
    padding: 17px 24px;
    font-size: 1rem;
  }

  .links-grid {
    grid-template-columns: 1fr 1fr;
  }
}
