:root {
  --bg: #060913;
  --bg-soft: #0d1327;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --text: #f6f8ff;
  --muted: #b8c1dc;
  --accent: #7c8dff;
  --accent-2: #4de5cf;
  --accent-3: #ff74bd;
  --radius: 1.15rem;
  --shadow: 0 24px 90px rgba(6, 9, 19, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #1a2250 0%, #090f21 44%), var(--bg);
  scroll-behavior: smooth;
}

body.nav-open { overflow: hidden; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 12% 16%, rgba(124, 141, 255, 0.24), transparent 70%),
    radial-gradient(closest-side at 88% 10%, rgba(77, 229, 207, 0.2), transparent 70%),
    radial-gradient(closest-side at 45% 90%, rgba(255, 116, 189, 0.18), transparent 70%);
  filter: blur(18px);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  opacity: 0.15;
}

.container { width: min(1140px, 92vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(14px);
  background: rgba(9, 15, 32, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrap {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}
.brand { color: var(--text); text-decoration: none; font-weight: 900; letter-spacing: 0.02em; }
.brand span { color: var(--accent-2); }

.nav { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 180ms ease;
}
.nav a:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 9, 19, 0.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.menu-toggle-line {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 200ms ease, opacity 200ms ease;
}

.menu-toggle.open .menu-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open .menu-toggle-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open .menu-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

main { padding-bottom: 2rem; }

.hero { padding: clamp(4.5rem, 8vw, 6rem) 0 2.4rem; }
.hero-quote,
.closing-quote {
  margin: 0;
  text-align: center;
  color: #d8deff;
  font-style: italic;
  letter-spacing: 0.01em;
}

.hero-quote {
  position: relative;
  display: flex;
  justify-content: center;
  max-width: 720px;
  margin: 0.6rem auto 0;
  padding: 0.4rem 1.6rem;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 6px 18px rgba(15, 24, 52, 0.55);
}

.hero-quote-text {
  display: inline-block;
  margin: 0 auto;
  padding-right: 0.35rem;
  font-family: "Space Mono", "Inter", monospace;
  font-size: clamp(0.72rem, 1.95vw, 1.15rem);
  letter-spacing: 0.025em;
  white-space: pre-wrap;
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.78);
  min-height: 1.35em;
  animation: heroCaretBlink 0.7s steps(1) infinite;
}

.hero-layout {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 1.4rem;
  align-items: center;
}

.tag {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
}

.hero h1 { margin: 0.9rem 0 1rem; font-size: clamp(2.1rem, 5vw, 4.5rem); line-height: 1.15; }
.name-gradient {
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  color: transparent;
}

.role-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  width: 100%;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  line-height: 1.3;
  color: var(--muted);
  flex-wrap: nowrap;
}

.rolling-wrapper {
  position: relative;
  height: 1.4em;
  width: clamp(16ch, 26vw, 22ch);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

.rolling-track {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.rolling-track span {
  display: block;
  height: 1.4em;
  line-height: 1.4em;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

@keyframes heroCaretBlink {
  0%, 45% { border-right-color: rgba(255, 255, 255, 0.78); }
  55%, 100% { border-right-color: transparent; }
}

.lead { color: var(--muted); max-width: 60ch; line-height: 1.72; }

.hero-stats {
  margin-top: 1.8rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.hero-stats > div {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.9rem;
  padding: 0.8rem;
}
.hero-stats h3 { margin: 0; font-size: 1.06rem; }
.hero-stats p { margin: 0.28rem 0 0; color: var(--muted); font-size: 0.88rem; }

.hero-actions { margin-top: 1.45rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  text-decoration: none;
  font-weight: 700;
  color: white;
  background: linear-gradient(125deg, var(--accent), #6dd8ff 70%);
  border-radius: 0.76rem;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 9px 24px rgba(102, 135, 255, 0.34);
  transition: transform 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.23);
  box-shadow: none;
}
.btn-small { font-size: 0.9rem; padding: 0.6rem 0.95rem; }

.profile-card,
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-card {
  overflow: hidden;
  transform: perspective(900px) rotateY(-4deg);
  transition: transform 240ms ease;
}
.profile-card:hover { transform: perspective(900px) rotateY(0deg) translateY(-3px); }
.profile-card img { width: 100%; height: 450px; object-fit: cover; display: block; }
.profile-meta {
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.profile-meta h3 { margin: 0; }
.profile-meta p { color: var(--muted); margin: 0; text-align: center; }

section { margin: 0; }
main > section:not(.hero) {
  padding-block: clamp(2.8rem, 6vw, 4.2rem);
}
main > section + section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.section-head h2 { margin: 0.4rem 0 0; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.section-head + * { margin-top: 1.15rem; }
.panel { padding: 0; }

.grid { display: grid; gap: 1rem; margin-top: 0; align-items: stretch; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.section-head + .grid { margin-top: 1.15rem; }

.card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 100%;
  transition: transform 200ms ease, border-color 200ms ease;
}
.card:hover { transform: translateY(-5px); border-color: rgba(124, 141, 255, 0.58); }
.card p { color: var(--muted); line-height: 1.55; }
.card a { color: #d8e0ff; text-decoration: none; font-weight: 600; }
.card a:hover { text-decoration: underline; }
.project-card a { margin-top: auto; }

.project-thumb {
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(77, 229, 207, 0.08));
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transform: scale(1.02);
  transition: transform 250ms ease;
}

.project-card:hover .thumb img { transform: scale(1.06); }

.skill-list,
.achievement-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.skill-list li,
.achievement-list li {
  display: flex;
  gap: 0.45rem;
  line-height: 1.45;
}

.skill-list li::before,
.achievement-list li::before {
  content: '•';
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 1.1rem;
}

.skill-list li::before { color: var(--accent-2); }
.achievement-list li::before { color: var(--accent-3); }

.skill-icon {
  font-size: 1.35rem;
  margin-right: 0.4rem;
}

.thumb {
  min-height: 165px;
  border-radius: 0.9rem;
  margin: 0 0 0.8rem;
  overflow: hidden;
}
.gradient-1 { background: linear-gradient(135deg, #ff9ec4, #7f89ff 52%, #56efd0); }
.education-card {
  gap: 0.6rem;
}

.edu-headline {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.edu-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.education-card p { margin: 0; }
.education-card p + p { margin-top: 0.5rem; }
.gradient-2 { background: linear-gradient(135deg, #ffbe7a, #f76895 52%, #875eff); }
.gradient-3 { background: linear-gradient(135deg, #53ceff, #6cf6c7 52%, #7982ff); }

.highlight { border: 1px solid rgba(77, 229, 207, 0.42); }

.timeline { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.timeline small { color: #c7d1f5; font-weight: 600; }

.cta { text-align: center; padding-bottom: 3rem; }
.contact-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.contact-links a {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-weight: 600;
}
.contact-links a:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 141, 255, 0.62);
  background: rgba(124, 141, 255, 0.18);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0.35rem;
}

.contact-cta {
  width: 100%;
  margin-top: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  justify-content: center;
}

.btn-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fefbff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(6, 9, 19, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.32);
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(9, 12, 24, 0.65);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.btn-live::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, #4de5cf, #7c8dff, #ff74bd);
  background-size: 200% 200%;
  z-index: -1;
  opacity: 0.9;
  transition: opacity 200ms ease, background-position 400ms ease;
}

.btn-live:hover {
  transform: translateY(-2px);
}

.btn-live:hover::before {
  background-position: 100% 0;
  opacity: 1;
}

.closing-quote { margin-top: 2rem; }

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 1.25rem 0 2rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    top: 74px;
    left: auto;
    right: 1rem;
    bottom: auto;
    width: min(320px, 86vw);
    border-radius: 0 0 0 1.25rem;
    background: linear-gradient(185deg, rgba(4, 7, 16, 0.97), rgba(12, 19, 44, 0.9));
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 1.1rem;
    padding: 1rem 1.5rem 1.8rem;
    z-index: 60;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 260ms ease, opacity 260ms ease;
    overflow-y: auto;
    max-height: calc(100vh - 96px);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.32);
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav a {
    font-size: 1.15rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav a:last-child { border-bottom: none; }
  .hero-layout,
  .timeline,
  .grid.two,
  .grid.three,
  .hero-stats { grid-template-columns: 1fr; }
  .profile-card { transform: none; }
  .profile-card img { height: 360px; }
}

@media (max-width: 640px) {
  .edu-headline { flex-direction: column; align-items: flex-start; }
  .edu-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0.35rem;
  }
  .nav-actions .btn { display: none; }
}