/* ==========================================================================
   Design tokens and document reset
   ========================================================================== */

:root {
  color-scheme: light;
  --color-navy: #2563eb;
  --color-navy-deep: #111827;
  --color-accent: #2563eb;
  --color-accent-dark: #1d4ed8;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-muted: #9ca3af;
  --color-surface: rgba(255, 255, 255, 0.88);
  --color-surface-solid: #ffffff;
  --color-background: #fafafa;
  --color-border: rgba(17, 24, 39, 0.08);
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 20px 42px rgba(17, 24, 39, 0.1);
  --shadow-button: 0 12px 28px rgba(37, 99, 235, 0.24);
  --radius-card: 16px;
  --radius-control: 12px;
  --layout-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.resume-page {
  margin: 0;
  background:
    radial-gradient(circle at 6% 8%, rgba(37, 99, 235, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(16, 185, 129, 0.06), transparent 26rem),
    linear-gradient(145deg, #ffffff 0%, #fafafa 56%, #f8fafc 100%);
  color: var(--color-text);
  font-family:
    Inter, "SF Pro Display", "PingFang SC", "Noto Sans CJK SC",
    "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.resume-page a {
  color: inherit;
  text-decoration: none;
}

.resume-page svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.layout-container {
  width: min(calc(100% - 48px), var(--layout-width));
  margin-inline: auto;
}

/* ==========================================================================
   Fixed navigation
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: all 0.3s ease;
}

.site-header--scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
}

.site-header__nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  width: min(calc(100% - 48px), var(--layout-width));
  min-height: 72px;
  margin-inline: auto;
}

.site-header__brand {
  color: var(--color-navy-deep);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-header__brand::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  content: "";
  vertical-align: 3px;
}

.site-header__links {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.site-header__link {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 560;
  transition: all 0.3s ease;
}

.site-header__link:hover {
  color: var(--color-navy);
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.site-header__home,
.site-header__download {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 650;
  transition: all 0.3s ease;
}

.resume-page .site-header__home {
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: #ffffff;
}

.site-header__home:hover {
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.site-header__download:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.site-header__home svg,
.site-header__download svg {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   Hero section
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding: 130px 0 88px;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
}

.hero__glow--left {
  top: 18%;
  left: -180px;
  width: 420px;
  height: 420px;
  background: rgba(37, 99, 235, 0.1);
}

.hero__glow--right {
  right: -120px;
  bottom: 2%;
  width: 360px;
  height: 360px;
  background: rgba(16, 185, 129, 0.08);
}

.hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(56px, 8vw, 108px);
  align-items: center;
}

.hero__content {
  max-width: 680px;
}

.hero__eyebrow,
.section-heading__eyebrow,
.contact-card__eyebrow {
  margin: 0 0 18px;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__name {
  margin: 0 0 20px;
  color: var(--color-navy-deep);
  font-size: clamp(52px, 7vw, 72px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero__title {
  width: fit-content;
  margin: 0 0 24px;
  background: linear-gradient(90deg, var(--color-navy), var(--color-accent-dark));
  background-clip: text;
  color: transparent;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__summary {
  max-width: 630px;
  margin: 0 0 34px;
  color: var(--color-text-secondary);
  font-size: 17px;
  line-height: 1.85;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  font-size: 15px;
  font-weight: 650;
  transition: all 0.3s ease;
}

.resume-page .button--primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #ffffff;
  box-shadow: var(--shadow-button);
}

.button--primary:hover {
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.3);
  transform: translateY(-3px);
}

.button--secondary {
  border: 1px solid rgba(17, 24, 39, 0.16);
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-navy);
}

.button--secondary:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.profile-card {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 24px 70px rgba(17, 24, 39, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.profile-card__top {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}

.profile-card__avatar {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-navy-deep), var(--color-navy));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
}

.profile-card__avatar svg {
  width: 30px;
  height: 30px;
}

.profile-card__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.profile-card__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.profile-card__name {
  margin: 4px 0 0;
  color: var(--color-navy-deep);
  font-size: 26px;
  line-height: 1.2;
}

.profile-card__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 24px;
}

.profile-card__detail dt {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--color-muted);
  font-size: 12px;
}

.profile-card__detail dt svg {
  width: 15px;
  height: 15px;
  color: var(--color-accent-dark);
}

.profile-card__detail dd {
  margin: 0;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.profile-card__detail a:hover {
  color: var(--color-accent-dark);
}

.profile-card__work {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-control);
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-navy);
  font-weight: 680;
  transition: all 0.3s ease;
}

.profile-card__work small {
  display: block;
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 560;
}

.profile-card__work:hover {
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

/* ==========================================================================
   Shared section heading and card grid
   ========================================================================== */

.content-section {
  padding: 112px 0;
  scroll-margin-top: 92px;
}

.content-section--tinted {
  background: rgba(255, 255, 255, 0.34);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1.3fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
}

.section-heading__eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -30px;
  color: var(--color-accent-dark);
}

.section-heading__title {
  margin: 0;
  color: var(--color-navy-deep);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.section-heading__description {
  max-width: 600px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.card-grid {
  display: grid;
  gap: 20px;
}

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

.info-card {
  position: relative;
  min-height: 230px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.info-card--accent {
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.16), transparent 62%),
    rgba(255, 255, 255, 0.9);
}

.info-card__icon,
.project-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: var(--radius-control);
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-accent-dark);
}

.info-card__title {
  margin: 0 0 10px;
  color: var(--color-navy-deep);
  font-size: 20px;
  line-height: 1.25;
}

.info-card__text {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.info-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--color-accent-dark);
  font-size: 13px;
  font-weight: 680;
}

