/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* ---------- Ambient background ---------- */
#bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
  background-image: var(--gradient-mesh);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

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

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease-out), visibility 0.7s;
}

#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.preloader-ring {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  border-top-color: var(--accent-light);
  animation: preloaderSpin 1.4s linear infinite;
}

.preloader-logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  opacity: 0;
  transform: scale(0.86);
}

@keyframes preloaderSpin { to { transform: rotate(360deg); } }

.preloader-word {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
}

.preloader-progress {
  width: 180px;
  height: 2px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.preloader-progress-fill {
  width: 100%;
  height: 100%;
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: center;
}

/* CSS-only fallback timeline, used only if GSAP failed to load. */
#preloader.css-run .preloader-logo { animation: preloaderLogoIn 0.7s var(--ease-out) forwards 0.15s; }
#preloader.css-run .preloader-word { animation: preloaderWordIn 0.6s var(--ease-out) forwards 0.55s; }
#preloader.css-run .preloader-progress-fill { animation: preloaderFillIn 1.7s var(--ease-in-out) forwards 0.5s; }

@keyframes preloaderLogoIn { to { opacity: 1; transform: scale(1); } }
@keyframes preloaderWordIn { to { opacity: 1; transform: translateY(0); } }
@keyframes preloaderFillIn { to { transform: scaleX(1); } }

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 998;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  transition: opacity 0.2s;
}

.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid var(--border-strong);
  transition: width 0.25s var(--ease-spring), height 0.25s var(--ease-spring),
              border-color 0.25s, background 0.25s;
}

.cursor-ring.is-active {
  width: 60px; height: 60px;
  background: var(--accent-soft);
  border-color: var(--accent);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Navigation ---------- */
#navbar {
  position: fixed;
  top: 0; inset-inline: 0;
  z-index: 60;
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-shell {
  position: absolute;
  inset: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
  backdrop-filter: blur(0px);
}

#navbar.scrolled .nav-shell {
  background: rgba(5, 7, 13, 0.72);
  border-color: var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

.brand img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring);
}

.brand img:hover { transform: scale(1.08) rotate(6deg); }

.nav-links {
  display: flex;
  gap: var(--space-1);
  position: relative;
  z-index: 1;
}

/* ---------- Liquid glass nav pill ---------- */
/* A soft glass capsule that morphs (width + position) to sit behind
   whichever link is active — navigation.js measures the active link's
   physical offsetLeft/offsetWidth in JS and writes them here, which stays
   correct under RTL since nothing here is a logical property being
   authored, only a measured pixel value being read. */
.nav-pill {
  position: absolute;
  top: 2px;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02)),
              var(--surface-glass);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-glow-soft), inset 0 1px 0 rgba(255,255,255,0.08);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease-spring), width 0.55s var(--ease-spring), opacity 0.3s var(--ease-out);
}

.nav-links a {
  position: relative;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* The underline only decorates hover now — the pill itself is the "active"
   signal, so a persistent underline on top of it would be visual noise. */
.nav-links a:not(.active)::after {
  content: '';
  position: absolute;
  left: var(--space-3); right: var(--space-3);
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--dur-fast) var(--ease-out);
}

.nav-links a:not(.active):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 1;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text);
  transition: transform var(--dur-fast), opacity var(--dur-fast);
  position: relative;
}

.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  inset-inline: 0;
  background: rgba(5, 7, 13, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4) var(--space-5);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 55;
}

.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }

.mobile-menu a {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-md);
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--fs-sm);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--accent-ink);
  box-shadow: var(--shadow-glow);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: translateX(-120%) skewX(-15deg);
  transition: transform 0.6s var(--ease-out);
}

.btn-primary:hover::before { transform: translateX(120%) skewX(-15deg); }
.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Glass surfaces ---------- */
.glass {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
}

.card-tilt {
  transition: border-color var(--dur-fast);
  transform-style: preserve-3d;
  will-change: transform;
}
.card-tilt.is-settling { transition: transform 0.6s var(--ease-spring), border-color var(--dur-fast); }
.card-tilt:hover { border-color: var(--border-strong); }

/* ---------- Cursor-tracking spotlight (glass surfaces) ---------- */
.glass { position: relative; }

.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}

.glass:hover::after { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .glass::after { display: none; }
}

/* ---------- Social / icon row ---------- */
.social-row { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; }

.social-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.05rem;
  transition: all var(--dur-fast) var(--ease-spring);
}

.social-icon:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(98, 132, 193, 0.35);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero-avatar {
  width: 128px; height: 128px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-glow);
  margin-bottom: var(--space-3);
}

.hero-avatar .float { width: 100%; height: 100%; }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-name {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1;
}

.hero-name .word { display: inline-block; }

.hero-role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-md);
  color: var(--text-muted);
  min-height: 1.6em;
}

.hero-role .cursor-blink {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  margin-inline-start: 4px;
  vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; justify-content: center; }

.scroll-cue {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
  transition-delay: 1s;
}

body.hero-ready .scroll-cue { opacity: 1; }

.scroll-cue .line { width: 1px; height: 32px; background: linear-gradient(to bottom, var(--accent), transparent); animation: scrollLine 1.8s ease-in-out infinite; }

@keyframes scrollLine { 0%,100% { transform: scaleY(0.5); opacity: 0.5; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- Stat cards ---------- */
.stat-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

/* ---------- About portrait ---------- */
.portrait-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.portrait-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-brand);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.7;
}

.portrait-frame img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: transform 0.6s var(--ease-out);
}

.portrait-frame:hover img { transform: scale(1.04); }

/* ---------- Skills ---------- */
.skill-row { margin-bottom: var(--space-4); }

