 

:root {
  --bg-0: #0a0a0a;
  --bg-1: #111213;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eaeaea;
  --muted: #a8a8a8;
  --accent: #9e9e9e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --maxw: 1120px;
}

:root[data-theme="light"] {
  --bg-0: #f7f7f7;
  --bg-1: #ffffff;
  --surface: rgba(0, 0, 0, 0.03);
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --accent: #3a3a3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
}

#bg-canvas, #bg-fallback {
  position: fixed;
  inset: 0;
  z-index: -2;
}
#bg-canvas { pointer-events: none; }

#bg-fallback {
  z-index: -3;
  background:
    radial-gradient(1200px 1200px at 10% 20%, rgba(255,255,255,0.06), transparent 55%),
    radial-gradient(1000px 1000px at 80% 0%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(900px 900px at 50% 90%, rgba(255,255,255,0.04), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  filter: saturate(0.2) contrast(1.1);
  animation: floatBg 30s ease-in-out infinite alternate;
}

:root[data-theme="light"] #bg-fallback {
  background:
    radial-gradient(1000px 1000px at 12% 22%, rgba(0,0,0,0.05), transparent 55%),
    radial-gradient(900px 900px at 78% 8%, rgba(0,0,0,0.04), transparent 60%),
    radial-gradient(800px 800px at 52% 92%, rgba(0,0,0,0.035), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  filter: saturate(0.4) contrast(1.02);
}

@keyframes floatBg {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(0,-2%,0) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #bg-fallback { animation: none; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0;
}

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  padding: 14px 20px; backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(10,10,10,0.8), rgba(10,10,10,0.4));
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
}

.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.logo {
  width: 36px; height: 36px; display: grid; place-items: center; font-weight: 800; letter-spacing: 0.5px;
  border-radius: 50%; background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}

.site-nav { display: flex; gap: 14px; align-items: center; justify-content: center; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,0.06); }

.site-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); padding: 10px 14px; border-radius: 12px; color: var(--text); text-decoration: none; background: rgba(255,255,255,0.04); }
.btn:hover { background: rgba(255,255,255,0.08); }
.btn.primary { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.16); }
.btn.ghost { background: transparent; }

:root[data-theme="light"] .btn { background: rgba(0,0,0,0.03); }
:root[data-theme="light"] .btn:hover { background: rgba(0,0,0,0.06); }
:root[data-theme="light"] .btn.primary { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }

.section { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 72px 20px; }
.section h2 { font-size: 1.8rem; margin: 0 0 18px; letter-spacing: 0.4px; }

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

:root[data-theme="light"] .card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.5));
}

.hero { min-height: clamp(60vh, 80vh, 92vh); display: grid; place-items: center; text-align: center; }
.hero__content { max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 4vw + 1rem, 4rem); line-height: 1.1; margin: 0 0 12px; }
.hero .muted { color: var(--muted); display: block; font-weight: 300; }
.hero .accent { color: #fff; text-shadow: 0 1px 0 rgba(255,255,255,0.02); }
.hero .accent { color: #fff; text-shadow: 0 1px 0 rgba(255,255,255,0.02); }
[data-theme="light"] .hero .accent { color: #111; text-shadow: none; }
.lead { color: var(--muted); font-size: 1.1rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

.grid.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.project .thumb {
  height: 160px; border-radius: calc(var(--radius) - 6px);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 6px);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.project .thumb { position: relative; overflow: hidden; }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.grid.certificates { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.certificate .cert-thumb {
  display: block;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 8px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.certificate .cert-thumb img {
  width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px;
  background: transparent;
}
:root[data-theme="light"] .certificate .cert-thumb { background: #fff; border-color: rgba(0,0,0,0.12); }
.project__body h3 { margin: 0 0 6px; font-size: 1.15rem; }
.project__body p { margin: 0 0 10px; color: var(--muted); }
.links { display: flex; gap: 10px; }
.links a { color: var(--text); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,0.25); }
.links a:hover { border-bottom-style: solid; }

.pillbar { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 0.8rem; color: var(--text); padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.timeline .time { color: var(--muted); font-size: 0.95rem; padding-top: 6px; }
.timeline .entry h3 { margin: 0 0 6px; font-size: 1.05rem; }
.timeline .entry p { margin: 0; color: var(--muted); }

.facts { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 0; margin: 14px 0 0; list-style: none; }
.facts li { color: var(--muted); }

.live-stats {
  display: flex; flex-wrap: wrap; gap: 10px; margin: -6px 0 12px; align-items: center;
}
.live-stats .stat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text); font-size: 0.9rem;
}
:root[data-theme="light"] .live-stats .stat { background: rgba(0,0,0,0.04); }
.live-stats svg { color: var(--muted); }

.contact .socials { display: flex; gap: 12px; margin-top: 10px; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: #d0d0d0; }
.icon:hover { background: rgba(255,255,255,0.1); color: #fff; }

:root[data-theme="light"] .icon { background: rgba(0,0,0,0.04); color: #555; }
:root[data-theme="light"] .icon { background: rgba(0,0,0,0.04); color: #555; }
:root[data-theme="light"] .icon:hover { background: rgba(0,0,0,0.08); color: #111; }

.site-footer { text-align: center; color: var(--muted); padding: 30px 20px 50px; }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .timeline li { grid-template-columns: 1fr; }
  .site-header { grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 8px; }
  .site-nav { grid-column: 1 / -1; justify-content: center; gap: 6px; flex-wrap: wrap; }
}

:focus-visible { outline: 2px dashed #cfcfcf; outline-offset: 3px; }

.toggle-theme .icon-sun { display: none; }
[data-theme="light"] .toggle-theme .icon-sun { display: inline; }
[data-theme="light"] .toggle-theme .icon-moon { display: none; }

.btn.small { padding: 8px 10px; font-size: 0.9rem; border-radius: 10px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); color: #f0f0f0; border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease; z-index: 1000;
}
:root[data-theme="light"] #toast { background: rgba(255,255,255,0.9); color: #111; border-color: rgba(0,0,0,0.12); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.actions-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.contact .socials { margin: 0; }
.contact-actions { display: inline-flex; gap: 10px; }
.contact-actions .btn.small { height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; }
.contact-actions .btn.small .ico { opacity: 0.9; }
.contact-actions .btn.small { background: rgba(255,255,255,0.06); border-color: var(--border); }
.contact-actions .btn.small:hover { background: rgba(255,255,255,0.1); }
:root[data-theme="light"] .contact-actions .btn.small { background: rgba(0,0,0,0.04); }
:root[data-theme="light"] .contact-actions .btn.small:hover { background: rgba(0,0,0,0.08); }

