:root {
  --bg: #0b0f14;
  --bg-soft: #111823;
  --panel: #151e2b;
  --line: #233043;
  --text: #e8eef8;
  --muted: #99a8bf;
  --accent: #6db3ff;
  --accent-2: #8ed0ff;
  --radius: 16px;
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  --container: min(1120px, 92vw);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #090d12 0%, #0d1219 100%);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 0.8rem;
}

.brand {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #08111d;
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.hero {
  padding: 4rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.5rem;
}

.eyebrow {
  color: var(--accent-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.78rem;
  margin: 0 0 0.8rem;
}

h1,
h2,
h3 {
  font-family: "Manrope", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.08;
  margin-bottom: 0.85rem;
}

.lead {
  max-width: 65ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.02rem;
}

.cta-row {
  margin-top: 1.3rem;
  display: flex;
  gap: 0.7rem;
}

.profile-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, #111923 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.profile-card div {
  padding: 1rem;
}

.profile-card h2 {
  font-size: 1.1rem;
}

.profile-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.section {
  padding: 1.1rem 0 2rem;
}

.section h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  margin-bottom: 0.8rem;
}

.section p {
  color: var(--muted);
  line-height: 1.65;
}

.cards-3,
.cards-2 {
  display: grid;
  gap: 0.9rem;
}

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

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

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.card h3 {
  margin-bottom: 0.45rem;
}

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

.content-panel.is-hidden {
  display: none;
}

.split-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.split-card h3 {
  margin-bottom: 0.45rem;
}

.split-card:hover {
  border-color: #40638b;
  transform: translateY(-1px);
}

.split-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(109, 179, 255, 0.45), 0 14px 26px rgba(7, 14, 26, 0.45);
}

.badge-list {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: #cfe2fb;
  background: rgba(255, 255, 255, 0.02);
}

.section-subtitle {
  font-size: 1.02rem;
  color: #cddcf3;
  margin-bottom: 0.65rem;
}

.experience-track {
  margin-bottom: 0.9rem;
}

.track-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.track-line {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2c3f56 0%, var(--accent) 50%, var(--accent-2) 100%);
  position: relative;
}

.track-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #d7ecff;
  box-shadow: 0 0 0 4px rgba(109, 179, 255, 0.2);
}

.track-dot.start {
  left: -1px;
}

.track-dot.end {
  right: -1px;
}

.experience-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem 1rem;
}

.experience-footnote {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.muted {
  color: var(--muted);
}

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

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1rem;
  overflow: hidden;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
}

.project-head a {
  font-size: 0.86rem;
  color: var(--accent-2);
}

.preview-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.65rem;
}

.preview-variant {
  min-width: 0;
}

.preview-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c4d8f6;
  letter-spacing: 0.02em;
}

.preview-shell {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-height: 290px;
  width: 100%;
  background: #0a111a;
  position: relative;
}

.preview-shell iframe {
  width: 1366px;
  height: 768px;
  border: 0;
  display: block;
  transform-origin: top left;
  pointer-events: auto;
  user-select: auto;
  touch-action: auto;
}

.preview-fallback {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem;
}

.preview-fallback p {
  margin: 0;
  color: var(--muted);
}

.contact {
  padding-bottom: 2.4rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-links a {
  padding: 0.62rem 0.92rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.contact-links a:hover {
  border-color: #335172;
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0 2rem;
}

.footer p {
  color: #7f8ea5;
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

.footer a {
  color: #b7d8ff;
}

.footer a:hover {
  color: #d8eaff;
  text-decoration: underline;
}

@media (max-width: 1200px) {
  :root {
    --container: min(1080px, 94vw);
  }

  .hero {
    padding-top: 3.2rem;
  }

  .preview-shell {
    min-height: 260px;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .cards-3,
  .cards-2,
  .split-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .timeline-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-card img {
    height: 280px;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    padding: 0.7rem 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  h1 {
    font-size: clamp(1.65rem, 8.2vw, 2.35rem);
  }

  .lead {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .cta-row {
    flex-wrap: wrap;
  }

  .cta-row .btn {
    flex: 1 1 190px;
    text-align: center;
  }

  .section {
    padding: 0.95rem 0 1.5rem;
  }

  .split-card,
  .project-card,
  .card,
  .experience-card {
    padding: 0.9rem;
  }

  .badge-list span {
    font-size: 0.8rem;
  }

  .preview-shell {
    min-height: 220px;
    max-width: calc(100vw - 32px);
    margin-inline: auto;
  }

  .contact-links {
    gap: 0.7rem;
  }

  .contact-links a {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
  }

  .profile-card img {
    height: 240px;
  }

  .track-meta {
    font-size: 0.82rem;
  }

  .project-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-head a {
    font-size: 0.82rem;
  }

  .preview-shell,
  .preview-fallback {
    min-height: 130px;
    max-height: 300px;
    max-width: calc(100vw - 32px);
    margin-inline: auto;
  }

  .preview-pair {
    grid-template-columns: 1fr;
  }
}
