/* ==========================================================================
   Portfolio CMS — Core Stylesheet
   Modern, professional, visually impressive design.
   ========================================================================== */

:root {
  --color-bg: #0a0e16;
  --color-bg-alt: #0f141f;
  --color-surface: #161b28;
  --color-surface-hover: #1c2233;
  --color-border: #252d3d;
  --color-border-light: #353d4d;
  --color-text: #f0f3f8;
  --color-text-muted: #8b95a8;
  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-dark: #4f46e5;
  --color-accent: #06b6d4;
  --color-accent-light: #22d3ee;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-surface: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --max-width: 1200px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'SFMono-Regular', Menlo, monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4, h5, h6 { line-height: 1.2; margin: 0 0 20px; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }
p { color: var(--color-text-muted); margin: 0 0 16px; font-size: 1.05rem; line-height: 1.8; }
a { color: var(--color-primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--color-accent-light); text-decoration: none; }
section { padding: 100px 0; position: relative; }
img { max-width: 100%; display: block; height: auto; }
code, pre { font-family: var(--font-mono); }

.section-title { text-align: center; margin-bottom: 64px; }
.section-title span { 
  color: var(--color-accent); 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  letter-spacing: 3px; 
  text-transform: uppercase; 
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}
.section-title h2 { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary { 
  background: var(--gradient-primary); 
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { 
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}
.btn-accent:hover {
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-outline { 
  background: transparent; 
  border-color: var(--color-border); 
  color: var(--color-text);
}
.btn-outline:hover { 
  border-color: var(--color-primary); 
  color: var(--color-primary-light);
  background: rgba(99, 102, 241, 0.05);
}
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10, 14, 22, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}
.site-header.scrolled {
  background: rgba(10, 14, 22, 0.95);
  box-shadow: var(--shadow);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo { 
  font-weight: 800; 
  font-size: 1.5rem; 
  color: var(--color-text);
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { 
  color: var(--color-text-muted); 
  font-weight: 500; 
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a.active { 
  color: #ffffff; 
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
  text-decoration: none;
}
.nav-cta { 
  background: var(--gradient-primary); 
  color: #fff !important; 
  padding: 10px 20px; 
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.nav-cta:hover,
.nav-cta.active {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 10px; border-radius: var(--radius-sm); transition: var(--transition-fast); }
.nav-toggle:hover { background: rgba(99, 102, 241, 0.1); }
.nav-toggle span { width: 24px; height: 2px; background: var(--color-text); border-radius: 2px; transition: var(--transition-fast); }

/* ---------- Hero ---------- */
.hero { 
  padding: 140px 0 100px; 
  text-align: center; 
  position: relative; 
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}
.hero::before {
  content: ''; 
  position: absolute; 
  inset: -50% -50% auto -50%; 
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(6, 182, 212, 0.1), transparent 40%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}
.hero-eyebrow { 
  font-family: var(--font-mono); 
  color: var(--color-accent); 
  letter-spacing: 3px; 
  text-transform: uppercase; 
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: inline-block;
  padding: 8px 16px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 100px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.hero h1 { 
  margin: 24px 0; 
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title { 
  font-size: 1.35rem; 
  color: var(--color-text-muted); 
  margin-bottom: 24px;
  font-weight: 500;
}
.hero-intro { 
  max-width: 700px; 
  margin: 0 auto 36px; 
  font-size: 1.1rem;
  line-height: 1.8;
}
.hero-tech { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 12px; 
  justify-content: center; 
  margin-bottom: 44px; 
}
.tech-pill { 
  background: var(--color-surface); 
  border: 1px solid var(--color-border); 
  padding: 8px 18px; 
  border-radius: 100px; 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  color: var(--color-text-muted);
  transition: var(--transition-fast);
}
.tech-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.card:hover { 
  transform: translateY(-6px); 
  box-shadow: var(--shadow-lg); 
  border-color: var(--color-border-light);
}
.card:hover::before {
  transform: scaleX(1);
}

/* ---------- Grid ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Skills ---------- */
.skill-category { margin-bottom: 48px; }
.skill-category h3 { 
  color: var(--color-accent); 
  font-family: var(--font-mono); 
  font-size: 0.95rem; 
  text-transform: uppercase; 
  letter-spacing: 2px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}
.skill-item { 
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.skill-item-info {
  flex: 0 0 130px;
  min-width: 0;
}
.skill-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.skill-bar { 
  flex: 1;
  height: 8px; 
  background: var(--color-surface); 
  border-radius: 100px; 
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
}
.skill-bar-fill { 
  height: 100%; 
  background: var(--gradient-primary); 
  border-radius: 100px; 
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.skill-pct {
  flex: 0 0 45px;
  text-align: right;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-weight: 600;
}
.skill-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------- Experience Timeline ---------- */
.timeline { 
  position: relative; 
  padding-left: 40px; 
  border-left: 2px solid var(--color-border);
}
.timeline-item { 
  position: relative; 
  padding-bottom: 48px;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.timeline-item::before {
  content: ''; 
  position: absolute; 
  left: -47px; 
  top: 6px; 
  width: 16px; 
  height: 16px;
  background: var(--color-primary);
  border-radius: 50%; 
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 0 20px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}
.timeline-item:hover::before {
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.3), 0 0 30px rgba(99, 102, 241, 0.6);
  transform: scale(1.2);
}
.timeline-date { 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: inline-block;
  padding: 4px 12px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 100px;
}

/* ---------- Projects ---------- */
.project-card { 
  overflow: hidden; 
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-light);
}
.project-thumb { 
  width: 100%; 
  height: 220px; 
  object-fit: cover; 
  background: var(--color-bg-alt);
  transition: var(--transition);
}
.project-card:hover .project-thumb {
  transform: scale(1.05);
}
.project-thumb-wrapper {
  overflow: hidden;
  position: relative;
}
.project-thumb-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--color-surface) 100%);
}
.project-body { padding: 24px; position: relative; z-index: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.project-tag { 
  font-size: 0.75rem; 
  background: var(--color-bg-alt); 
  border: 1px solid var(--color-border); 
  padding: 4px 12px; 
  border-radius: 100px; 
  color: var(--color-text-muted);
  transition: var(--transition-fast);
}
.project-tag:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}
.project-links { display: flex; gap: 12px; margin-top: 20px; }
.featured-badge { 
  display: inline-block; 
  background: var(--gradient-primary); 
  color: #fff; 
  font-size: 0.7rem; 
  padding: 4px 12px; 
  border-radius: 100px; 
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 22px; }
label { 
  display: block; 
  font-weight: 600; 
  margin-bottom: 8px; 
  font-size: 0.9rem;
  color: var(--color-text);
}
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="file"], input[type="url"], select, textarea {
  width: 100%; 
  padding: 14px 16px; 
  background: var(--color-bg-alt); 
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); 
  color: var(--color-text); 
  font-family: inherit; 
  font-size: 0.95rem;
  transition: var(--transition-fast);
}
input:focus, select:focus, textarea:focus { 
  outline: none; 
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--color-surface);
}
textarea { resize: vertical; min-height: 140px; }
.form-error { color: var(--color-danger); font-size: 0.85rem; margin-top: 6px; }
.alert { 
  padding: 16px 20px; 
  border-radius: var(--radius-sm); 
  margin-bottom: 24px; 
  font-size: 0.92rem;
  border-left: 4px solid;
}
.alert-success { 
  background: rgba(16, 185, 129, 0.1); 
  border-color: var(--color-success); 
  color: #6ee7b7;
}
.alert-danger { 
  background: rgba(239, 68, 68, 0.1); 
  border-color: var(--color-danger); 
  color: #fca5a5;
}

/* ---------- Footer ---------- */
.site-footer { 
  border-top: 1px solid var(--color-border); 
  padding: 48px 0; 
  margin-top: 80px;
  background: var(--color-bg-alt);
}
.footer-wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { 
  color: var(--color-text-muted);
  transition: var(--transition-fast);
}
.footer-links a:hover {
  color: var(--color-primary-light);
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.bg-alt { background: var(--color-bg-alt); }

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}

/* Selection styling */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--color-text);
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 120px 0 80px; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 68px; }
  .nav-wrap { height: 68px; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0; background: var(--color-bg-alt);
    flex-direction: column; align-items: stretch; padding: 24px; gap: 8px;
    border-bottom: 1px solid var(--color-border);
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { width: 100%; }
  .container { padding: 0 20px; }
  .skill-item { align-items: stretch; flex-wrap: wrap; gap: 8px 12px; }
  .skill-item-info { flex: 1 1 calc(100% - 52px); }
  .skill-bar { flex-basis: calc(100% - 57px); }
  .project-links { flex-wrap: wrap; }
  .project-links .btn { flex: 1 1 140px; }
  .footer-wrap { align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: 12px 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  section { padding: 52px 0; }
  .hero { padding: 84px 0 48px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero-eyebrow { font-size: 0.75rem; }
  .hero-intro { font-size: 1rem; }
  .hero-tech { gap: 8px; margin-bottom: 32px; }
  .tech-pill { padding: 8px 14px; }
  .btn { padding: 12px 20px; }
  .site-footer { padding: 32px 0; margin-top: 48px; }
}
