/* ==========================================================================
   Abanoub Harby — Personal Hub & Linktree Portfolio
   Atmospheric Minimalism & High-Craft UI (Dark / Light Adaptive)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-base: #08090e;
  --bg-elevated: rgba(17, 20, 31, 0.72);
  --bg-card: rgba(22, 26, 40, 0.65);
  --bg-card-hover: rgba(30, 35, 54, 0.85);
  --bg-pill: rgba(255, 255, 255, 0.045);

  --text-primary: #f4f6fb;
  --text-secondary: #9ba3b8;
  --text-muted: #646d84;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);

  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.25);
  --accent-secondary: #14b8a6;
  --accent-secondary-glow: rgba(20, 184, 166, 0.2);

  --orb-1: rgba(99, 102, 241, 0.18);
  --orb-2: rgba(20, 184, 166, 0.14);
  --grid-color: rgba(255, 255, 255, 0.025);

  --shadow-card: 0 20px 50px -12px rgba(0, 0, 0, 0.65),
                 0 0 0 1px var(--border-subtle);
  --shadow-link: 0 4px 20px -2px rgba(0, 0, 0, 0.35);

  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-base: #f6f8fc;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-pill: rgba(15, 23, 42, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);

  --accent-primary: #4f46e5;
  --accent-primary-glow: rgba(79, 70, 229, 0.14);
  --accent-secondary: #0d9488;
  --accent-secondary-glow: rgba(13, 148, 136, 0.14);

  --orb-1: rgba(99, 102, 241, 0.12);
  --orb-2: rgba(20, 184, 166, 0.1);
  --grid-color: rgba(15, 23, 42, 0.03);

  --shadow-card: 0 20px 45px -15px rgba(15, 23, 42, 0.08),
                 0 0 0 1px var(--border-subtle);
  --shadow-link: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 1.25rem 1rem 3rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   Ambient Background
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 480px;
  height: 480px;
  background: var(--orb-1);
  top: -140px;
  left: calc(50% - 340px);
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: var(--orb-2);
  bottom: -120px;
  right: calc(50% - 340px);
  animation-delay: -9s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 100%);
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(35px, 25px) scale(1.08);
  }
}

/* ==========================================================================
   Top Utility Bar
   ========================================================================== */

.top-bar {
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  animation: fadeDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulseDot 2.4s infinite;
}

@keyframes pulseDot {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05);
  }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* ==========================================================================
   Main Hub Container & Glass Panels
   ========================================================================== */

.hub-container {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.glass-panel {
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 1.65rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================================================
   Hero Profile Card
   ========================================================================== */

.profile-card {
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.85;
  z-index: 0;
}

.avatar-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
  display: block;
  background: #131726;
}

.avatar-monogram {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 19px;
  background: linear-gradient(145deg, #131726, #0b0d16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  color: #f8fafc;
  user-select: none;
}

.avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.role-tag {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-secondary);
  background: var(--accent-secondary-glow);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.15rem;
}

.profile-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.profile-handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Fun Bio Summary Box */
.bio-box {
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}

.bio-text {
  font-size: 0.94rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.55rem;
}

.bio-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.highlight {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
}

/* Metrics Row */
.metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.25rem;
}

.metric-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.metric-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

/* ==========================================================================
   Primary Redirect Links (Linktree Style)
   ========================================================================== */

.links-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-left: 0.35rem;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-link);
  text-decoration: none;
  color: var(--text-primary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease,
              background-color 0.22s ease,
              box-shadow 0.22s ease;
}

/* Mouse spotlight hover overlay */
.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--accent-primary-glow),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.link-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.link-card:active {
  transform: translateY(0);
}

.link-icon {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.link-card:hover .link-icon {
  transform: scale(1.06);
}

.linkedin-icon {
  background: rgba(10, 102, 194, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

[data-theme="light"] .linkedin-icon {
  background: rgba(10, 102, 194, 0.1);
  color: #0a66c2;
  border-color: rgba(10, 102, 194, 0.2);
}

.github-icon {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .github-icon {
  background: rgba(15, 23, 42, 0.06);
}

.email-icon {
  background: var(--accent-secondary-glow);
  color: var(--accent-secondary);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.link-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.link-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.link-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.link-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-pill);
  padding: 0.1rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.link-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-action {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.shortcut-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-pill);
  color: var(--text-muted);
}

.arrow-icon {
  transition: transform 0.22s ease, color 0.22s ease;
}

.link-card:hover .arrow-icon {
  transform: translate(2px, -2px);
  color: var(--text-primary);
}

/* Email Card Special Layout */
.email-card-wrapper {
  padding: 0.75rem 1rem 0.75rem 1.15rem;
}

.email-main-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0;
}

.copy-pill-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.48rem 0.78rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-pill);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.copy-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-secondary);
  background: var(--accent-secondary-glow);
}

/* ==========================================================================
   Interactive Details Section (Tech Arsenal & Career Journey)
   ========================================================================== */

.details-section {
  padding: 1.35rem 1.5rem;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.tabs-header {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-pill);
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.2rem;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.75rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-panel {
  animation: fadeIn 0.25s ease;
}

/* Tech Arsenal Tags */
.stack-group {
  margin-bottom: 1rem;
}

.stack-group:last-child {
  margin-bottom: 0;
}

.stack-category {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.18s ease;
}

.skill-tag:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.skill-tag.primary {
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .skill-tag.primary {
  color: #4f46e5;
}

.skill-tag.accent {
  color: #2dd4bf;
  border-color: rgba(20, 184, 166, 0.28);
  background: rgba(20, 184, 166, 0.1);
}

[data-theme="light"] .skill-tag.accent {
  color: #0d9488;
}

/* Career Timeline */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-left: 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 9px;
  width: 1px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  padding-left: 1.35rem;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-base);
}

.timeline-item.current .timeline-marker {
  background: var(--accent-secondary);
  box-shadow: 0 0 0 3px var(--accent-secondary-glow);
}

.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.timeline-company {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.timeline-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Footer & Toast
   ========================================================================== */

.hub-footer {
  text-align: center;
  padding: 0.5rem 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.hub-footer kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-pill);
  color: var(--text-secondary);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 20px);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: #10b981;
  color: #052e16;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Animations & Responsive
   ========================================================================== */

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

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .glass-panel {
    padding: 1.25rem;
  }

  .link-desc {
    white-space: normal;
  }

  .shortcut-hint,
  .hub-footer kbd {
    display: none;
  }

  .email-card-wrapper {
    flex-wrap: wrap;
  }

  .copy-pill-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.35rem;
  }
}
