/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #f6faf8;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --border: rgba(10, 60, 40, 0.09);
  --text: #0c1d15;
  --text-muted: #53675c;
  --accent: #059669;            /* emerald */
  --accent-2: #84cc16;          /* lime */
  --accent-3: #14b8a6;          /* teal */
  --accent-soft: rgba(5, 150, 105, 0.09);
  --accent-ink: #ffffff;
  --gradient: linear-gradient(120deg, #047857 0%, #10b981 55%, #84cc16 100%);
  --gradient-text: linear-gradient(110deg, #047857 0%, #10b981 60%, #65a30d 100%);
  --glow: rgba(16, 185, 129, 0.14);
  --shadow: 0 10px 30px -14px rgba(6, 60, 40, 0.18);
  --shadow-lg: 0 26px 60px -24px rgba(6, 60, 40, 0.30);
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1160px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Manrope", var(--font);
  --nav-h: 72px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07110c;
  --bg-alt: #0b1711;
  --surface: rgba(18, 34, 26, 0.7);
  --surface-solid: #11201a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8f3ed;
  --text-muted: #9bb3a6;
  --accent: #34d399;
  --accent-2: #a3e635;
  --accent-3: #2dd4bf;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --accent-ink: #04140c;
  --gradient: linear-gradient(120deg, #10b981 0%, #34d399 50%, #a3e635 100%);
  --gradient-text: linear-gradient(110deg, #34d399 0%, #6ee7b7 50%, #bef264 100%);
  --glow: rgba(52, 211, 153, 0.12);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 26px 60px -20px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.03em; }
h3 { font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 110px 0; position: relative; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 660px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  padding: 6px 12px; border-radius: 999px; background: var(--accent-soft);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gradient); }
.section-title { font-size: clamp(2.1rem, 4.4vw, 3.1rem); }
.lead { font-size: 1.12rem; color: var(--text-muted); }
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600; font-size: 0.97rem;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 12px 26px -12px rgba(5, 150, 105, 0.7); }
.btn-primary::after {           /* light sweep on hover */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s ease;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 18px 34px -14px rgba(5, 150, 105, 0.8); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 18px; height: 18px; }

/* Cards — with a soft spotlight that follows the cursor */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 45%);
  opacity: 0; transition: opacity 0.35s ease;
}
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: 0 1px 0 var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.02em; color: var(--text); display: flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--gradient); color: #fff;
  display: grid; place-items: center; font-size: 0.9rem;
  box-shadow: 0 6px 16px -6px rgba(5, 150, 105, 0.6);
}
.nav-links {
  display: flex; gap: 2px; list-style: none; margin: 0; padding: 5px; align-items: center;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px);
}
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 0.92rem;
  padding: 7px 14px; border-radius: 999px; transition: color 0.2s, background 0.2s;
  display: block;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent-ink); background: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; transition: transform 0.3s ease, border-color 0.2s, color 0.2s;
  backdrop-filter: blur(10px);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(12deg); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-toggle { display: none; }

.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--gradient); z-index: 101; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 90px;
  position: relative; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45;
  animation: float 20s ease-in-out infinite;
}
.blob.b1 { width: 560px; height: 560px; background: #34d399; top: -180px; right: -120px; }
.blob.b2 { width: 440px; height: 440px; background: #a3e635; bottom: -160px; left: -140px; opacity: 0.35; animation-delay: -7s; }
.blob.b3 { width: 320px; height: 320px; background: #2dd4bf; top: 38%; left: 42%; opacity: 0.25; animation-delay: -13s; }
:root[data-theme="dark"] .blob { opacity: 0.22; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -60px) scale(1.1); }
  66% { transform: translate(-40px, 40px) scale(0.92); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 15%, transparent 70%);
}

.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 60px; align-items: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(10px);
  font-size: 0.86rem; font-weight: 500; color: var(--text-muted);
  margin-bottom: 26px;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; position: relative; }
.status-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22c55e; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }

