:root {
  --bg-dark: #050505;
  --bg-panel: rgba(20, 20, 25, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #ededed;
  --text-muted: #888888;
  --accent-cyan: #00f2fe;
  --accent-purple: #4facfe;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; 
}

/* Custom Magnetic Cursor - Hidden on Touch Devices */
#cursor-dot {
  position: fixed; top: 0; left: 0; width: 6px; height: 6px;
  background: white; border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%); z-index: 9999;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 50%;
  pointer-events: none; transform: translate(-50%, -50%); z-index: 9998;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease);
}
.cursor-hover #cursor-ring {
  width: 60px; height: 60px; background: rgba(0, 242, 254, 0.05); border-color: var(--accent-cyan);
}

/* Disable Custom Cursor on Mobile/Tablets */
@media (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none !important; }
  a, button, input, textarea, .filter-btn, .magnetic { cursor: pointer; }
}

/* Neural Canvas Background */
#neural-canvas {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -1; pointer-events: none; opacity: 1; 
}

/* Header & Nav */
header { min-height: 100vh; padding: 2rem 5%; display: flex; flex-direction: column; }
nav { display: flex; justify-content: space-between; align-items: center; z-index: 10; }
.logo { font-family: var(--font-mono); font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 700; }
.logo span { color: var(--accent-cyan); }
.nav-menu { display: flex; gap: 2rem; list-style: none; }
.nav-menu a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-family: var(--font-mono); transition: color 0.3s; }
.nav-menu a:hover { color: white; }

/* Hero Section */
.hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 900px; z-index: 10; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: clamp(0.7rem, 2vw, 0.85rem); color: var(--accent-cyan); margin-bottom: 2rem; background: rgba(0, 242, 254, 0.1); padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(0, 242, 254, 0.2); width: fit-content; }
.pulse-dot { width: 8px; height: 8px; background: var(--accent-cyan); border-radius: 50%; animation: pulse 2s infinite; flex-shrink: 0; }
h1 { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 1rem; word-wrap: break-word; }
.subtitle { font-size: clamp(1.2rem, 4vw, 2rem); color: var(--text-muted); margin-bottom: 2rem; }
.gradient-text { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: clamp(0.95rem, 2vw, 1.1rem); color: var(--text-muted); max-width: 600px; margin-bottom: 3rem; }

.hero-actions { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.btn-primary { padding: 12px 28px; background: white; color: black; text-decoration: none; font-weight: 600; border-radius: 6px; transition: transform 0.3s var(--ease), box-shadow 0.3s; border: none; font-family: var(--font-mono); }
.btn-primary:hover { box-shadow: 0 0 20px rgba(255,255,255,0.2); transform: translateY(-2px); }
.social-links { display: flex; gap: 1.5rem; }
.social-links a { color: var(--text-muted); font-size: 1.5rem; transition: color 0.3s; }
.social-links a:hover { color: white; }

/* Layout & Containers */
.section-container { max-width: 1200px; margin: 0 auto; padding: 6rem 5% 0; }

/* Responsive Section Titles (Fix for overflow) */
.section-title { 
  font-family: var(--font-mono); 
  font-size: clamp(1.4rem, 5vw, 2rem); 
  margin-bottom: 3rem; 
  color: white; 
  font-weight: 400;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Glass Cards */
.glass-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: clamp(1.5rem, 4vw, 2.5rem); backdrop-filter: blur(10px); transition: border-color 0.3s, box-shadow 0.3s; }
.glass-card:hover { border-color: rgba(0, 242, 254, 0.3); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.tag { font-size: clamp(0.7rem, 1.5vw, 0.8rem); padding: 6px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); border-radius: 6px; font-family: var(--font-mono); transition: 0.3s; }
.tag:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.ai-tag { background: rgba(0, 242, 254, 0.05); border-color: rgba(0, 242, 254, 0.2); color: var(--accent-cyan); }
.ai-tag:hover { background: rgba(0, 242, 254, 0.15); border-color: var(--accent-cyan); box-shadow: 0 0 10px rgba(0, 242, 254, 0.2); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 1.5rem; }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px; }
.timeline-header h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); }
.timeline-header h4 { color: var(--text-muted); font-weight: 400; margin-top: 5px; }
.date-badge { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); border: 1px solid var(--border-color); padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.timeline-details { list-style: none; color: var(--text-muted); }
.timeline-details li { margin-bottom: 10px; position: relative; padding-left: 20px; font-size: clamp(0.9rem, 2vw, 1rem); }
.timeline-details li::before { content: '>'; position: absolute; left: 0; color: var(--accent-cyan); font-family: var(--font-mono); }

