/* Portfolio Stylesheet - Arthur Clark (Pxnzerr) */

:root {
  /* Colors */
  --bg-main: #070408;
  --bg-surface: rgba(26, 12, 18, 0.7);
  --bg-surface-hover: rgba(42, 18, 28, 0.85);
  --bg-card: rgba(22, 10, 16, 0.68);
  --bg-pill: rgba(28, 12, 20, 0.78);
  --bg-tag: rgba(45, 18, 30, 0.85);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-highlight: #ffffff;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(225, 29, 72, 0.35);
  --border-active: rgba(255, 255, 255, 0.25);
  
  --accent-red: #e11d48;
  --accent-crimson: #ff1e56;
  --accent-ruby: #be123c;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  
  /* Ambient Background Glows */
  --glow-ambient-1: radial-gradient(circle at 15% 15%, rgba(225, 29, 72, 0.24) 0%, rgba(244, 63, 94, 0.12) 30%, transparent 65%);
  --glow-ambient-2: radial-gradient(circle at 85% 20%, rgba(190, 18, 60, 0.22) 0%, rgba(136, 19, 55, 0.1) 40%, transparent 70%);
  --glow-ambient-3: radial-gradient(circle at 50% 45%, rgba(255, 30, 86, 0.18) 0%, rgba(159, 18, 57, 0.08) 35%, transparent 65%);
  --glow-ambient-4: radial-gradient(circle at 80% 80%, rgba(225, 29, 72, 0.2) 0%, rgba(120, 10, 40, 0.08) 45%, transparent 65%);
  --glow-ambient-5: radial-gradient(circle at 20% 85%, rgba(159, 18, 57, 0.18) 0%, transparent 55%);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Transitions & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark;
}

body {
  background-color: var(--bg-main);
  background-image: 
    var(--glow-ambient-1),
    var(--glow-ambient-2),
    var(--glow-ambient-3),
    var(--glow-ambient-4),
    var(--glow-ambient-5);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #080b12;
}
::-webkit-scrollbar-thumb {
  background: #1f293d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-highlight);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   FLOATING NAVBAR (PILL GLASSMORPHISM)
   ========================================================================== */
.header-nav {
  position: fixed;
  top: 1.25rem;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.nav-wrapper {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(20, 8, 14, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(225, 29, 72, 0.2);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.1) inset;
  padding: 0.45rem 0.6rem 0.45rem 1.25rem;
  border-radius: var(--radius-full);
  max-width: 900px;
  width: 100%;
  transition: var(--transition-normal);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.status-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot-red { background: #ff1e56; box-shadow: 0 0 8px #ff1e56; }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-green { background: #10b981; box-shadow: 0 0 8px #10b981; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link i, .nav-link svg {
  font-size: 0.9rem;
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.nav-link:hover {
  color: #fff;
  background: rgba(225, 29, 72, 0.15);
}

.nav-link.active {
  background: #ffffff;
  color: #0b0f19;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.35);
}

.nav-link.active svg {
  stroke: #0b0f19;
}

/* Mobile Hamburger */
.mobile-toggle {
  display: none;
  background: none;
  color: #fff;
  padding: 0.5rem;
  font-size: 1.25rem;
}

/* ==========================================================================
   HERO SECTION ("HELLO!")
   ========================================================================== */
.hero-section {
  padding-top: 8.5rem;
  padding-bottom: 4.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 40%, #9ca3af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-bio strong {
  color: var(--text-highlight);
  font-weight: 600;
}

/* Social & Contact Cards Grid */
.hero-contacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.7), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.contact-card:hover {
  transform: translateY(-3px);
  background: var(--bg-surface-hover);
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(225, 29, 72, 0.2);
}

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

.contact-icon {
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
}

.contact-card span.label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-card span.value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-highlight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatar Frame */
.hero-avatar-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.avatar-backdrop-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.35) 0%, rgba(255, 30, 86, 0.2) 40%, rgba(136, 19, 55, 0.1) 70%, transparent 80%);
  filter: blur(45px);
  z-index: 0;
  animation: pulseGlow 6s ease-in-out infinite alternate;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.75; }
  100% { transform: scale(1.1); opacity: 1; }
}

.avatar-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(225, 29, 72, 0.25);
  background: #14080e;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-smooth);
}

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

/* Corner Accents on Avatar */
.avatar-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(255, 255, 255, 0.7);
  z-index: 2;
  pointer-events: none;
}
.corner-tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

/* ==========================================================================
   TIMELINE / EDUCATION & EXPERIENCE SECTION
   ========================================================================== */
.timeline-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}

.section-header-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.section-header-compact i, .section-header-compact svg {
  font-size: 1.35rem;
  color: var(--accent-cyan);
}

.section-header-compact h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-dot {
  position: absolute;
  left: -1.95rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  border: 2px solid var(--bg-main);
}

.timeline-dot.alt {
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.timeline-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-highlight);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
}

.timeline-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

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

/* ==========================================================================
   TECH STACK SECTION
   ========================================================================== */
