* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --ink: #111827;
  --muted: #536171;
  --line: #d7dde6;
  --panel: #ffffff;
  --panel-dark: #0f172a;
  --blue: #2563eb;
  --green: #0f766e;
  --amber: #b45309;
  --max: 1180px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 36px);
  background: rgba(244, 247, 251, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.brand {
  font-weight: 800;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.download-link,
.btn,
.contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
}

.download-link,
.btn.primary {
  background: var(--ink);
  color: #fff;
}

main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 75px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.62fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: 56px 0 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 20px;
  font-size: clamp(3.4rem, 8vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.role {
  max-width: 760px;
  color: var(--green);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
}

.intro,
.job-panel p,
.panel p,
.education-list,
.job-panel li {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: #fff;
}

.portrait-stage {
  position: relative;
  width: min(100%, 360px);
  justify-self: end;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #dbe3ee;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  perspective: 1200px;
}

.portrait-frame img,
.portrait-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 50%;
  animation: portraitOrbit 10s ease-in-out infinite alternate;
}

.portrait-frame video {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.portrait-frame.video-ready video {
  opacity: 1;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.profile-tags span {
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.1);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.14);
}

.summary-band,
.experience-shell,
.panel,
.contact-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 92px;
}

.summary-band article {
  min-height: 130px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.summary-band article:last-child {
  border-right: 0;
}

.summary-band strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.7rem;
}

.summary-band span {
  color: var(--muted);
  line-height: 1.5;
}

.section {
  padding: 0 0 92px;
}

.section-heading {
  max-width: 850px;
  margin-bottom: 28px;
}

.experience-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 540px;
  overflow: hidden;
}

.career-timeline {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.timeline-segment {
  flex: var(--span) 1 0;
  min-width: 68px;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 112px;
  padding: 12px 10px;
  border: 0;
  border-radius: 8px;
  background: #eef4ff;
  color: #475569;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.timeline-segment::after {
  content: "";
  position: absolute;
  inset: auto 10px 35px 10px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
}

.segment-logo {
  display: inline-flex;
  width: 52px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.segment-logo img {
  display: block;
  max-width: 86%;
  max-height: 78%;
  object-fit: contain;
}

.symbol-logo img {
  max-width: 74%;
  max-height: 74%;
}

.timeline-segment strong {
  font-size: 0.88rem;
  line-height: 1.12;
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-segment small {
  color: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  opacity: 0.72;
  white-space: nowrap;
}

.timeline-segment.active,
.timeline-segment:hover {
  background: #dbeafe;
  color: var(--blue);
  transform: translateY(-2px);
}

.timeline-segment.active .segment-logo,
.timeline-segment:hover .segment-logo {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

.tablist {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px;
  background: #e9eef6;
  border-right: 1px solid var(--line);
}

.tab {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab.active,
.tab:hover {
  background: #fff;
  color: var(--blue);
}

.job-panel {
  display: none;
  padding: clamp(24px, 5vw, 54px);
}

.job-panel.active {
  display: block;
}

.period {
  color: var(--amber);
  font-weight: 800;
}

.job-panel ul {
  margin: 22px 0 0;
  padding-left: 20px;
}

.chips,
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chips {
  margin-top: 28px;
}

.chips span,
.skill-grid span {
  padding: 8px 11px;
  border-radius: 8px;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 0.9rem;
  font-weight: 800;
}

.two-col,
.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  padding: clamp(22px, 4vw, 36px);
}

.education-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.education-list li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 54px;
}

.education-list span:not(.education-icon) {
  display: block;
  color: var(--green);
  font-weight: 800;
}

.education-icon {
  display: inline-flex;
  width: 58px;
  height: 50px;
  padding: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  color: #1e3a8a;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.education-icon img {
  display: block;
  max-width: 94%;
  max-height: 82%;
  object-fit: contain;
}

.compact-logo img {
  max-width: 72%;
  max-height: 72%;
}

.image-mark {
  background: #fff;
}

.contact-section {
  margin-bottom: 64px;
  padding: clamp(28px, 5vw, 50px);
  background: var(--panel-dark);
  color: #fff;
}

.contact-section .eyebrow {
  color: #93c5fd;
}

.contact-section h2 {
  margin-bottom: 28px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-actions a {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

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

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

@keyframes portraitOrbit {
  0% {
    transform: translate3d(-4%, -3%, 0) rotateY(-4deg) scale(1.02);
  }

  100% {
    transform: translate3d(-8%, -6%, 0) rotateY(5deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .portrait-frame img,
  .reveal {
    animation: none;
    transition: none;
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .hero,
  .two-col,
  .compact-grid,
  .experience-shell {
    grid-template-columns: 1fr;
  }

  .portrait-stage {
    justify-self: start;
    width: min(100%, 320px);
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: none;
  }

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

  .summary-band article:nth-child(2) {
    border-right: 0;
  }

  .tablist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .timeline-segment {
    flex-basis: max(calc(var(--span) * 9px), 106px);
  }
}

@media (max-width: 620px) {
  main {
    width: min(var(--max), calc(100% - 24px));
  }

  .topbar {
    padding: 12px;
  }

  .download-link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 34px;
  }

  .summary-band,
  .tablist {
    grid-template-columns: 1fr;
  }

  .summary-band article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-band article:last-child {
    border-bottom: 0;
  }

  .profile-tags span {
    width: 100%;
  }
}
