/* ==========================================================================
   Design System & Tokens - Hardware Meets Modern Web
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-core: #070a13;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-surface-elevated: rgba(30, 41, 59, 0.6);
  --bg-surface-hover: rgba(51, 65, 85, 0.5);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-focus: rgba(56, 189, 248, 0.4);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent Colors */
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);

  /* Typography Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Sizing */
  --card-max-width: 880px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(16px, 3vh, 32px) clamp(16px, 3vw, 32px);
}

/* ==========================================================================
   Ambient Background & Tech Micro-Grid
   ========================================================================== */

.background-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  top: 15%;
  left: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
}

.glow-2 {
  bottom: 15%;
  right: 20%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--accent-emerald-glow) 0%, transparent 70%);
}

/* ==========================================================================
   Profile Card Container
   ========================================================================== */

.card-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--card-max-width);
}

.profile-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5vw, 36px);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vh, 24px);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.profile-card:hover {
  border-color: rgba(148, 163, 184, 0.22);
}

/* ==========================================================================
   Status Header Bar
   ========================================================================== */

.card-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-emerald);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-led 2s infinite ease-in-out;
}

@keyframes pulse-led {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--accent-emerald);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.9);
    box-shadow: 0 0 4px var(--accent-emerald);
  }
}

.status-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.badge-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.card-hero {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 24px);
}

.avatar-container {
  flex-shrink: 0;
}

.avatar-frame {
  position: relative;
  width: clamp(70px, 9vw, 86px);
  height: clamp(70px, 9vw, 86px);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.avatar-inner {
  width: 86%;
  height: 86%;
  border-radius: calc(var(--radius-md) - 2px);
  background: #0d1527;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.avatar-icon {
  width: 52%;
  height: 52%;
}

/* Microcontroller IC Pin Details */
.pin-accents {
  position: absolute;
  display: flex;
  justify-content: space-between;
  width: 70%;
}

.pin-accents::before,
.pin-accents::after {
  content: '';
  width: 4px;
  height: 4px;
  background-color: var(--accent-cyan);
  border-radius: 1px;
  box-shadow: 0 0 6px var(--accent-cyan);
}

.pin-accents.top { top: -3px; }
.pin-accents.bottom { bottom: -3px; }

.hero-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.engineer-name {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.seniority-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.engineer-role {
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  color: var(--accent-cyan);
  font-weight: 500;
}

.engineer-bio {
  font-size: clamp(0.85rem, 1.1vw, 0.92rem);
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 2px;
}

/* ==========================================================================
   Technical Domains Matrix (Pillars)
   ========================================================================== */

.domains-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.5vw, 16px);
}

.domain-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(12px, 1.6vw, 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.domain-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.domain-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.3);
}

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

.domain-card[data-domain="frontend"]:hover {
  border-color: var(--border-focus);
  box-shadow: 0 8px 24px -8px var(--accent-cyan-glow);
}

.domain-card[data-domain="backend"]:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 24px -8px var(--accent-amber-glow);
}

.domain-card[data-domain="hardware"]:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 8px 24px -8px var(--accent-emerald-glow);
}

.domain-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.domain-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.icon-cyan {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.domain-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.domain-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  font-size: 0.73rem;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.domain-card:hover .tech-tag {
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
}

/* ==========================================================================
   Actions & Contact Footer
   ========================================================================== */

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.action-primary {
  background: var(--accent-cyan);
  color: #070a13;
  font-weight: 600;
  box-shadow: 0 4px 14px -3px var(--accent-cyan-glow);
}

.action-primary:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -3px rgba(56, 189, 248, 0.45);
}

.action-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.action-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-1px);
}

.social-links-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

.social-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
}

/* ==========================================================================
   Toast Feedback Notification
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: #0f172a;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-cyan-glow);
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  animation: toast-in-out 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in-out {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  15%, 85% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
  .domains-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-hero {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .title-row {
    justify-content: center;
  }

  .social-links-group {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    order: 3;
  }

  .card-actions-row {
    flex-direction: column;
    width: 100%;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Short viewport height tuning for perfect single-screen fit */
@media (min-height: 800px) and (min-width: 769px) {
  .profile-card {
    padding: 36px 40px;
  }
}