.skill-row-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  margin-bottom: var(--space-1);
}

.skill-row-head .pct { font-family: var(--font-mono); color: var(--accent); }

.skill-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  transition: width 1.4s var(--ease-out);
}

.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }

.tool-chip {
  padding: var(--space-3) var(--space-1);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  transition: transform var(--dur-fast) var(--ease-spring), color var(--dur-fast), border-color var(--dur-fast);
}

.tool-chip i { font-size: 1.5rem; color: var(--text); }
.tool-chip:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--text); }

/* ---------- Projects ---------- */
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.5s var(--ease-out), border-color var(--dur-fast);
}

/* Depth Stack: the bento grid already stacks cards on a real z-axis
   (see .projects-grid), this just sells that depth further on hover. */
.project-card:hover {
  box-shadow: var(--shadow-lg), 0 30px 70px -30px var(--accent-glow);
}

/* Aurora Glow: a thin conic-gradient ring, masked down to just the border
   itself (so the glass card underneath stays untouched), slowly spinning.
   `overflow: hidden` on .project-card clips it flush to the rounded corners. */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from 0deg, var(--accent-light), var(--warm), var(--accent-dim), var(--accent-light));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  animation: auroraSpin 7s linear infinite;
  animation-play-state: paused;
  transition: opacity 0.6s var(--ease-out);
}

.project-card:hover::before {
  opacity: 0.9;
  animation-play-state: running;
}

@keyframes auroraSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .project-card::before { animation: none; }
}

.project-card .media {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.project-card .media img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
  transition: transform 0.7s var(--ease-out);
}

.project-card:hover .media img { transform: scale(1.08); }

.project-card .media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,7,13,0.95) 10%, rgba(5,7,13,0.15) 60%);
}

.project-card .body {
  position: relative;
  z-index: 1;
  padding: var(--space-4);
  margin-top: auto;
}

.project-card .status {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(5,7,13,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
}

.project-card .status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent-glow);
}

.project-card h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.project-card p { font-size: var(--fs-sm); margin-bottom: var(--space-3); }

.project-card .link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--accent-light);
}

.project-card .link i { transition: transform var(--dur-fast) var(--ease-spring); }
.project-card:hover .link i { transform: translateX(-4px); }

/* ---------- Experience timeline ---------- */
.timeline-item {
  position: relative;
  padding-block: var(--space-2);
  padding-inline-end: var(--space-3);
}

.timeline-item::before {
  content: '';
  position: absolute;
  inset-inline-start: -30px;
  top: 22px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px var(--accent);
}

.timeline-card { padding: var(--space-4); border-radius: var(--radius-md); }
.timeline-head { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: 4px; }
.timeline-year { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xs); color: var(--accent-light); }
.timeline-org { color: var(--accent-deep); font-size: var(--fs-sm); margin-bottom: var(--space-1); }

/* ---------- Contact ---------- */
.contact-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  height: 100%;
}

.contact-tile .icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand);
  color: var(--accent-ink);
  font-size: 1.1rem;
}

.contact-tile h3 { font-size: var(--fs-sm); }
.contact-tile span { font-size: var(--fs-xs); color: var(--text-muted); word-break: break-all; }

.contact-tile:hover { border-color: var(--accent); transform: translateY(-3px); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-6);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.tech-chips { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: center; }

.tech-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

/* ---------- Section dots ---------- */
#section-dots {
  position: fixed;
  inset-inline-end: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  transition: all var(--dur-fast) var(--ease-spring);
}

.dot.active { background: var(--accent); border-color: var(--accent); transform: scale(1.3); box-shadow: 0 0 10px var(--accent); }

@media (max-width: 900px) { #section-dots { display: none; } }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  bottom: var(--space-4);
  inset-inline-end: var(--space-4);
  z-index: 40;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--dur-fast) var(--ease-spring);
}

#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sound toggle ---------- */
/* Restored click-sound feature from the old version, but — unlike the old
   version — genuinely optional: sits quietly above the back-to-top button
   and only appears once there's something to scroll back up to. */
#sound-toggle {
  position: fixed;
  bottom: calc(var(--space-4) + 46px + var(--space-2));
  inset-inline-end: var(--space-4);
  z-index: 40;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--dur-fast) var(--ease-spring);
}

#back-to-top.show ~ #sound-toggle { opacity: 1; visibility: visible; transform: translateY(0); }

#sound-toggle:hover { border-color: var(--accent); color: var(--accent); }

#sound-toggle .fa-volume-mute { display: none; }
#sound-toggle.is-muted .fa-volume-up { display: none; }
#sound-toggle.is-muted .fa-volume-mute { display: inline-block; }

/* ---------- Contact FAB ---------- */
#contact-fab-items {
  position: fixed;
  bottom: 5.2rem;
  inset-inline-start: var(--space-4);
  z-index: 41;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
}

.fab-item {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translateY(14px) scale(0.6);
  transition: all var(--dur-fast) var(--ease-spring);
  pointer-events: none;
  position: relative;
}

.fab-item.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.fab-item::before {
  content: attr(data-tooltip);
  position: absolute;
  inset-inline-end: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur-fast);
}

.fab-item:hover::before { opacity: 1; visibility: visible; }

#contact-fab {
  position: fixed;
  bottom: var(--space-4);
  inset-inline-start: var(--space-4);
  z-index: 42;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast) var(--ease-spring);
}

#contact-fab.active { border-color: var(--accent); color: var(--accent); }
#contact-fab i { transition: transform var(--dur-base) var(--ease-spring); }
#contact-fab.active i { transform: rotate(135deg); }
