/* ============================================================
   1. DESIGN TOKENS
   CSS variables ("custom properties") hold the colors in one place.
   Change --accent to re-theme the whole page.
   The [data-theme="dark"] block overrides them for dark mode.
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --fg: #0f172a;
  --muted: #5b6478;
  --line: rgba(15, 23, 42, .09);
  --glass: rgba(255, 255, 255, .72);
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-3: #ec4899;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
  --radius: 18px;
}
[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #121a30;
  --fg: #eef2ff;
  --muted: #9aa5c0;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(18, 26, 48, .7);
  --accent: #818cf8;
  --accent-2: #22d3ee;
  --shadow: 0 14px 40px -14px rgba(0, 0, 0, .7);
}

/* ============================================================
   2. BASE
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }
section { padding: 5rem 0; position: relative; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  font-weight: 700; color: var(--accent); margin-bottom: .5rem;
}
.grad { color: var(--accent); } /* fallback color */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
}

/* ============================================================
   3. NOTICE + SCROLL PROGRESS + NAV
   ============================================================ */
.notice {
  background: #fef3c7; color: #78350f; text-align: center;
  font-size: .82rem; padding: .4rem 1rem; border-bottom: 1px solid #fcd34d;
}
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
  background: var(--grad);
}
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem max(1.25rem, calc((100vw - 1040px) / 2));
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); /* the "glass" effect */
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; text-decoration: none; color: var(--fg); display: flex; align-items: center; gap: .5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); }
.nav nav { display: flex; align-items: center; gap: .3rem; }
.nav nav a {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem;
  padding: .35rem .8rem; border-radius: 999px; transition: .2s;
}
.nav nav a:hover { color: var(--fg); background: var(--line); }
.nav nav a.pill { background: var(--fg); color: var(--bg); }
.nav nav a.pill:hover { opacity: .85; background: var(--fg); }
.nav-actions { display: flex; gap: .5rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer; font-size: 1rem;
  background: var(--bg-soft); color: var(--fg); border: 1px solid var(--line);
}
.burger { display: none; }

/* ============================================================
   4. HERO (animated gradient blobs behind the text)
   ============================================================ */
.hero { padding: 6rem 0 5rem; overflow: hidden; text-align: center; }
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .28; animation: float 14s ease-in-out infinite; }
.b1 { width: 380px; height: 380px; background: var(--accent); top: -80px; left: 8%; }
.b2 { width: 320px; height: 320px; background: var(--accent-2); top: 40px; right: 6%; animation-delay: -5s; }
.b3 { width: 260px; height: 260px; background: var(--accent-3); bottom: -60px; left: 40%; animation-delay: -9s; opacity: .2; }
@keyframes float { 50% { transform: translate(30px, -30px) scale(1.08); } }
.badge {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600;
  padding: .35rem .9rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 600px; margin: 1rem auto 2rem; }
.cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; padding: .8rem 1.6rem;
  border-radius: 999px; transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -8px var(--accent); }
.btn.ghost { border: 1px solid var(--line); background: var(--glass); color: var(--fg); }
.stats { display: flex; justify-content: center; gap: 2.5rem; margin-top: 3.5rem; flex-wrap: wrap; }
.stats b { display: block; font-size: 2rem; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .85rem; }

/* ============================================================
   5. ABOUT
   ============================================================ */
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; }
.facts { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.facts li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: .6rem 1rem; }
.facts span { margin-right: .5rem; }

/* ============================================================
   6. PROJECTS (CSS grid + filter chips)
   ============================================================ */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.2rem 0 2rem; }
.chip {
  cursor: pointer; padding: .4rem 1rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); transition: .2s;
}
.chip.active, .chip:hover { background: var(--fg); color: var(--bg); }
.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .25s;
}
.card:hover { transform: translateY(-6px); }
.card.hide { display: none; }
.thumb { height: 150px; display: grid; place-items: center; font-size: 3rem; }
.t1 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.t2 { background: linear-gradient(135deg, #10b981, #06b6d4); }
.t3 { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.t4 { background: linear-gradient(135deg, #ec4899, #f97316); }
.t5 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.t6 { background: linear-gradient(135deg, #14b8a6, #3b82f6); }
.card .body { padding: 1.2rem 1.3rem 1.4rem; }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .95rem; }
.tags span {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .6rem; margin: 0 .3rem .3rem 0;
  border-radius: 999px; background: var(--line); color: var(--muted);
}

/* ============================================================
   7. SKILLS (bars animate to --w when the section is revealed)
   ============================================================ */
.bars { display: grid; gap: 1.2rem; }
.bar-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .35rem; }
.bar-top em { font-style: normal; color: var(--muted); }
.track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.bars.visible .track i { width: var(--w); }

/* ============================================================
   8. TIMELINE
   ============================================================ */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0 0 0 1.6rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding-bottom: 2rem; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.6rem - 7px); top: .35rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--bg);
}
.timeline time { font-weight: 700; color: var(--accent); font-size: .85rem; }
.timeline h3 { font-size: 1.1rem; margin: .2rem 0; }
.timeline p { color: var(--muted); margin: 0; }

/* ============================================================
   9. CONTACT + FOOTER
   ============================================================ */
.contact-card {
  text-align: center; padding: 3.5rem 1.5rem; border-radius: 28px; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #0891b2); box-shadow: var(--shadow);
}
.contact-card p { max-width: 520px; margin: .5rem auto 1.6rem; opacity: .92; }
.contact-card .btn.primary { background: #fff; color: #1e1b4b; box-shadow: none; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1.25rem 3rem; }

/* ============================================================
   10. SCROLL-REVEAL + RESPONSIVE + REDUCED MOTION
   Elements with .reveal start invisible; app.js adds .in when they scroll into view.
   ============================================================ */
/* Only hide .reveal elements when JS is running (app.js adds the "js" class), so content never stays invisible if the script fails. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  section { padding: 3.5rem 0; }
  .burger { display: inline-block; }
  .nav nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: .6rem;
    display: none;
  }
  .nav nav.open { display: flex; }
  .nav nav a { padding: .7rem 1rem; }
}
/* Respect people who turn off animations in their system settings (accessibility) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .track i { width: var(--w); }
}
