:root {
  --bg: #0a101b;
  --surface: #121b2a;
  --surface-2: #162132;
  --line: rgba(148, 163, 184, 0.2);
  --text: #edf2f7;
  --muted: #97a6ba;
  --accent: #4fd1ff;
  --accent-2: #88e3ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(79, 209, 255, 0.12), transparent 22%),
    radial-gradient(circle at left center, rgba(136, 227, 255, 0.06), transparent 18%),
    var(--bg);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}
.narrow { width: min(calc(100% - 2rem), 880px); }
.section { padding: 6.5rem 0; }
.section-sm { padding: 1rem 0 0; }
.section-topless { padding-top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 16, 27, 0.5);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.site-header.scrolled,
.solid-header {
  background: rgba(10, 16, 27, 0.88);
  border-color: var(--line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
}
.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #02131a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand-text { font-size: 0.95rem; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-links a:not(.btn) {
  color: var(--muted);
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  margin: 6px 0;
  border-radius: 99px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 0.72rem 1rem; font-size: 0.92rem; }
.btn-primary {
  color: #02131a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.btn-outline {
  border-color: rgba(79, 209, 255, 0.45);
  background: rgba(79, 209, 255, 0.08);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--muted);
  background: transparent;
}

.hero-grid,
.split-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.hero { padding-top: 4.8rem; }
.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero h1, .project-page-title {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.7rem);
  line-height: 1.04;
}
.hero h2 {
  margin: 1rem 0 1.2rem;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--muted);
  font-weight: 600;
}
.lead {
  max-width: 62ch;
  font-size: 1.08rem;
  color: #d9e3f0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.8rem 0 1.4rem;
}
.hero-badges,
.exp-tags,
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.hero-badges span,
.exp-tags span,
.chip-wrap span {
  padding: 0.58rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #d5dfec;
  font-size: 0.9rem;
}
.portrait-card,
.highlight-card,
.info-card,
.exp-card,
.project-card,
.resume-card,
.contact-card,
.cred-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 33, 50, 0.85), rgba(18, 27, 42, 0.95));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.portrait-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
}
.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(79, 209, 255, 0.7), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
.portrait-card img {
  border-radius: calc(var(--radius) - 8px);
  width: 100%;
  min-height: 560px;
  object-fit: cover;
}
.mini-panel {
  position: absolute;
  right: 1.6rem;
  bottom: 1.6rem;
  max-width: 260px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(79, 209, 255, 0.25);
  border-radius: 18px;
  background: rgba(10, 16, 27, 0.84);
  backdrop-filter: blur(8px);
}
.mini-panel strong,
.cred-card strong,
.contact-card strong { display: block; }
.mini-panel span,
.cred-card span,
.contact-card span { color: var(--muted); }

.cred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.cred-card { padding: 1.35rem 1.2rem; }
.cred-card strong { font-size: 1rem; margin-bottom: 0.35rem; }
.section-heading { margin-bottom: 2rem; }
.section-heading h3,
.section-copy h3,
.resume-card h3 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  line-height: 1.2;
}
.section-note { color: var(--muted); margin-top: -0.2rem; }
.highlight-card,
.resume-card,
.contact-card,
.info-card,
.project-card,
.exp-card { padding: 1.5rem; }
.highlight-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.highlight-card li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.highlight-card li:last-child { border-bottom: 0; }
.card-grid {
  display: grid;
  gap: 1.3rem;
}
.skills-grid {
  grid-template-columns: repeat(3, 1fr);
}
.skills-grid article:nth-child(4) { grid-column: span 1; }
.skills-grid article:nth-child(5) { grid-column: span 2; }
.info-card h4,
.project-card h4,
.exp-card h4,
.highlight-card h4 { margin-top: 0; margin-bottom: 1rem; font-size: 1.15rem; }
.timeline { display: grid; gap: 1.35rem; }
.exp-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.exp-brand {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  padding: 0.55rem;
}
.exp-brand img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.exp-head p { margin: 0.2rem 0 0; color: var(--muted); }
.exp-date {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}
.exp-card ul { margin: 0 0 1.1rem 1rem; padding: 0; }
.exp-card li { margin-bottom: 0.75rem; }
.project-grid { grid-template-columns: repeat(2, 1fr); }
.project-card p { color: #d6dfec; }
.text-link {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--accent-2);
  font-weight: 600;
}
.resume-card { text-align: center; }
.center-actions { justify-content: center; }
.contact-card {
  display: grid;
  gap: 0.9rem;
}
.contact-card a {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.contact-card a:hover,
.info-card:hover,
.exp-card:hover,
.project-card:hover,
.cred-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 209, 255, 0.35);
}
.info-card,
.exp-card,
.project-card,
.cred-card,
.contact-card a {
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
  background: rgba(8, 12, 20, 0.7);
}
.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-wrap p { color: var(--muted); margin: 0.3rem 0 0; }
.footer-links { display: flex; gap: 1rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.project-page-main { min-height: calc(100vh - 180px); }

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

@media (max-width: 980px) {
  .hero-grid,
  .split-grid,
  .contact-grid,
  .skills-grid,
  .project-grid,
  .cred-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid,
  .split-grid,
  .contact-grid { gap: 2rem; }
  .skills-grid article:nth-child(5) { grid-column: span 2; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: rgba(10, 16, 27, 0.98);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .hero-grid,
  .split-grid,
  .contact-grid,
  .skills-grid,
  .project-grid,
  .cred-grid,
  .footer-wrap {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
  .hero { padding-top: 3.5rem; }
  .portrait-card img { min-height: auto; aspect-ratio: 4/5; }
  .mini-panel {
    position: static;
    margin-top: 1rem;
    max-width: none;
  }
  .exp-head {
    grid-template-columns: auto 1fr;
  }
  .exp-date {
    grid-column: 1 / -1;
    text-align: left;
  }
  .section { padding: 5rem 0; }
}

@media (max-width: 560px) {
  .container { width: min(calc(100% - 1.2rem), var(--container)); }
  .brand-text { display: none; }
  .hero h1, .project-page-title { font-size: 2.45rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-badges span,
  .exp-tags span,
  .chip-wrap span { font-size: 0.84rem; }
}
