/* ===========================================================
   Developer Portfolio — style.css
   Theme variables are injected at runtime from content.json
   =========================================================== */

:root {
  --accent: #6366f1;
  --accent2: #ec4899;
  --bg: #0b0f1a;
  --surface: #131829;
  --text: #e6e9f0;
  --muted: #9aa3b2;
  --font: 'Inter', system-ui, sans-serif;
  --radius: 16px;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --maxw: 1140px;
}

/* Light theme override (toggled via [data-mode="light"]) */
[data-mode="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5b6472;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; position: relative; }
.center { text-align: center; }

.grad-text {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.section__subtitle { color: var(--muted); margin-bottom: 48px; font-size: 1.05rem; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 1000; transition: width .1s linear;
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s, padding .3s;
}
.nav.scrolled { border-color: var(--border); padding: 4px 0; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__logo { font-weight: 800; font-size: 1.35rem; }
.nav__logo::after { content: '.'; color: var(--accent); }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--muted); font-weight: 500; font-size: .95rem; position: relative; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .25s;
}
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: transform .2s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.05); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); transition: .3s; border-radius: 2px; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  cursor: pointer; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -12px var(--accent); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { transform: translateY(-3px); border-color: var(--accent); }
.full { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding-top: 150px; }
.hero__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text);
  border: 1px solid var(--border); font-size: .85rem; font-weight: 500; margin-bottom: 22px;
}
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 #22c55e; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.7);} 70%{ box-shadow:0 0 0 8px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }
.hero__title { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.hero__role { font-size: clamp(1.2rem, 3vw, 1.7rem); color: var(--muted); margin: 14px 0 18px; font-weight: 600; min-height: 1.6em; }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__tagline { color: var(--muted); font-size: 1.1rem; max-width: 520px; margin-bottom: 30px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__art { position: relative; display: grid; place-items: center; }
.blob {
  position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent2)); filter: blur(60px); opacity: .35;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0) scale(1);} 50%{ transform: translateY(-22px) scale(1.05);} }
.code-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); width: 100%; max-width: 360px;
}
.code-card__dots { display: flex; gap: 7px; margin-bottom: 14px; }
.code-card__dots span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f56; }
.code-card__dots span:nth-child(2) { background: #ffbd2e; }
.code-card__dots span:nth-child(3) { background: #27c93f; }
.code-card pre { font-family: 'SF Mono', 'Fira Code', monospace; font-size: .9rem; line-height: 1.7; overflow-x: auto; }
.c-key { color: #c792ea; } .c-var { color: #82aaff; } .c-prop { color: #f78c6c; }
.c-str { color: #c3e88d; } .c-num { color: #ff5370; }

/* ---------- Stats ---------- */
.stats { padding: 40px 0; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; transition: transform .25s, border-color .25s;
}
.stat:hover { transform: translateY(-6px); border-color: var(--accent); }
.stat__value { font-size: 2.4rem; font-weight: 800; }
.stat__label { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; }
.about__art { display: grid; place-items: center; }
.about__emoji {
  font-size: 8rem; width: 240px; height: 240px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 30px; box-shadow: var(--shadow);
}
.about__body { color: var(--muted); margin: 16px 0 22px; font-size: 1.05rem; }
.about__list { display: grid; gap: 12px; }
.about__list li { display: flex; align-items: center; gap: 12px; }
.about__list li::before { content: '✓'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 800; flex-shrink: 0; }

/* ---------- Skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 48px; }
.skill__head { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.skill__bar { height: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.skill__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }

/* ---------- Services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 24px; transition: transform .25s, border-color .25s; position: relative; overflow: hidden;
}
.service::before { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, var(--accent), var(--accent2)); opacity: 0; transition: opacity .3s; z-index: 0; }
.service:hover { transform: translateY(-8px); border-color: transparent; }
.service:hover::before { opacity: .12; }
.service > * { position: relative; z-index: 1; }
.service__icon { font-size: 2.4rem; margin-bottom: 14px; }
.service__title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.service__desc { color: var(--muted); font-size: .95rem; }

/* ---------- Projects ---------- */
.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, border-color .25s; display: flex; flex-direction: column;
}
.project:hover { transform: translateY(-8px); border-color: var(--accent); }
.project__thumb { font-size: 4rem; height: 160px; display: grid; place-items: center; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent2) 22%, transparent)); }
.project__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.project__desc { color: var(--muted); font-size: .95rem; flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tag { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid var(--border); color: var(--text); }
.project__links { display: flex; gap: 16px; }
.project__links a { font-size: .9rem; font-weight: 600; color: var(--accent); }
.project__links a:hover { text-decoration: underline; }

/* ---------- Testimonials ---------- */
.testimonials__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.testimonial { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.testimonial__quote { font-size: 1.1rem; font-style: italic; margin-bottom: 18px; }
.testimonial__quote::before { content: '“'; font-size: 2.4rem; color: var(--accent); vertical-align: -0.4em; margin-right: 4px; }
.testimonial__who { display: flex; flex-direction: column; }
.testimonial__name { font-weight: 700; }
.testimonial__role { color: var(--muted); font-size: .9rem; }

/* ---------- Contact ---------- */
.contact__inner { max-width: 720px; }
.contact__form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.field.full, .contact__form > .btn, .contact__note { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 1rem; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.contact__note { text-align: center; color: var(--muted); font-size: .9rem; min-height: 1.2em; }
.contact__socials { display: flex; justify-content: center; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.social {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 500; transition: transform .2s, border-color .2s;
}
.social:hover { transform: translateY(-3px); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 30px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.footer__admin { font-weight: 600; color: var(--text); opacity: .8; }
.footer__admin:hover { opacity: 1; color: var(--accent); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; bottom: 26px; right: 26px; width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; border: 0; cursor: pointer;
  font-size: 1.3rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(20px);
  transition: opacity .3s, transform .3s; z-index: 800;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__cta { justify-content: center; }
  .hero__art { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .about__art { order: -1; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav__links.open { max-height: 340px; }
  .nav__links a { padding: 16px 24px; border-bottom: 1px solid var(--border); width: 100%; }
  .nav__burger { display: flex; }
  .projects__grid { grid-template-columns: 1fr; }
  .testimonials__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; gap: 20px; }
  .contact__form { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }
}
@media (max-width: 460px) {
  .services__grid, .stats__grid { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
