:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-alt: #eef2f8;
  --text: #172033;
  --muted: #5f6878;
  --primary: #3157d5;
  --primary-dark: #2344b1;
  --border: #dfe4ee;
  --shadow: 0 18px 50px rgba(28, 39, 66, 0.1);
  --header: rgba(247, 248, 252, 0.88);
}

body.dark {
  --bg: #0d111b;
  --surface: #151b28;
  --surface-alt: #101622;
  --text: #f3f5fa;
  --muted: #a9b1c1;
  --primary: #7c9cff;
  --primary-dark: #9bb2ff;
  --border: #293247;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --header: rgba(13, 17, 27, 0.88);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.section { padding: 110px 0; scroll-margin-top: 80px; }
.section-alt { background: var(--surface-alt); }

.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--header); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-color: var(--border); }
.navbar { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { font-family: "Space Grotesk", sans-serif; font-size: 1.25rem; font-weight: 700; }
.brand span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: .93rem; font-weight: 600; transition: .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.theme-toggle, .menu-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; font-size: 1.1rem; }
.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; padding: 10px; }
.menu-toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; }

.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 130px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 80px; }
.eyebrow { color: var(--primary); font-size: .79rem; font-weight: 800; letter-spacing: .18em; margin-bottom: 14px; }
.hero h1 { font-family: "Space Grotesk", sans-serif; font-size: clamp(3.3rem, 8vw, 6.6rem); line-height: .95; letter-spacing: -.06em; }
.hero h2 { margin-top: 20px; font-size: clamp(1.5rem, 3vw, 2.35rem); color: var(--primary); }
.hero-text { max-width: 690px; margin-top: 25px; color: var(--muted); font-size: 1.07rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn { padding: 13px 22px; border-radius: 10px; font-weight: 700; border: 1px solid var(--border); transition: transform .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); }
.social-row { display: flex; gap: 22px; margin-top: 30px; }
.social-row a { color: var(--muted); font-weight: 700; }
.social-row a:hover { color: var(--primary); }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: -50px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 20%, transparent), transparent 65%); }
.profile-card { position: relative; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 26px; border-radius: 26px; transform: rotate(2deg); }
.profile-placeholder { min-height: 350px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(145deg, var(--primary), #7f95e9); color: white; font-family: "Space Grotesk"; font-size: 7rem; font-weight: 700; letter-spacing: -.08em; }
.availability { display: flex; align-items: center; gap: 9px; margin-top: 22px; font-weight: 700; }
.availability span { width: 10px; height: 10px; border-radius: 50%; background: #24ba69; box-shadow: 0 0 0 6px rgba(36,186,105,.12); }
.profile-card p { color: var(--muted); font-size: .9rem; margin-top: 10px; }

.two-column, .contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 90px; align-items: start; }
.section-heading h2 { font-family: "Space Grotesk"; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.15; letter-spacing: -.035em; }
.section-heading > p:last-child { color: var(--muted); margin-top: 15px; max-width: 680px; }
.centered { text-align: center; max-width: 760px; margin: 0 auto 55px; }
.centered > p:last-child { margin-inline: auto; }
.about-copy p { color: var(--muted); margin-bottom: 18px; }
.interest-box { margin-top: 30px; padding: 26px; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; }
.interest-box h3 { margin-bottom: 8px; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; transition: transform .25s, box-shadow .25s; }
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.skill-card span { display: inline-block; color: var(--primary); font-size: .78rem; font-weight: 800; margin-bottom: 24px; }
.skill-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.skill-card p { color: var(--muted); font-size: .93rem; }

.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px; position: relative; overflow: hidden; }
.project-card::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.project-card:hover::after { transform: scaleX(1); }
.project-number { color: var(--primary); font-size: .78rem; font-weight: 800; }
.project-card h3 { font-size: 1.35rem; margin: 16px 0 10px; }
.project-card p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.tags span { background: var(--surface-alt); border: 1px solid var(--border); padding: 5px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.project-card > a { color: var(--primary); font-weight: 800; }

.table-wrap { margin-top: 42px; overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th, td { text-align: left; padding: 20px 22px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-alt); font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; }
td { color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }

.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 12px 30px; box-shadow: var(--shadow); }
.contact-card > div { padding: 22px 0; border-bottom: 1px solid var(--border); }
.contact-card > div:last-child { border-bottom: none; }
.contact-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.contact-card a { color: var(--primary); font-weight: 700; word-break: break-word; }
.contact-card p { color: var(--text); }

footer { padding: 26px 0; border-top: 1px solid var(--border); background: var(--surface); }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .9rem; }
.footer-content a { font-weight: 700; color: var(--primary); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero-grid, .two-column, .contact-grid { grid-template-columns: 1fr; gap: 55px; }
  .hero { padding-top: 120px; }
  .hero-visual { max-width: 520px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section { padding: 82px 0; }
  .menu-toggle { display: block; margin-left: auto; }
  .theme-toggle { margin-left: 8px; }
  .nav-links {
    position: absolute; top: 74px; left: 20px; right: 20px; display: none;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; }
  .projects-grid, .skills-grid { grid-template-columns: 1fr; }
  .profile-placeholder { min-height: 280px; font-size: 5rem; }
  .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .container { width: min(100% - 26px, 1120px); }
  .hero h1 { font-size: 3.35rem; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .project-card, .skill-card, .contact-card { padding: 23px; }
}

.profile-photo {
  width: 100%;
  min-height: 350px;
  object-fit: cover;
  border-radius: 18px;
}