:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f3f8;
  --text: #182333;
  --text-muted: #475467;
  --border: #d8e0ec;
  --line: #e7edf5;
  --accent: #1163ff;
  --accent-2: #0b4ed0;
  --shadow: 0 18px 40px rgba(18, 40, 72, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  --bg: #0f1725;
  --surface: #162032;
  --surface-soft: #1b273b;
  --text: #f4f8ff;
  --text-muted: #b7c4d7;
  --border: #27344c;
  --line: #223149;
  --accent: #6da1ff;
  --accent-2: #8ab4ff;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1725;
    --surface: #162032;
    --surface-soft: #1b273b;
    --text: #f4f8ff;
    --text-muted: #b7c4d7;
    --border: #27344c;
    --line: #223149;
    --accent: #6da1ff;
    --accent-2: #8ab4ff;
    --shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(17, 99, 255, 0.1), transparent 40%),
    radial-gradient(circle at 15% 0, rgba(17, 99, 255, 0.08), transparent 30%),
    var(--bg);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  backdrop-filter: none;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.24s ease,
    border-color 0.24s ease,
    backdrop-filter 0.24s ease;
}

.site-header.is-scrolled {
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom-color: var(--line);
}

.header-inner {
  width: min(1120px, 92vw);
  margin: 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: "Sora", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.6rem 0.22rem 0.22rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.brand span {
  white-space: nowrap;
}

.main-nav {
  margin-left: auto;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a {
  display: inline-block;
  padding: 0.45rem 0.68rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  margin: 4px auto;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.site-header:not(.is-scrolled) .brand {
  color: #f6f9ff;
  background: rgba(7, 16, 32, 0.45);
  border-color: rgba(226, 238, 255, 0.4);
}

.site-header:not(.is-scrolled) .nav-links a {
  color: rgba(237, 245, 255, 0.9);
}

.site-header:not(.is-scrolled) .nav-links a:hover,
.site-header:not(.is-scrolled) .nav-links a.active {
  color: #ffffff;
  background: rgba(7, 16, 32, 0.45);
}

.site-header:not(.is-scrolled) .theme-toggle,
.site-header:not(.is-scrolled) .menu-toggle {
  color: #f6f9ff;
  background: rgba(7, 16, 32, 0.45);
  border-color: rgba(226, 238, 255, 0.4);
}

.site-header:not(.is-scrolled) .menu-toggle span {
  background: #f6f9ff;
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.section {
  scroll-margin-top: 90px;
  margin: clamp(2.8rem, 7vw, 5rem) 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.3rem);
  max-width: 18ch;
}

h1 span {
  display: block;
  margin-top: 0.7rem;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  font-weight: 600;
  color: var(--text-muted);
  max-width: 46ch;
}

h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  max-width: 28ch;
}

h3 {
  font-size: 1.12rem;
}

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0 calc(50% - 50vw) clamp(2.8rem, 7vw, 5rem);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #081528;
}

.hero-layout {
  width: min(1120px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6rem, 12vh, 8rem) 0 clamp(2rem, 7vh, 3rem);
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 880px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.15rem;
  padding: clamp(0.8rem, 2vw, 1.2rem);
  border-radius: 16px;
  background: rgba(6, 15, 29, 0.42);
  border: 1px solid rgba(232, 240, 255, 0.18);
  backdrop-filter: blur(2px);
}

.hero-visual {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #081528;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(6, 15, 29, 0.52) 0%,
      rgba(6, 15, 29, 0.56) 45%,
      rgba(6, 15, 29, 0.72) 100%
    ),
    radial-gradient(
      circle at center,
      rgba(6, 15, 29, 0.08) 0%,
      rgba(6, 15, 29, 0.32) 80%,
      rgba(6, 15, 29, 0.56) 100%
    );
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
}

.hero .eyebrow {
  color: #d7e6ff;
}

.hero h1,
.hero h1 span,
.hero .lead {
  color: #f6f9ff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.46);
}

.hero h1 {
  max-width: none;
  font-size: clamp(2.8rem, 10vw, 6.3rem);
  line-height: 1.05;
}

.hero h1 span {
  margin-top: 1rem;
  max-width: 28ch;
  font-size: clamp(1.5rem, 3.7vw, 3.1rem);
  line-height: 1.2;
  font-weight: 700;
}

.hero .lead {
  max-width: 32ch;
  margin: 1.1rem auto 0;
  font-size: clamp(1.02rem, 2.15vw, 1.2rem);
  color: #ecf3ff;
}

.hero .status-badge {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(9, 19, 35, 0.7);
  color: #f6f9ff;
  backdrop-filter: blur(4px);
  margin: 0.55rem auto 1.25rem;
}

.hero .btn-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(9, 19, 35, 0.62);
  color: #f6f9ff;
}

.hero .btn-ghost {
  color: #dce9ff;
  background: rgba(109, 161, 255, 0.2);
  border-color: rgba(176, 206, 255, 0.34);
}

.hero-actions {
  justify-content: center;
}

.lead {
  margin: 1.1rem 0 1rem;
  max-width: 64ch;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 1.2rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.62rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

.btn-secondary {
  border-color: var(--border);
  background: var(--surface);
}

.btn-ghost {
  border-color: transparent;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.section-head {
  margin-bottom: 1.2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.panel p {
  margin: 0;
  color: var(--text-muted);
}

.panel p + p {
  margin-top: 0.8rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
}

.skill-card h3 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-list li {
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text-muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.project-media {
  margin: 0 0 0.85rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.project-media img {
  display: block;
  width: 100%;
  height: auto; /* maintain original aspect ratio */
  object-fit: contain; /* show whole image without cropping */
  object-position: center center;
}

.project-featured {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 9%, var(--surface)),
      var(--surface) 60%
    );
}

.project-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: space-between;
}

.project-head a {
  font-size: 0.85rem;
  color: var(--accent);
  text-underline-offset: 3px;
  font-weight: 700;
}

.project-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--accent);
}

.project-summary {
  margin: 0.75rem 0;
  color: var(--text-muted);
}

.project-meta {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.55rem;
  color: var(--text-muted);
}

.timeline {
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface);
}

.timeline-item h3 {
  margin-bottom: 0.2rem;
}

.timeline-item p {
  margin: 0;
  color: var(--text-muted);
}

.timeline-period {
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}

.timeline-item.highlight {
  border-left: 4px solid var(--accent);
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.education-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
}

.education-card p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.forward-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.5rem;
  color: var(--text-muted);
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.contact-cta {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  color: var(--text-muted);
}

.contact-list strong {
  color: var(--text);
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.contact-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.3rem 0 2.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 4vw;
    left: 4vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .main-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  .nav-links a {
    width: 100%;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .project-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    align-items: center;
    padding: clamp(5.2rem, 11vh, 6.4rem) 0 clamp(1.2rem, 4vh, 2rem);
  }

  .hero-visual img {
    object-position: 56% 32%;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 11vw, 4.1rem);
  }

  .hero h1 span {
    font-size: clamp(1.22rem, 6.3vw, 2rem);
    max-width: 24ch;
  }

  .hero .lead {
    max-width: 30ch;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .header-inner {
    min-height: 64px;
  }

  .brand span {
    display: none;
  }

  .theme-toggle-text {
    display: none;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    padding-top: 5.3rem;
  }

  .hero .lead {
    max-width: 22ch;
  }

  .panel,
  .project-card,
  .contact-card {
    padding: 0.9rem;
  }
}
