:root {
  --bg: #f6f8fb; --surface: #ffffff; --ink: #14213d; --muted: #5b6678;
  --accent: #3a5bff; --accent-soft: #e6ebff; --line: #dde3ee;
  --head: 'Sora', 'Segoe UI', sans-serif; --body: 'DM Sans', 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1424; --surface: #161e33; --ink: #eef1f8; --muted: #9aa6bd; --accent: #7d93ff; --accent-soft: #212c52; --line: #26304d; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { font-family: var(--body); background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
section { padding: 96px 24px; max-width: 1000px; margin: 0 auto; }

/* Section headings with icons */
h2 { font-family: var(--head); font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 32px; }
.section-title { display: flex; align-items: center; gap: 14px; }
.title-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; transition: transform .3s; }
.section-title:hover .title-icon { transform: rotate(-8deg) scale(1.08); }

/* Navbar */
nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1000px; margin: 0 auto; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-family: var(--head); font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 14px; }
.links { display: flex; gap: 22px; flex-wrap: wrap; }
.links a { font-size: .95rem; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.links a:hover, .links a.on { color: var(--ink); border-color: var(--accent); }

/* Hero */
.hero { min-height: 86vh; display: flex; flex-direction: column; justify-content: center; position: relative; }
.hero h1 { font-family: var(--head); font-weight: 800; font-size: clamp(2.4rem, 8vw, 4.6rem); line-height: 1.1; letter-spacing: -0.02em; }
.hero .role { font-family: var(--head); font-size: clamp(1.2rem, 3.5vw, 1.8rem); color: var(--accent); margin: 14px 0 20px; min-height: 2.4rem; }
.cursor { display: inline-block; width: 3px; height: 1.1em; background: var(--accent); margin-left: 4px; vertical-align: -0.15em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p { color: var(--muted); max-width: 520px; font-size: 1.1rem; }
.btns { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn { font-family: var(--head); font-weight: 600; font-size: .95rem; padding: 13px 26px; border-radius: 10px; border: 2px solid var(--accent); transition: transform .2s; display: inline-block; cursor: pointer; }
.btn.fill { background: var(--accent); color: #fff; }
.btn.line { color: var(--accent); background: transparent; }
.btn:hover { transform: translateY(-3px); }
.orb { position: absolute; right: 0; top: 18%; width: min(340px, 44vw); aspect-ratio: 1; border-radius: 42% 58% 55% 45% / 50% 40% 60% 50%; background: linear-gradient(135deg, var(--accent), #ffb703); opacity: .22; animation: morph 12s ease-in-out infinite; z-index: -1; }
@keyframes morph { 50% { border-radius: 58% 42% 40% 60% / 45% 58% 42% 55%; transform: rotate(40deg) scale(1.06); } }

/* About */
.about { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.photo { aspect-ratio: 1; border-radius: 20px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: var(--surface); }
.photo-img { width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); }
.about-text { color: var(--muted); font-size: 1.05rem; margin-bottom: 14px; max-width: 60ch; }
.facts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 22px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.facts small { display: block; color: var(--muted); }
.facts strong { font-family: var(--head); font-weight: 600; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px 40px; }
.skill-top { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 8px; }
.track { height: 10px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.fill-bar { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s, box-shadow .25s; }
.card.show { opacity: 1; transform: none; }
.card:hover { box-shadow: 0 14px 30px rgba(58, 91, 255, .14); }
.card h3 { font-family: var(--head); font-size: 1.2rem; }
.card p { color: var(--muted); flex: 1; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span { background: var(--accent-soft); color: var(--accent); font-size: .8rem; padding: 3px 11px; border-radius: 99px; }
.card a.gh { color: var(--accent); font-weight: 500; }
.card a.gh:hover { text-decoration: underline; }

/* Resume */
.resume { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px; text-align: center; }
.resume p { color: var(--muted); margin-bottom: 22px; }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.c-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; transition: border-color .2s, transform .2s; overflow-wrap: anywhere; }
.c-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.c-item small { display: block; color: var(--muted); }
.c-item strong { font-family: var(--head); font-weight: 600; }
footer { text-align: center; color: var(--muted); padding: 32px 24px 48px; font-size: .9rem; }

/* Mobile */
@media (max-width: 700px) {
  .about { grid-template-columns: 1fr; }
  .photo, .photo-img { max-width: 180px; }
  .orb { opacity: .12; }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}