/* ==========================================================================
   Kadon - Senior Mobile Developer & RF Tech Explorer
   iOS Glassmorphism & Modern Flat Design System
   ========================================================================== */

:root {
  /* Dark Glass Canvas Colors */
  --bg-dark-base: #07090e;
  --bg-dark-surface: rgba(15, 22, 36, 0.65);
  --bg-dark-surface-hover: rgba(24, 34, 54, 0.75);
  --bg-dark-card: rgba(255, 255, 255, 0.04);
  --bg-dark-pill: rgba(255, 255, 255, 0.08);

  /* iOS & RF Accents */
  --accent-blue: #0a84ff;
  --accent-cyan: #38bdf8;
  --accent-emerald: #34c759;
  --accent-amber: #ff9f0a;
  --accent-purple: #af52de;
  --accent-pink: #ff2d55;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Glass Styling */
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --glass-border-light: 1px solid rgba(255, 255, 255, 0.18);
  --glass-border-active: 1px solid rgba(56, 189, 248, 0.4);
  --glass-blur: blur(20px) saturate(180%);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  --glass-shadow-hover: 0 20px 48px 0 rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.25);
  
  /* Radii */
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, monospace;
}

/* --------------------------------------------------------------------------
   Global Reset & Base Setup
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Ambient Canvas Glow Effects */
body::before {
  content: "";
  position: fixed;
  top: -10vw;
  left: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -10vw;
  right: -10vw;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(52, 199, 89, 0.12) 0%, rgba(175, 82, 222, 0.08) 50%, rgba(0, 0, 0, 0) 75%);
  z-index: -2;
  pointer-events: none;
}

/* Background Noise Grid Texture */
.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* --------------------------------------------------------------------------
   iOS Glass Component Classes
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-dark-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-xl);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-shadow-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

.glass-pill {
  background: var(--bg-dark-pill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Dynamic Status LED Dot */
.status-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  display: inline-block;
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.status-pulse.amber {
  background-color: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

/* --------------------------------------------------------------------------
   Header & Floating Navigation Bar
   -------------------------------------------------------------------------- */
.navbar-floating {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1040px;
  z-index: 1000;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(12, 17, 29, 0.78);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border: var(--glass-border-light);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.nav-brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link-ios {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link-ios:hover,
.nav-link-ios.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
}

/* iOS Primary Squircle Buttons */
.btn-ios-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0066cc 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ios-primary:hover {
  background: linear-gradient(135deg, #2b93ff 0%, #0077ed 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.5);
}

.btn-ios-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ios-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: 140px;
  padding-bottom: 60px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.profile-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--bg-dark-base);
  border: var(--glass-border-light);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 720px;
  font-weight: 400;
  margin-bottom: 28px;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: background 0.2s;
}

.tag-badge:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* --------------------------------------------------------------------------
   Radio Wave Canvas Widget
   -------------------------------------------------------------------------- */
.canvas-container {
  width: 100%;
  height: 70px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

canvas#radioWaveCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   Specialties Cards (3 Pillars)
   -------------------------------------------------------------------------- */
.pillar-card {
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pillar-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.pillar-icon.mobile {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(10, 132, 255, 0.3);
}

.pillar-icon.radio {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.pillar-icon.mesh {
  background: rgba(175, 82, 222, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(175, 82, 222, 0.3);
}

.pillar-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Meshtatic Telemetry & Node Ping Simulator Widget
   -------------------------------------------------------------------------- */
.mesh-widget-box {
  background: rgba(10, 15, 26, 0.85);
  border-radius: var(--radius-xl);
  border: var(--glass-border-active);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 28px;
}

.node-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.telemetry-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.telemetry-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.telemetry-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Mesh Topology Graph Animation */
.mesh-nodes-visualizer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 30px 10px;
  margin: 20px 0;
}

.mesh-node-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 2;
  position: relative;
  transition: all 0.3s ease;
}

.mesh-node-dot.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
}

.mesh-link-line {
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.mesh-packet-pulse {
  position: absolute;
  top: calc(50% - 6px);
  left: 30px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
  z-index: 3;
  opacity: 0;
}

/* Terminal Log View */
.mesh-log-terminal {
  background: #04060a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #34d399;
  height: 110px;
  overflow-y: auto;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Projects & Portfolio
   -------------------------------------------------------------------------- */
.project-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-thumb-box {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb-icon {
  font-size: 3.5rem;
  opacity: 0.85;
  transition: transform 0.3s ease;
}

.project-card:hover .project-thumb-icon {
  transform: scale(1.1);
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 20px;
}

/* Filter Segmented Control */
.filter-segmented-bar {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Amateur Radio & Mesh Specs Stats Section
   -------------------------------------------------------------------------- */
.stat-card {
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Modals (iOS Sheet Style)
   -------------------------------------------------------------------------- */
.modal-content.glass-modal {
  background: rgba(15, 22, 38, 0.92);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: var(--glass-border-light);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  color: var(--text-primary);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 28px;
}

.modal-body {
  padding: 28px;
}

.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 80px;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Responsive Design Fixes
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  .navbar-floating {
    top: 10px;
    width: calc(100% - 20px);
    padding: 6px 12px;
  }
  .nav-link-ios {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  .hero-section {
    padding-top: 110px;
  }
}
