:root {
  /* Palette - Surfaces */
  --surface-abyss: #050505;
  --surface-obsidian: #080706;
  --surface-charcoal: #0d0b09;
  --surface-card: #140f0c;
  --surface-card-active: #1c1410;

  /* Palette - Borders */
  --line-faint: rgba(74, 33, 23, 0.4);
  --line-warm: rgba(122, 50, 25, 0.5);
  --line-ember: rgba(214, 106, 42, 0.55);

  /* Palette - Accents */
  --ember-deep: #7a3219;
  --ember-rust: #a84a20;
  --ember-core: #d66a2a;
  --ember-bright: #ea833e;

  /* Typography Colors */
  --ink-primary: #f1e7dc;
  --ink-secondary: rgba(241, 231, 220, 0.75);
  --ink-muted: rgba(241, 231, 220, 0.45);

  /* Font Stacks */
  --type-display: 'Playfair Display', Georgia, serif;
  --type-ui: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --type-code: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Radii */
  --corner-sm: 8px;
  --corner-md: 14px;
  --corner-lg: 20px;
  --corner-round: 9999px;
}

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

html, body {
  min-height: 100vh;
  width: 100%;
}

body {
  font-family: var(--type-ui);
  background-color: var(--surface-abyss);
  color: var(--ink-primary);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ember-rust);
  color: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

/* ==========================================================================
   Atmospheric Layered Background
   ========================================================================== */

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 25%, rgba(74, 33, 23, 0.42) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(53, 25, 20, 0.35) 0%, transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(122, 50, 25, 0.25) 0%, transparent 50%),
    linear-gradient(180deg, #050505 0%, #0d0b09 50%, #080706 100%);
}

.film-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.ambient-mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 33, 23, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 33, 23, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 80%);
}

.floating-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(214, 106, 42, 0.7);
  box-shadow: 0 0 8px rgba(214, 106, 42, 0.8), 0 0 16px rgba(122, 50, 25, 0.5);
  pointer-events: none;
  animation: sparkRise 16s linear infinite;
}

@keyframes sparkRise {
  0% {
    transform: translateY(105vh) translateX(0) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.85;
  }
  85% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) translateX(50px) scale(1.1);
    opacity: 0;
  }
}

/* ==========================================================================
   Custom Precision Cursor
   ========================================================================== */

.precision-ring {
  position: fixed;
  left: -100px;
  top: -100px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(214, 106, 42, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  backdrop-filter: blur(1px);
}

.precision-dot {
  position: fixed;
  left: -100px;
  top: -100px;
  width: 6px;
  height: 6px;
  background: var(--ember-core);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--ember-core);
}

.precision-ring.is-active {
  width: 52px;
  height: 52px;
  border-color: var(--ember-bright);
  background: rgba(214, 106, 42, 0.08);
}

@media (pointer: coarse), (max-width: 768px) {
  .precision-ring,
  .precision-dot {
    display: none !important;
  }
}

/* ==========================================================================
   Shell & Layout Stage
   ========================================================================== */

.hub-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 1.5rem 2rem;
  position: relative;
  z-index: 1;
}

.hub-stage {
  width: 100%;
  max-width: 720px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.accent-divider {
  height: 1px;
  width: 260px;
  background: linear-gradient(90deg, transparent, rgba(214, 106, 42, 0.5), transparent);
  margin: 1.5rem auto;
}

.accent-divider--bottom {
  margin-top: 2.5rem;
}

/* ==========================================================================
   Identity & Avatar Ring
   ========================================================================== */

.identity-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ring-portrait {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, rgba(234, 131, 62, 0.5) 0%, rgba(214, 106, 42, 0.2) 100%);
  border: 2px solid var(--ember-core);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 24px rgba(234, 131, 62, 0.25);
  margin-bottom: 1.75rem;
  cursor: default;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  user-select: none;
  overflow: hidden;
}

.ring-portrait .portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 65%;
  transform: scale(1.75);
  transform-origin: 25% 60%;
  border-radius: 50%;
  display: block;
}

.ring-portrait:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: #ff9d5c;
  box-shadow: 0 14px 34px rgba(214, 106, 42, 0.5), 0 0 32px rgba(234, 131, 62, 0.45);
}

.ring-portrait:active {
  transform: scale(0.96);
}

@media (max-width: 540px) {
  .ring-portrait {
    width: 80px;
    height: 80px;
  }
}

.identity-title {
  font-family: var(--type-display);
  font-size: clamp(2.4rem, 6.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 0.85rem;
  color: var(--ember-core);
  cursor: default;
  user-select: none;
}

.wave-glyph {
  display: inline-block;
  transition: transform 0.25s ease, color 0.25s ease;
  will-change: transform;
}

.identity-title:hover .wave-glyph {
  animation: glyphWave 1.1s ease-in-out infinite;
  animation-delay: calc(var(--glyph-i) * 0.065s);
}

@keyframes glyphWave {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-11px) rotate(-2.5deg);
    color: var(--ember-bright);
  }
  75% {
    transform: translateY(6px) rotate(1.5deg);
  }
}

.wave-glyph:hover {
  transform: translateY(-14px) scale(1.12) !important;
  color: #ffffff !important;
  text-shadow: 0 0 16px rgba(234, 131, 62, 0.6);
}

.identity-role {
  font-family: var(--type-code);
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Social Grid & Glass Link Tiles
   ========================================================================== */

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 580px;
}

@media (max-width: 540px) {
  .social-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.link-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.65rem;
  background: rgba(20, 15, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--corner-md);
  text-decoration: none;
  color: var(--ink-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.link-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.7s ease;
}

.link-tile::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: 50%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle, rgba(234, 131, 62, 0.3) 0%, rgba(214, 106, 42, 0.1) 45%, transparent 70%);
  transform: translate(-50%, 50%) scale(0.2);
  opacity: 0;
  transition: transform 0.6s ease-out, opacity 0.4s ease-out;
  pointer-events: none;
  border-radius: 50%;
}

.link-tile:hover::before {
  left: 120%;
}

.link-tile:hover::after {
  transform: translate(-50%, -10%) scale(1);
  opacity: 1;
}

.link-tile:hover {
  transform: translateY(-9px) scale(1.04);
  border-color: var(--ember-core);
  border-top-color: rgba(255, 255, 255, 0.45);
  background: rgba(38, 24, 18, 0.8);
  box-shadow:
    0 22px 45px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(214, 106, 42, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  animation: tileFloat 2s ease-in-out infinite alternate;
}

@keyframes tileFloat {
  0% {
    transform: translateY(-9px) scale(1.04);
  }
  100% {
    transform: translateY(-12px) scale(1.048);
  }
}

.link-tile:active {
  transform: translateY(-3px) scale(0.98);
  animation: none;
}

.tile-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ember-core);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.link-tile:hover .tile-icon {
  transform: scale(1.22) rotate(5deg);
  color: var(--ember-bright);
}

.tile-label {
  font-family: var(--type-ui);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
  transition: color 0.2s ease;
  position: relative;
  z-index: 1;
}

.link-tile:hover .tile-label {
  color: #ffffff;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.hub-colophon {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-family: var(--type-code);
  margin-top: 2.5rem;
  letter-spacing: 0.05em;
}

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