/* =========================================================
   Harry Patel — Data Analyst Portfolio
   style.css
   ========================================================= */

/* ---------- THEME TOKENS ---------- */
:root {
  --primary: #2563eb;
  --primary-soft: #3b82f6;
  --accent: #38bdf8;
  --secondary: #0f172a;

  --bg: #f3f6fb;
  --bg-2: #e9eef7;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.1);

  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #94a3b8;

  --glass-blur: 16px;
  --shadow: 0 10px 40px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -18px rgba(37, 99, 235, 0.35);
  --radius: 18px;
  --radius-sm: 12px;

  --font-display: "Sora", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --grad: linear-gradient(120deg, var(--primary), var(--accent));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #060b18;
  --bg-2: #0b1224;
  --surface: rgba(20, 30, 54, 0.55);
  --surface-solid: #0e1730;
  --border: rgba(148, 163, 184, 0.16);

  --text: #e8eefc;
  --text-soft: #aab6cf;
  --text-faint: #64748b;

  --shadow: 0 14px 50px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 70px -16px rgba(56, 189, 248, 0.35);
}

/* ---------- RESET ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth; scroll-padding-top: 90px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;   /* stop iOS auto-inflating text */
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; }
::selection { background: var(--primary); color: #fff; }

/* ---------- BACKGROUND DECOR ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  opacity: 0.6;
}
.bg-glow {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(120px); opacity: 0.5; pointer-events: none;
}
.bg-glow-1 { width: 540px; height: 540px; top: -160px; right: -120px; background: var(--accent); }
.bg-glow-2 { width: 480px; height: 480px; bottom: -160px; left: -120px; background: var(--primary); opacity: 0.35; }
#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- LOADER ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader.hide { opacity: 0; visibility: hidden; }
.loader-bars { display: flex; gap: 7px; height: 56px; align-items: flex-end; justify-content: center; }
.loader-bars span {
  width: 10px; background: var(--grad); border-radius: 4px;
  animation: barPulse 1s ease-in-out infinite;
}
.loader-bars span:nth-child(1) { animation-delay: 0s; }
.loader-bars span:nth-child(2) { animation-delay: 0.12s; }
.loader-bars span:nth-child(3) { animation-delay: 0.24s; }
.loader-bars span:nth-child(4) { animation-delay: 0.36s; }
.loader-bars span:nth-child(5) { animation-delay: 0.48s; }
@keyframes barPulse { 0%, 100% { height: 14px; opacity: 0.5; } 50% { height: 52px; opacity: 1; } }
.loader-text { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; margin-top: 18px; letter-spacing: 2px; }
.loader-text .dot { color: var(--accent); }

/* ---------- LAYOUT ---------- */
.container { width: min(1180px, 92%); margin-inline: auto; }
.section { padding: 110px 0; position: relative; }
.section-head { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--accent); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}
.section-title { font-size: clamp(1.9rem, 4vw, 3rem); }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- GLASS ---------- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- BUTTONS ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 50px; font-weight: 600; font-size: 0.95rem;
  font-family: var(--font-body); cursor: pointer; border: 1px solid transparent;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--primary); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--surface-solid); color: var(--text); border-color: var(--border); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .btn-outline { color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .btn-outline:hover { background: var(--accent); color: var(--secondary); }

/* ripple */
.ripple-ink {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255, 255, 255, 0.5); animation: ripple 0.6s linear; pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- NAVBAR ---------- */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 18px 0; transition: all 0.4s var(--ease);
}
.navbar.scrolled {
  background: var(--surface); backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border); padding: 12px 0; box-shadow: var(--shadow);
}
.nav-container { width: min(1180px, 92%); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; }
.logo-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: 1px;
}
.logo-text { font-size: 1.05rem; }
.nav-menu { display: flex; gap: 6px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 10px; font-weight: 500;
  color: var(--text-soft); transition: color 0.3s, background 0.3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--grad); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-solid); border: 1px solid var(--border); color: var(--text); cursor: pointer;
  transition: transform 0.3s, color 0.3s;
}
.theme-toggle:hover { transform: rotate(20deg); color: var(--accent); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.hamburger { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; border: none; background: none; cursor: pointer; align-items: center; justify-content: center; }
.hamburger span { width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 120px; }
.hero-inner { width: min(1180px, 92%); margin-inline: auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-soft); margin-bottom: 18px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero-name { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -1px; }
.hero-role { font-size: clamp(1.2rem, 3vw, 1.9rem); margin: 14px 0 22px; font-weight: 600; color: var(--text-soft); min-height: 1.6em; }
.type-prefix { color: var(--text-soft); }
.typed { color: var(--primary); }
[data-theme="dark"] .typed { color: var(--accent); }
.cursor { color: var(--accent); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-intro { font-size: 1.05rem; color: var(--text-soft); max-width: 520px; margin-bottom: 30px; }
.hero-intro strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero-socials { display: flex; gap: 14px; }
.hero-socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--border); color: var(--text-soft);
  transition: 0.3s var(--ease);
}
.hero-socials a:hover { color: #fff; background: var(--grad); transform: translateY(-4px); border-color: transparent; }

/* hero visual */
.profile-orbit { position: relative; display: grid; place-items: center; height: 420px; }
.orbit-ring { position: absolute; border: 1.5px dashed var(--border); border-radius: 50%; }
.ring-1 { width: 340px; height: 340px; animation: spin 26s linear infinite; }
.ring-2 { width: 420px; height: 420px; animation: spin 40s linear infinite reverse; border-style: dotted; }
@keyframes spin { to { transform: rotate(360deg); } }
.profile-card { width: 240px; border-radius: 24px; padding: 26px; text-align: center; z-index: 2; }
.profile-img {
  width: 140px; height: 140px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; color: #fff; position: relative;
  box-shadow: 0 16px 40px -12px var(--primary);
  overflow: hidden;
}
.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.profile-meta { margin-top: 6px; }
.profile-hint { position: absolute; bottom: 14px; font-size: 0.7rem; opacity: 0.85; }
.profile-name { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.profile-title { font-size: 0.82rem; color: var(--text-soft); }
.float-chip {
  position: absolute; padding: 9px 15px; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
  z-index: 3; animation: floaty 5s ease-in-out infinite;
}
.chip-1 { top: 24px; left: -10px; }
.chip-2 { top: 90px; right: -10px; animation-delay: 0.6s; }
.chip-3 { top: 50%; left: -20px; animation-delay: 1.2s; }
.chip-4 { bottom: 80px; right: -16px; animation-delay: 1.8s; }
.chip-5 { bottom: 20px; left: 50%; transform: translateX(-50%); animation-delay: 2.4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
/* keep chip-5 horizontally centered while floating */
.chip-5 { animation-name: floatyCenter; }
@keyframes floatyCenter { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-12px); } }

.scroll-down { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--text-faint); border-radius: 50px; display: grid; justify-items: center; padding-top: 7px; }
.scroll-down span { width: 5px; height: 9px; border-radius: 3px; background: var(--primary); animation: scrolly 1.6s infinite; }
@keyframes scrolly { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.about-text p { color: var(--text-soft); margin-bottom: 18px; }
.about-text strong { color: var(--text); }
.about-list { display: grid; gap: 18px; margin-top: 24px; }
.about-item { padding-left: 18px; border-left: 3px solid var(--primary); }
.about-item h4 { font-size: 1.05rem; margin-bottom: 4px; }
.about-item p { font-size: 0.92rem; margin: 0; }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.counter-card { border-radius: var(--radius); padding: 28px 20px; text-align: center; transition: transform 0.4s var(--ease); }
.counter-card:hover { transform: translateY(-6px); }
.counter { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: block; }
.counter-card p { font-size: 0.9rem; color: var(--text-soft); margin-top: 6px; }

/* ---------- SKILLS ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.skill-card { border-radius: var(--radius); padding: 22px; transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.skill-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.skill-icon { font-size: 1.4rem; }
.skill-top h4 { font-size: 1.05rem; flex: 1; }
.skill-pct { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.bar { height: 8px; background: var(--bg-2); border-radius: 50px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 50px; background: var(--grad); transition: width 1.4s var(--ease); }
.bar.animate i { width: var(--w); }

/* ---------- PROJECTS ---------- */
.projects-controls { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 50px; background: var(--surface-solid); border: 1px solid var(--border); min-width: 260px; flex: 1; max-width: 360px; color: var(--text-soft); }
.search-box input { border: none; background: none; outline: none; font-family: var(--font-body); font-size: 0.95rem; color: var(--text); width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn { padding: 9px 18px; border-radius: 50px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-soft); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: 0.3s; font-family: var(--font-body); }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project-card { border-radius: var(--radius); overflow: hidden; transition: transform 0.45s var(--ease), box-shadow 0.45s; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.project-thumb { height: 180px; position: relative; display: grid; place-items: center; overflow: hidden; }
.project-thumb .chart-mock { display: flex; gap: 8px; align-items: flex-end; height: 90px; }
.project-thumb .chart-mock span { width: 16px; border-radius: 4px 4px 0 0; background: rgba(255,255,255,0.85); }
.project-thumb .badge { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,0.35); color: #fff; font-size: 0.7rem; font-family: var(--font-mono); padding: 5px 11px; border-radius: 50px; backdrop-filter: blur(4px); }
.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.project-desc { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 14px; flex: 1; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tech-tags span { font-size: 0.72rem; font-family: var(--font-mono); padding: 4px 10px; border-radius: 50px; background: var(--bg-2); color: var(--text-soft); }
.impact { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.project-actions .mini { font-size: 0.78rem; padding: 8px 14px; border-radius: 10px; font-weight: 600; border: 1px solid var(--border); cursor: pointer; transition: 0.3s; background: var(--surface-solid); color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.project-actions .mini:hover { background: var(--primary); color: #fff; border-color: transparent; }
.project-actions .mini.solid { background: var(--grad); color: #fff; border-color: transparent; }
.no-results { text-align: center; color: var(--text-soft); margin-top: 30px; font-size: 1.05rem; }

/* ---------- CERTIFICATIONS ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.cert-card { border-radius: var(--radius); padding: 26px; transition: transform 0.45s var(--ease), box-shadow 0.45s; }
.cert-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.cert-preview { height: 160px; border-radius: var(--radius-sm); display: grid; place-items: center; margin-bottom: 18px; background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.cert-preview .seal { width: 56px; height: 56px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.7); display: grid; place-items: center; font-size: 1.4rem; }
.cert-preview.has-img { cursor: zoom-in; }
.cert-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.cert-preview.has-img:hover img { transform: scale(1.06); }
.cert-zoom { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,23,42,0.55); color: #fff; font-size: 0.85rem; font-weight: 600; opacity: 0; transition: opacity 0.3s var(--ease); backdrop-filter: blur(2px); }
.cert-preview.has-img:hover .cert-zoom, .cert-preview.has-img:focus-visible .cert-zoom { opacity: 1; }
.cert-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.cert-org { color: var(--text-soft); font-size: 0.9rem; }
.cert-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); margin: 8px 0 16px; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.cert-verify { font-size: 0.82rem; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-family: var(--font-body); padding: 0; transition: gap 0.3s var(--ease); }
[data-theme="dark"] .cert-verify { color: var(--accent); }
.cert-verify:hover { gap: 10px; }

/* ---------- CERTIFICATE LIGHTBOX ---------- */
.lightbox { position: fixed; inset: 0; z-index: 2500; display: none; place-items: center; padding: 30px; }
.lightbox.open { display: grid; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(2,6,18,0.85); backdrop-filter: blur(8px); animation: fadeIn 0.3s; }
.lightbox-figure { position: relative; z-index: 2; max-width: min(960px, 92vw); max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: modalUp 0.4s var(--ease); margin: 0; }
.lightbox-figure img { max-width: 100%; max-height: 78vh; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7); background: #fff; }
.lightbox-figure figcaption { color: #e8eefc; font-family: var(--font-display); font-weight: 600; font-size: 1rem; text-align: center; }
.lightbox-close { position: absolute; top: 18px; right: 26px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; transition: 0.3s; display: grid; place-items: center; }
.lightbox-close:hover { background: #ef4444; transform: rotate(90deg); }


/* ---------- RESUME ---------- */
.resume-top { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center; margin-bottom: 70px; }
.resume-preview { border-radius: var(--radius); padding: 30px; display: grid; place-items: center; }
.resume-doc { width: 180px; height: 230px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 22px 18px; box-shadow: var(--shadow); position: relative; }
.resume-doc::before { content: ""; position: absolute; top: 22px; left: 18px; width: 60px; height: 8px; border-radius: 4px; background: var(--grad); }
.resume-doc-lines { margin-top: 30px; display: grid; gap: 9px; }
.resume-doc-lines span { height: 6px; border-radius: 3px; background: var(--bg-2); }
.resume-doc-lines span:nth-child(2) { width: 80%; }
.resume-doc-lines span:nth-child(4) { width: 60%; }
.resume-doc p { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-faint); margin-top: 20px; text-align: center; }
.resume-cta h3 { font-size: 1.6rem; margin-bottom: 12px; }
.resume-cta p { color: var(--text-soft); margin-bottom: 22px; max-width: 440px; }

.timelines { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.timeline-head { font-size: 1.3rem; margin-bottom: 28px; }
.timeline { position: relative; }
.tl-item { position: relative; padding-left: 30px; padding-bottom: 30px; border-left: 2px solid var(--border); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--grad); border: 3px solid var(--bg); }
.tl-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.tl-item h4 { font-size: 1.1rem; margin: 4px 0; }
.tl-org { color: var(--primary); font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
[data-theme="dark"] .tl-org { color: var(--accent); }
.tl-item p { color: var(--text-soft); font-size: 0.9rem; }

/* ---------- CONTACT ---------- */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 44px; align-items: start; }
.contact-info { display: grid; gap: 22px; }
.info-item { display: flex; gap: 16px; align-items: flex-start; }
.info-ico { font-size: 1.4rem; width: 50px; height: 50px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; flex-shrink: 0; }
.info-item h4 { font-size: 0.95rem; margin-bottom: 2px; }
.info-item a, .info-item span { color: var(--text-soft); font-size: 0.92rem; transition: color 0.3s; }
.info-item a:hover { color: var(--primary); }

.contact-form { border-radius: var(--radius); padding: 34px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  transition: border 0.3s, box-shadow 0.3s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.field.invalid input, .field.invalid textarea { border-color: #ef4444; }
.error { display: block; color: #ef4444; font-size: 0.78rem; margin-top: 5px; min-height: 1em; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }
.form-success { color: #22c55e; font-weight: 600; margin-top: 16px; }

/* ---------- FOOTER ---------- */
.footer { background: var(--secondary); color: #cbd5e1; padding-top: 60px; margin-top: 40px; position: relative; }
[data-theme="dark"] .footer { background: #04070f; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-brand .logo-mark { margin-bottom: 14px; }
.footer-brand p { font-size: 0.9rem; max-width: 320px; color: #94a3b8; }
.footer-brand .visitor { margin-top: 14px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #94a3b8; font-size: 0.9rem; transition: color 0.3s, padding 0.3s; }
.footer-links a:hover { color: var(--accent); padding-left: 5px; }
.social-row { display: flex; gap: 12px; }
.social-row a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,0.06); color: #cbd5e1; transition: 0.3s; }
.social-row a:hover { background: var(--grad); color: #fff; transform: translateY(-4px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 22px 0; text-align: center; font-size: 0.85rem; color: #64748b; }

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; width: 50px; height: 50px; border-radius: 14px;
  background: var(--grad); color: #fff; border: none; cursor: pointer; display: grid; place-items: center;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: 0.4s var(--ease); z-index: 900;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-5px); }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,6,18,0.6); backdrop-filter: blur(6px); animation: fadeIn 0.3s; }
.modal-card { position: relative; width: min(640px, 100%); max-height: 85vh; overflow-y: auto; border-radius: 22px; padding: 36px; animation: modalUp 0.4s var(--ease); }
@keyframes modalUp { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 1.8rem; color: var(--text-soft); cursor: pointer; line-height: 1; transition: color 0.3s; }
.modal-close:hover { color: #ef4444; }
.modal-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.modal-card .m-thumb { height: 170px; border-radius: var(--radius-sm); margin: 18px 0; display: grid; place-items: center; }
.modal-card h4 { font-size: 0.95rem; margin: 16px 0 6px; color: var(--accent); font-family: var(--font-mono); }
.modal-card p { color: var(--text-soft); }
.modal-card .tech-tags { margin-top: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- REVEAL ANIMATION ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero-inner, .about-grid, .resume-top, .contact-grid, .timelines { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .profile-orbit { height: 360px; }
  .counters { max-width: 460px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* keep the five skill chips tidy on smaller screens */
@media (max-width: 560px) {
  .float-chip { font-size: 0.72rem; padding: 7px 12px; }
  .chip-1 { top: 10px; left: 0; }
  .chip-2 { top: 70px; right: 0; }
  .chip-3 { top: 48%; left: -6px; }
  .chip-4 { bottom: 64px; right: -6px; }
  .chip-5 { bottom: 8px; }
}

@media (max-width: 760px) {
  .nav-menu {
    position: fixed; top: 0; right: -100%; width: 75%; max-width: 320px; height: 100vh;
    flex-direction: column; justify-content: center; gap: 14px; padding: 40px;
    background: var(--surface); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border); box-shadow: var(--shadow); transition: right 0.45s var(--ease);
  }
  .nav-menu.open { right: 0; }
  .nav-link { font-size: 1.1rem; }
  .hamburger { display: flex; }
  .section { padding: 80px 0; }
  .counters { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* ---- mobile performance: lighten expensive blur/glow effects ---- */
  .glass, .navbar.scrolled, .nav-menu { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .bg-glow { filter: blur(80px); opacity: 0.35; }
  .bg-glow-2 { opacity: 0.25; }
  /* disable lift-on-hover transforms (touch devices don't hover; they just cost paint) */
  .skill-card:hover, .counter-card:hover, .project-card:hover, .cert-card:hover { transform: none; }
}

@media (max-width: 420px) {
  .counter { font-size: 2.1rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .logo-text { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.1ms !important; }
  .reveal { opacity: 1; transform: none; }
}