/* Project Filters */
.project-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; justify-content: flex-start; }
.filter-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 20px; font-family: var(--font-mono); font-size: clamp(0.75rem, 2vw, 0.85rem); transition: 0.3s; }
.filter-btn:hover { border-color: rgba(255,255,255,0.3); color: white; }
.filter-btn.active { background: rgba(0, 242, 254, 0.1); color: var(--accent-cyan); border-color: var(--accent-cyan); }

/* Project Cards */
.project-card { display: flex; flex-direction: column; transition: opacity 0.4s ease, transform 0.4s ease; }
.project-card.hide { opacity: 0; transform: scale(0.95); pointer-events: none; position: absolute; }
.project-card h3 { font-size: clamp(1.2rem, 3vw, 1.4rem); margin: 1rem 0; color: white; }
.project-card p { color: var(--text-muted); font-size: clamp(0.9rem, 2vw, 0.95rem); margin-bottom: 1.5rem; flex-grow: 1; }
.project-header { display: flex; justify-content: space-between; align-items: center; }
.project-icon { font-size: 1.5rem; color: var(--accent-cyan); }
.status-indicator { font-family: var(--font-mono); font-size: 0.75rem; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border-color); white-space: nowrap; }
.status-indicator.secured { background: rgba(255,0,0,0.1); color: #ff5555; border-color: rgba(255,0,0,0.3); }
.status-indicator.live { background: rgba(0,255,100,0.1); color: #00ff66; border-color: rgba(0,255,100,0.3); }
.status-indicator.archived { background: rgba(255,255,255,0.05); color: #aaaaaa; border-color: rgba(255,255,255,0.2); }
.project-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 1rem; color: var(--accent-cyan); text-decoration: none; font-weight: 500; font-family: var(--font-mono); font-size: 0.9rem; transition: 0.3s; word-wrap: break-word; }
.project-link i { transition: transform 0.3s; }
.project-link:hover i { transform: translateX(5px); }
.project-link:hover { color: white; }

/* Forms */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; }
.contact-methods { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.contact-methods a, .contact-methods span { color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); transition: color 0.3s; font-size: clamp(0.85rem, 2vw, 1rem); word-break: break-all; }
.contact-methods a:hover { color: white; }

.input-group { position: relative; margin-bottom: 2rem; }
.input-group input, .input-group textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-color); color: white; padding: 10px 0; font-family: var(--font-sans); font-size: 1rem; transition: border-color 0.3s; resize: none; }
.input-group input:focus, .input-group textarea:focus { outline: none; border-bottom-color: var(--accent-cyan); }
.input-group label { position: absolute; left: 0; top: 10px; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.9rem; pointer-events: none; transition: all 0.3s var(--ease); }
.input-group input:focus ~ label, .input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label, .input-group textarea:not(:placeholder-shown) ~ label { top: -20px; font-size: 0.75rem; color: var(--accent-cyan); }
#ai-contact-form button { width: 100%; margin-top: 1rem; }

/* Animations */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,242,254,0.4); } 70% { box-shadow: 0 0 0 10px rgba(0,242,254,0); } 100% { box-shadow: 0 0 0 0 rgba(0,242,254,0); } }
.scroll-reveal { opacity: 0; transform: translateY(40px); transition: all 1s var(--ease); }
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* Advanced Responsive Overrides */
@media(max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
}

@media(max-width: 480px) {
  .section-container { padding: 4rem 5% 0; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .project-filters { flex-direction: column; width: 100%; }
  .filter-btn { width: 100%; text-align: left; }
}