.info-card__link svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Project Bento grid
   ========================================================================== */

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

.project-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-solid);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.project-card--nova {
  grid-column: span 7;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.1), transparent 42%),
    var(--color-surface-solid);
}

.project-card--service {
  grid-column: span 5;
}

.project-card--vcc {
  grid-column: span 6;
}

.project-card--compact {
  grid-column: span 3;
}

.project-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.project-card__icon {
  margin-bottom: 28px;
}

.project-card__number {
  color: rgba(17, 24, 39, 0.25);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.project-card__type {
  margin: 0 0 8px;
  color: var(--color-accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.project-card__title {
  margin: 0 0 14px;
  color: var(--color-navy-deep);
  font-size: 27px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.project-card__description {
  margin: 0 0 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.project-card__list {
  margin: 0 0 24px;
  padding-left: 19px;
  color: var(--color-text-secondary);
}

.project-card__list li {
  padding-left: 4px;
  font-size: 13px;
  line-height: 1.75;
}

.project-card__list li + li {
  margin-top: 8px;
}

.project-card__list li::marker {
  color: var(--color-accent-dark);
}

.project-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.project-card__metrics li {
  padding: 14px;
  border-radius: var(--radius-control);
  background: var(--color-background);
}

.project-card__metrics strong,
.project-card__metrics span {
  display: block;
}

.project-card__metrics strong {
  color: var(--color-navy);
  font-size: 20px;
}

.project-card__metrics span {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 11px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.tag-list__item {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 620;
}

/* ==========================================================================
   Experience cards
   ========================================================================== */

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

.experience-card {
  min-height: 280px;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.experience-card:hover {
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.experience-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.experience-card__time {
  color: var(--color-accent-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.experience-card__role {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 650;
}

.experience-card__company {
  margin: 0 0 18px;
  color: var(--color-navy-deep);
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.experience-card__list {
  margin: 0;
  padding-left: 19px;
  color: var(--color-text-secondary);
}

.experience-card__list li {
  padding-left: 4px;
  font-size: 14px;
  line-height: 1.8;
}

.experience-card__list li + li {
  margin-top: 8px;
}

.experience-card__list li::marker {
  color: var(--color-accent-dark);
}

/* ==========================================================================
   Contact and footer
   ========================================================================== */

.contact-section {
  padding: 20px 0 112px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(30px, 5vw, 52px);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 90% 20%, rgba(96, 165, 250, 0.24), transparent 28%),
    linear-gradient(135deg, var(--color-navy-deep), var(--color-navy));
  color: #ffffff;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
}

.contact-card__eyebrow {
  color: #bfdbfe;
}

.contact-card__title {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.contact-card__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.button--light {
  flex: 0 0 auto;
  background: linear-gradient(135deg, #93c5fd, #ffffff);
  color: var(--color-navy-deep);
}

.site-footer {
  padding: 30px 0;
  background: rgba(255, 255, 255, 0.48);
}

.site-footer__layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer__name {
  margin: 0;
  color: var(--color-navy);
  font-weight: 680;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.site-footer__links a {
  transition: all 0.3s ease;
}

.site-footer__links a:hover {
  color: var(--color-accent-dark);
}

/* ==========================================================================
   Responsive layouts
   ========================================================================== */

@media (max-width: 1024px) {
  .hero__layout {
    grid-template-columns: 1fr;
  }

  .hero__content {
    max-width: 760px;
  }

  .profile-card {
    max-width: 760px;
  }

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

  .project-card--nova,
  .project-card--service,
  .project-card--vcc,
  .project-card--compact {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .layout-container,
  .site-header__nav {
    width: min(calc(100% - 32px), var(--layout-width));
  }

  .site-header__nav {
    grid-template-columns: auto 1fr;
  }

  .site-header__links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .site-header__actions {
    justify-self: end;
  }

  .hero {
    padding-top: 154px;
  }

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

  .section-heading {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-heading__eyebrow {
    grid-column: auto;
    margin-bottom: 0;
  }

  .content-section {
    padding: 88px 0;
  }
}

@media (max-width: 600px) {
  .site-header__links {
    gap: 22px;
  }

  .site-header__home span,
  .site-header__download span {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-bottom: 72px;
  }

  .hero__name {
    font-size: 54px;
  }

  .hero__title {
    font-size: 22px;
  }

  .hero__summary {
    font-size: 15px;
  }

  .profile-card {
    padding: 22px;
  }

  .profile-card__details,
  .card-grid--skills,
  .project-grid,
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .info-card,
  .project-card,
  .experience-card {
    min-height: auto;
    padding: 22px;
  }

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

  .contact-card,
  .site-footer__layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .button--light {
    width: 100%;
  }
}

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

  .site-header,
  .site-header__link,
  .site-header__home,
  .site-header__download,
  .button,
  .info-card,
  .project-card,
  .experience-card,
  .profile-card__work,
  .site-footer__links a {
    transition: none;
  }
}

/* ==========================================================================
   Print layout
   ========================================================================== */

@media print {
  .resume-page {
    background: #ffffff;
  }

  .site-header,
  .hero__glow,
  .hero__actions,
  .contact-section,
  .site-footer {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 30px 0;
  }

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

  .content-section {
    padding: 36px 0;
  }

  .info-card,
  .project-card,
  .experience-card,
  .profile-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .project-card--nova,
  .project-card--service,
  .project-card--vcc,
  .project-card--compact {
    grid-column: span 1;
  }
}
