/* ---------- Theme tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #141517;
  --bg-alt: #1b1d21;
  --card: #202328;
  --text: #e6e8ee;
  --muted: #a3a9b6;
  --accent: #6c63ff;
  --accent-2: #3cc8f0;
  --border: #2c3036;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --net-line: #8a8f99;
  --landscape: url("../assets/landscape-night.png");
}
[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-alt: #eef0f7;
  --card: #ffffff;
  --text: #1d2130;
  --muted: #5b6275;
  --accent: #6c63ff;
  --accent-2: #0e9fcf;
  --border: #dde1ec;
  --shadow: 0 10px 30px rgba(30,40,80,.10);
  --net-line: #9aa3b5;
  --landscape: url("../assets/landscape-day.png");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Poppins", system-ui, sans-serif; font-weight: 300;
  background: var(--bg); color: var(--text); line-height: 1.65;
  transition: background .3s, color .3s;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 500; line-height: 1.25; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 5vw; transition: background .3s, box-shadow .3s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--border); }
.brand { font-weight: 700; font-size: 1.4rem; text-decoration: none; }
.brand span { color: var(--accent); }
.links { display: flex; gap: 26px; }
.links a { text-decoration: none; color: var(--muted); font-weight: 400; font-size: .95rem; }
.links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 8px; }
.theme-btn, .menu-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.05rem;
}
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
#network { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content { position: relative; z-index: 1; text-align: center; padding: 100px 16px 60px; }
.hello { font-weight: 300; font-size: clamp(1.8rem, 4.5vw, 3.1rem); margin: 0 0 22px; }
.wave { height: 1.25em; vertical-align: -0.28em; }
.avatar {
  width: clamp(200px, 30vw, 320px); aspect-ratio: 1; margin: 0 auto;
  border-radius: 50%; background: #f5f5f5; box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.avatar img { width: 100%; height: 100%; display: block; }
.typed { font-size: clamp(1.4rem, 3.4vw, 2.5rem); margin: 34px 0 30px; min-height: 1.4em; }
#typed { font-weight: 400; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.social {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); transition: transform .2s;
}
.social:hover { transform: translateY(-4px); }
.social img { width: 30px; height: 30px; }
.social-letter { font-size: 1.4rem; font-weight: 600; color: var(--accent-2); }

/* ---------- Sections ---------- */
.section { padding: 96px 5vw; }
.section.alt { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; }
.title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 0 10px; }
.title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin-top: 10px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.lead { color: var(--muted); margin: 0 0 36px; }

.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.about-text p { color: var(--muted); }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.about-art { width: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 500; border: 1px solid var(--accent);
}
.btn img { width: 18px; filter: invert(1); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.small { padding: 8px 14px; font-size: .9rem; }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 30px; }
.skill-card, .card, .tl-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.skill-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .8rem; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }

.timeline { position: relative; display: grid; gap: 20px; margin-top: 30px; padding-left: 26px; border-left: 2px solid var(--border); }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -36px; top: 26px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-2); border: 3px solid var(--bg); }
.tl-item small { color: var(--accent-2); font-weight: 500; }
.tl-item h3 { margin: 4px 0 6px; }
.tl-item p { margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; gap: 10px; transition: transform .2s; }
.card:hover { transform: translateY(-4px); }
.card-img { border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 500; color: var(--accent-2); text-transform: uppercase; letter-spacing: .08em; }
.card-actions { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.soon { font-size: .85rem; color: var(--muted); font-style: italic; }

.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.cert {
  font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); transition: transform .2s;
}
.cert:hover { transform: translateY(-4px); }
.cert img, .cert-fallback { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.cert-fallback {
  display: grid; place-content: center; text-align: center; gap: 4px; color: #fff; font-weight: 500;
  background: linear-gradient(135deg, #0a66c2, #6c63ff);
}
.cert-fallback span { font-size: 2rem; }
.cert-info { padding: 12px 14px; }
.cert-info strong { display: block; font-weight: 500; font-size: .92rem; }
.cert-info small { color: var(--muted); }

.contact { text-align: center; }
.contact .title::after { margin-left: auto; margin-right: auto; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.contact-card { display: grid; gap: 4px; padding: 26px; text-decoration: none; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.contact-card span { font-size: 1.8rem; }
.contact-card small { color: var(--muted); word-break: break-word; }

/* ---------- Footer with day/night landscape ---------- */
.footer { text-align: center; color: var(--muted); font-size: .9rem; background: var(--bg-alt); }
.landscape { height: clamp(160px, 28vw, 320px); background: var(--landscape) center bottom / cover no-repeat; }
.footer p { margin: 0; padding: 18px; }

/* ---------- Certificate viewer ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px; background: rgba(0,0,0,.8); }
.modal.open { display: grid; }
.modal-body img { max-height: 85vh; border-radius: 8px; }
.modal-body iframe { width: min(900px, 92vw); height: 85vh; border: 0; border-radius: 8px; background: #fff; }
.modal-body .missing { color: #fff; }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: 0; color: #fff; font-size: 1.8rem; cursor: pointer; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Additions ---------- */
.hub-pill { text-decoration: none; font-weight: 500; font-size: .88rem; padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; align-self: center; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: -6px 0 30px; }
.scroll-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1; color: var(--muted);
  text-decoration: none; font-size: 2rem; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-block: 1px solid var(--border); }
.stat { background: var(--bg-alt); padding: 28px 16px; text-align: center; display: grid; gap: 4px; }
.stat strong { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: .88rem; }
.hub-banner { padding: 56px 5vw; background: linear-gradient(120deg, #4b3fd8, #6c63ff 45%, #0e9fcf); color: #fff; }
.hub-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.hub-inner h2 { margin: 4px 0 6px; font-size: clamp(1.4rem, 3vw, 2rem); }
.hub-inner p, .hub-inner small { margin: 0; opacity: .9; }
.btn.light { background: #fff; color: #3b31c9; border-color: #fff; }
.contact-form { max-width: 720px; margin: 36px auto 0; text-align: left; display: grid; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.contact-form h3 { margin: 0 0 4px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-form input, .contact-form textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.contact-form .btn { justify-self: start; cursor: pointer; font: inherit; font-weight: 500; }
.form-note { color: var(--muted); }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; text-decoration: none; font-size: 1.2rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .menu-btn { display: inline-block; }
  .links { position: absolute; top: 64px; right: 16px; left: 16px; flex-direction: column; gap: 0; display: none;
    background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; }
  .links.open { display: flex; }
  .links a { padding: 10px 14px; }
  .about { grid-template-columns: 1fr; }
  .social { width: 54px; height: 54px; }
  .section { padding: 72px 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .contact-form .row { grid-template-columns: 1fr; }
  .hub-pill { padding: 8px 12px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}