.stack-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.section-title-large {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stack-categories {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.stack-category {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.category-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.badges-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.tech-badge img.badge-icon,
.tech-badge svg.badge-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tech-badge:hover {
  transform: translateY(-3px) scale(1.02);
  background: var(--bg-surface-hover);
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(225, 29, 72, 0.2);
  color: #fff;
}

/* ==========================================================================
   PROJECTS SECTION & CARDS
   ========================================================================== */
.projects-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
  transition: all var(--transition-normal);
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 25px rgba(225, 29, 72, 0.2);
}

.project-thumbnail {
  width: 100%;
  height: 190px;
  background: #0f070b;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Code / Visual Mockup Header in Cards */
.code-preview-screen {
  width: 90%;
  height: 82%;
  background: #14080e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #fda4af;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.code-preview-screen .code-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 0.6rem;
}

.code-preview-screen .code-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.code-preview-screen .code-dots span:nth-child(1) { background: #ff1e56; }
.code-preview-screen .code-dots span:nth-child(2) { background: #f59e0b; }
.code-preview-screen .code-dots span:nth-child(3) { background: #10b981; }

.code-preview-screen pre {
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
  opacity: 0.9;
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
}

.project-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

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

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-action.btn-details {
  background: #ffffff;
  color: #0c0f17;
  border-color: #ffffff;
  font-weight: 700;
}

.btn-action.btn-details:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
}

.projects-load-more {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.btn-toggle-projects {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.btn-toggle-projects:hover {
  background: #ffffff;
  color: #0c0f17;
  border-color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   ABOUT ME & HOBBIES SECTION
   ========================================================================== */
.about-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.about-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-text-block h3 {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.about-text-block p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.98rem;
}

.hobbies-wrapper h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.hobbies-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hobby-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.hobby-pill:hover {
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
  transform: translateY(-2px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  padding: 4rem 0 2.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 4, 8, 0.85);
  backdrop-filter: blur(12px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-size: 1.3rem;
  margin-bottom: 0.65rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-socials {
  display: flex;
  gap: 0.85rem;
}

.social-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.social-icon-btn:hover {
  background: #ffffff;
  color: #0c0f17;
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ==========================================================================
   MODAL / POPUP (macOS STYLE WINDOW)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: #12070c;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 45px rgba(225, 29, 72, 0.25);
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: all var(--transition-smooth);
}

.modal-overlay.active .modal-window {
  transform: scale(1) translateY(0);
}

.modal-titlebar {
  background: #1c0a13;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-mac-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  transition: opacity var(--transition-fast);
}
.mac-dot:hover { opacity: 0.8; }
.mac-close { background: #ff5f56; border: 1px solid #e0443e; }
.mac-min { background: #ffbd2e; border: 1px solid #dea123; }
.mac-max { background: #27c93f; border: 1px solid #1aab29; }

.modal-window-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.modal-section-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.modal-preview-box {
  background: #080b12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #93c5fd;
  max-height: 220px;
  overflow-y: auto;
}

.modal-preview-box pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-desc-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-tech-stack-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.modal-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tech-tag {
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

.modal-footer-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-modal-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: #10b981;
  color: #062419;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-modal-primary:hover {
  background: #34d399;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-modal-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-modal-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Animations & Reveals */
.reveal, 
.timeline-col,
.timeline-item,
.project-card,
.contact-card,
.about-box {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
  transition: 
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active-reveal,
.timeline-col.active-reveal,
.timeline-item.active-reveal,
.project-card.active-reveal,
.contact-card.active-reveal,
.about-box.active-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger entrance for stack categories */
.stack-category {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stack-category.active-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Micro float effect on avatar and highlights */
@keyframes floatSubtle {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
  100% { transform: translateY(0px); }
}

.hero-avatar-wrapper {
  animation: floatSubtle 7s ease-in-out infinite;
}

/* Enhanced pulse on project cards on hover */
.project-card:hover {
  transform: translateY(-5px);
}

/* Button click wave feedback */
.btn-action:active, .btn-toggle-projects:active, .contact-card:active, .tech-badge:active, .hobby-pill:active {
  transform: scale(0.97);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  
  .hero-avatar-wrapper {
    order: -1;
  }
  
  .hero-contacts {
    grid-template-columns: 1fr;
  }
  
  .timeline-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .nav-wrapper {
    padding: 0.4rem 0.8rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-links.show-mobile {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 4.5rem;
    left: 1rem;
    right: 1rem;
    background: #14080e;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(225, 29, 72, 0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.85);
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .hero-title {
    font-size: 2.4rem;
  }
  
  .modal-footer-actions {
    flex-direction: column;
  }
}


/* ==========================================================================
   PERFORMANCE ENHANCEMENTS: CONTENT-VISIBILITY & ACCESSIBILITY
   ========================================================================== */

/* Skip rendering off-screen sections until scrolled near view */
.timeline-section,
.stack-section,
.projects-section,
.about-section,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* Reduced Motion Optimization (CPU & Battery Savings) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .avatar-backdrop-glow,
  .hero-avatar-wrapper {
    animation: none !important;
  }
}