.hero h1 { font-size: clamp(2.8rem, 6.4vw, 4.9rem); margin-bottom: 16px; letter-spacing: -0.045em; }
.hero .typed-line { font-size: clamp(1.2rem, 2.3vw, 1.6rem); font-family: var(--font-display); font-weight: 600; color: var(--text-muted); margin-bottom: 22px; min-height: 1.4em; }
.typed { color: var(--text); }
.cursor { display: inline-block; width: 3px; height: 1.05em; background: var(--accent); margin-left: 3px; vertical-align: -0.15em; border-radius: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { max-width: 560px; margin-bottom: 34px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.socials { display: flex; gap: 10px; }

.hero-visual { position: relative; display: grid; place-items: center; }
.avatar-wrap {
  position: relative; width: min(380px, 80vw); aspect-ratio: 1;
  border-radius: 42% 58% 55% 45% / 45% 40% 60% 55%;
  background: var(--gradient); padding: 6px;
  animation: morph 14s ease-in-out infinite;
  box-shadow: 0 40px 80px -30px rgba(5, 150, 105, 0.55);
}
.avatar-wrap::after {             /* slowly rotating dashed orbit */
  content: ""; position: absolute; inset: -22px; border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  width: 100%; height: 100%; border-radius: inherit;
  background: var(--surface-solid);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--font-display); font-size: 6rem; font-weight: 800; letter-spacing: -0.04em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes morph {
  0%, 100% { border-radius: 42% 58% 55% 45% / 45% 40% 60% 55%; }
  50% { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; }
}
.float-chip {
  position: absolute; z-index: 2;
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(16px);
  border-radius: 16px; padding: 11px 16px 11px 12px;
  box-shadow: var(--shadow);
  font-size: 0.86rem; font-weight: 600;
  display: flex; align-items: center; gap: 11px;
  animation: bob 6s ease-in-out infinite;
}
.float-chip .chip-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--gradient); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.float-chip .chip-ic svg { width: 19px; height: 19px; }
.float-chip small { display: block; color: var(--text-muted); font-weight: 500; font-size: 0.75rem; }
.float-chip.c1 { top: 6%; left: -8%; }
.float-chip.c2 { bottom: 10%; right: -10%; animation-delay: -3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--text-muted); border-radius: 14px; opacity: 0.5;
}
.scroll-hint::after {
  content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--text-muted); border-radius: 2px; animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ==========================================================================
   Marquee strip
   ========================================================================== */
.marquee {
  overflow: hidden; padding: 22px 0;
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 48px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text-muted); letter-spacing: -0.01em;
}
.marquee-item::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   About / stats
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: start; }
.about-text p { color: var(--text-muted); }
.about-text strong { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stat .num { font-family: var(--font-display); font-size: 2.7rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.stat .label { color: var(--text-muted); font-size: 0.92rem; margin-top: 8px; }

.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.skill {
  padding: 8px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.25s ease;
}
.skill:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }

/* ==========================================================================
   Projects
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.filter-btn {
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
  transition: all 0.25s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgba(5,150,105,.7); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project.hide { display: none; }
.project.pop { animation: pop 0.45s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: none; } }
.project-thumb {
  aspect-ratio: 16 / 8; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff;
}
.project-thumb::before {         /* dotted texture */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.22) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: linear-gradient(135deg, #000, transparent 75%);
}
.project-thumb svg { width: 56px; height: 56px; position: relative; filter: drop-shadow(0 8px 16px rgba(0,0,0,.18)); transition: transform 0.5s cubic-bezier(.2,.8,.2,1); }
.project:hover .project-thumb svg { transform: scale(1.15) rotate(-6deg); }
.g1 { background: linear-gradient(135deg, #065f46, #10b981); }
.g2 { background: linear-gradient(135deg, #047857, #84cc16); }
.g3 { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.g4 { background: linear-gradient(135deg, #15803d, #4ade80); }
.g5 { background: linear-gradient(135deg, #134e4a, #059669); }
.g6 { background: linear-gradient(135deg, #3f6212, #a3e635); }
.project-body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.project-meta { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.project-body h3 { font-size: 1.25rem; margin-bottom: 8px; }
.project-body p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.project-link { font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 6px; }
.project-link .arrow { transition: transform 0.25s; }
.project-link:hover .arrow { transform: translateX(4px); }

/* ==========================================================================
   CV / Timeline
   ========================================================================== */
.cv-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; }
.tabs { display: inline-flex; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 40px; position: relative; }
.tab-btn {
  position: relative; z-index: 1;
  padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-weight: 600; font-size: 0.93rem;
  transition: color 0.3s;
}
.tab-btn.active { color: #fff; }
.tab-indicator {                 /* sliding pill behind the active tab */
  position: absolute; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 999px;
  background: var(--gradient); box-shadow: 0 6px 18px -8px rgba(5,150,105,.7);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1), width 0.4s cubic-bezier(.2,.8,.2,1);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.5s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.timeline { position: relative; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline-progress {             /* fills as you scroll */
  position: absolute; left: 9px; top: 6px; width: 2px; height: 0; border-radius: 2px;
  background: linear-gradient(#047857, #10b981, #84cc16);
}
.tl-item { position: relative; margin-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -33px; top: 30px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-item .card { padding: 24px 28px; }
.tl-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.tl-date { font-size: 0.84rem; font-weight: 700; color: var(--accent); }
.tl-item h3 { font-size: 1.2rem; margin-bottom: 2px; }
.tl-org { color: var(--text-muted); font-weight: 500; margin-bottom: 12px; font-size: 0.95rem; }
.tl-item ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 0.95rem; }
.tl-item li { margin-bottom: 4px; }

.skills-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.skills-panel h3 { font-size: 1.15rem; margin-bottom: 20px; }
.skill-list { display: grid; gap: 20px; }
.skills-panel .features { margin: 0; }
.bar-label { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.94rem; margin-bottom: 8px; }
.bar-label span:last-child { color: var(--text-muted); }
.bar { height: 9px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; background: var(--gradient); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }

/* ==========================================================================
   Tutoring
   ========================================================================== */
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 72px; }
.subject .icon {
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 18px;
  transition: background 0.3s, color 0.3s, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.subject .icon svg { width: 24px; height: 24px; }
.subject:hover .icon { background: var(--gradient); color: #fff; transform: rotate(-8deg) scale(1.06); }
.subject h3 { font-size: 1.15rem; }
.subject p { color: var(--text-muted); font-size: 0.94rem; margin: 0; }

.billing-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 40px; font-weight: 600; flex-wrap: wrap; }
.billing-toggle .opt { color: var(--text-muted); transition: color 0.2s; }
.billing-toggle .opt.on { color: var(--text); }
.switch { width: 54px; height: 30px; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--border); position: relative; cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--gradient); transition: transform 0.35s cubic-bezier(.3,1.4,.5,1); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.save-badge { font-size: 0.75rem; padding: 3px 9px; border-radius: 99px; background: rgba(132, 204, 22, 0.16); color: #4d7c0f; }
:root[data-theme="dark"] .save-badge { color: #bef264; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid transparent; background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--gradient) border-box; transform: scale(1.03); }
.price-card.featured:hover { transform: scale(1.03) translateY(-5px); }
.ribbon {
  align-self: flex-start; margin-bottom: 14px;
  background: var(--gradient); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; letter-spacing: 0.05em;
}
.price-card h3 { font-size: 1.25rem; margin-bottom: 4px; }
.price-card .desc { color: var(--text-muted); font-size: 0.92rem; }
.price { font-family: var(--font-display); font-size: 3rem; font-weight: 800; margin: 10px 0 2px; line-height: 1; letter-spacing: -0.04em; }
.price .cur { font-size: 1.5rem; }
.price small { font-family: var(--font); font-size: 0.98rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0; }
.price-note { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 22px; min-height: 1.3em; }
.features { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.features li { padding: 7px 0 7px 30px; position: relative; font-size: 0.95rem; }
.features li::before {
  content: "✓"; position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.72rem; font-weight: 800; display: grid; place-items: center;
}
.price-card .btn { justify-content: center; }

.faq { max-width: 780px; margin: 80px auto 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 22px 0; font-family: inherit; font-size: 1.05rem; font-weight: 600; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.faq-q .plus { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; transition: transform 0.3s, background 0.3s, color 0.3s; font-size: 1.15rem; }
.faq-item.open .plus { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; color: var(--text-muted); }
.faq-a p { padding-bottom: 22px; margin: 0; }

/* ==========================================================================
   Blog
   ========================================================================== */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; color: var(--text); padding: 0; overflow: hidden; }
.post-card:hover { text-decoration: none; }
.post-cover {
  aspect-ratio: 16 / 7; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 18px 22px;
}
.post-cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.22) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: linear-gradient(135deg, #000, transparent 70%);
}
.post-cover .mono {
  position: absolute; right: -6px; bottom: -34px;
  font-family: var(--font-display); font-weight: 800; font-size: 9rem; line-height: 1; color: rgba(255,255,255,0.18);
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.post-card:hover .post-cover .mono { transform: translateY(-10px) rotate(-6deg); }
.post-cover .tag { background: rgba(255,255,255,0.22); color: #fff; backdrop-filter: blur(6px); position: relative; }
.post-card .inner { padding: 22px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.post-meta { display: flex; gap: 8px; align-items: center; font-size: 0.83rem; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap; }
.post-card h3 { font-size: 1.25rem; margin-bottom: 10px; transition: color 0.2s; }
.post-card:hover h3 { color: var(--accent); }
.post-card p { color: var(--text-muted); font-size: 0.95rem; flex: 1; }

.blog-hero { padding: calc(var(--nav-h) + 80px) 0 40px; position: relative; overflow: hidden; }
.blog-tools { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.search { flex: 1; min-width: 240px; position: relative; }
.search input {
  width: 100%; padding: 14px 18px 14px 46px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.98rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 60px 0; display: none; }

.article { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-h) + 60px) 24px 100px; }
.article .back { display: inline-flex; gap: 6px; font-weight: 600; margin-bottom: 30px; }
.article h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 14px 0 18px; }
.article .post-cover { border-radius: var(--radius); margin: 30px 0 40px; aspect-ratio: 16 / 6; }
.prose { font-size: 1.08rem; line-height: 1.8; }
.prose h2 { font-size: 1.6rem; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose blockquote { margin: 1.6em 0; padding: 16px 22px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); font-weight: 500; }
.prose code { font-size: 0.9em; background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0c1d15; color: #e8f3ed; padding: 20px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.9rem; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius-sm); margin: 1.5em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.share { display: flex; gap: 10px; align-items: center; margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border); color: var(--text-muted); font-weight: 600; }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-size: 0.92rem; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 50px; }
.contact-info .item { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.contact-info .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.contact-info .ic svg { width: 22px; }
.contact-info small { display: block; color: var(--text-muted); font-size: 0.82rem; }
.contact-info a, .contact-info span { font-weight: 600; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 0.97rem; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-status { margin-top: 14px; font-weight: 600; font-size: 0.94rem; min-height: 1.4em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { padding: 40px 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all 0.3s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ==========================================================================
   Language switcher
   ========================================================================== */
.lang-switch { position: relative; }
.lang-btn {
  height: 42px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em;
  cursor: pointer; transition: border-color 0.2s, color 0.2s; backdrop-filter: blur(10px);
}
.lang-btn:hover, .lang-switch.open .lang-btn { border-color: var(--accent); color: var(--accent); }
.lang-btn svg { width: 17px; height: 17px; transition: transform 0.5s ease; }
.lang-switch.open .lang-btn svg { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 180px;
  padding: 6px; border-radius: 16px;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(-8px) scale(0.97); transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 110;
}
.lang-switch.open .lang-menu { opacity: 1; pointer-events: auto; transform: none; }
.lang-menu button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; font-weight: 500; color: var(--text); text-align: left;
}
.lang-menu button:hover { background: var(--accent-soft); }
.lang-menu button small { color: var(--text-muted); font-weight: 700; font-size: 0.75rem; }
.lang-menu button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lang-menu button[aria-checked="true"] small { color: var(--accent); }

main, header, section, footer, .nav-links { transition: opacity 0.18s ease; }
body.lang-fade main, body.lang-fade header, body.lang-fade section,
body.lang-fade footer, body.lang-fade .nav-links { opacity: 0.15; }

/* ==========================================================================
   Reveal animations & cursor glow
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(30px); filter: blur(4px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1), filter 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; filter: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

.cursor-glow {
  position: fixed; width: 460px; height: 460px; border-radius: 50%;
  pointer-events: none; z-index: -1;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s; opacity: 0;
}
@media (hover: hover) { body:hover .cursor-glow { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .avatar-wrap { width: min(260px, 66vw); }
  .avatar { font-size: 4.4rem; }
  .float-chip.c1 { left: -4%; }
  .float-chip.c2 { right: -4%; }
  .pricing { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .price-card.featured { transform: none; }
  .price-card.featured:hover { transform: translateY(-5px); }
  .skills-panel { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .menu-toggle { display: grid; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px; border-radius: var(--radius);
    background: var(--surface-solid); box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transform: translateY(-10px);
    transition: all 0.3s ease;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { padding: 12px 16px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .section { padding: 80px 0; }
  .form-row { grid-template-columns: 1fr; }
  .projects, .posts { grid-template-columns: 1fr; }
  .tabs { display: flex; width: 100%; }
  .tab-btn { flex: 1; padding: 10px 6px; font-size: 0.86rem; }
  .card { padding: 24px; }
  .float-chip { display: none; }
  .nav-actions { gap: 6px; }
  .lang-btn { padding: 0 11px; }
  .logo { font-size: 1.1rem; }
}
@media (max-width: 360px) { .logo-text { display: none; } }
