:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #77838f;
  --line: #dfe5e9;
  --blue: #5f86a8;
  --blue-soft: #dce8f0;
  --shadow: 0 12px 34px rgba(27, 44, 58, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, rgba(197, 218, 232, 0.32), transparent 22rem),
    var(--bg);
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: #fff;
  background: var(--blue);
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 14px;
}

.section {
  scroll-margin-top: 24px;
}

.intro {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  min-height: 146px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.portrait-wrap {
  position: relative;
  width: 118px;
  height: 118px;
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  border: 5px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 26%;
  box-shadow: var(--shadow);
}

.status-dot {
  position: absolute;
  right: 4px;
  bottom: 10px;
  width: 17px;
  height: 17px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--blue);
}

.intro-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

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

h1 {
  margin-bottom: 3px;
  font-size: clamp(2rem, 4vw, 3.45rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.dot {
  color: var(--blue);
}

.tagline {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: clamp(0.84rem, 1.4vw, 1rem);
}

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.profile-facts li {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #667582;
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.67rem;
  line-height: 1;
}

.intro-actions,
.quick-nav {
  display: flex;
  align-items: center;
}

.intro-actions {
  justify-content: space-between;
  gap: 18px;
}

.quick-nav {
  gap: 5px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 180ms ease, background 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
  background: var(--surface);
}

.icon-button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.icon-button::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 5px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  content: attr(data-tooltip);
  font-size: 0.67rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  transform: translateY(-2px);
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.projects {
  padding-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.count,
.skills-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(7px, 0.9vw, 12px);
}

.project-card {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 0.9;
  max-height: 156px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #dce4e9;
  cursor: default;
  box-shadow: 0 4px 15px rgba(35, 52, 66, 0.04);
  transition: box-shadow 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card::before {
  position: absolute;
  z-index: -2;
  inset: -4px;
  background-image: url("assets/project-covers.png");
  background-position: var(--x) var(--y);
  background-size: 400% 300%;
  content: "";
  filter: blur(1.5px) saturate(0.78);
  transform: scale(1.04);
  transition: filter 260ms ease, transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(19, 30, 40, 0.02) 35%, rgba(19, 30, 40, 0.58) 100%);
  content: "";
  opacity: 0.78;
  transition: opacity 240ms ease;
}

.project-index,
.project-label {
  position: absolute;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

.project-index {
  top: 11px;
  left: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  opacity: 0.88;
}

.project-label {
  right: 12px;
  bottom: 11px;
  left: 12px;
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  font-weight: 500;
}

.project-card:hover {
  z-index: 2;
  box-shadow: 0 16px 30px rgba(38, 57, 72, 0.18);
  transform: translateY(-5px);
}

.project-card:hover::before {
  filter: blur(0) saturate(0.95);
  transform: scale(1.08);
}

.project-card:hover::after {
  opacity: 0.9;
}

.skills {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(214, 222, 227, 0.86);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
}

.skills-heading {
  align-items: start;
  margin-bottom: 0;
}

.skills-hint {
  display: none;
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  width: min(100%, 420px);
  margin-left: auto;
}

.skill {
  position: relative;
  display: grid;
  min-width: 0;
  height: 48px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #71808c;
  cursor: default;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.skill::after {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 5px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  content: attr(data-label);
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.skill:hover,
.skill:focus-visible {
  color: var(--blue);
  border-color: var(--blue-soft);
  outline: none;
  background: #fff;
  transform: translateY(-2px);
}

.skill:hover::after,
.skill:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skill-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.code-mark,
.letter-mark {
  display: grid;
  width: auto;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  color: #9099a1;
  font-size: 0.62rem;
}

.footer p {
  margin-bottom: 0;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 32px, 760px);
    padding-top: 20px;
  }

  .intro {
    grid-template-columns: 108px 1fr;
    min-height: 126px;
    padding-bottom: 16px;
  }

  .portrait-wrap {
    width: 96px;
    height: 96px;
  }

  .projects {
    padding-top: 14px;
  }

  .project-grid {
    gap: 7px;
  }

  .project-card {
    max-height: 112px;
    border-radius: 13px;
  }

  .project-index {
    top: 8px;
    left: 9px;
  }

  .project-label {
    right: 9px;
    bottom: 8px;
    left: 9px;
  }

  .skills {
    margin-top: 14px;
    padding: 10px 12px;
  }

  .skill {
    height: 42px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 28px, 480px);
    padding-top: 16px;
  }

  .intro {
    grid-template-columns: 82px 1fr;
    gap: 18px;
  }

  .portrait-wrap {
    width: 80px;
    height: 80px;
  }

  .status-dot {
    right: 1px;
    bottom: 5px;
    width: 14px;
    height: 14px;
    border-width: 3px;
  }

  h1 {
    font-size: clamp(1.65rem, 9vw, 2.3rem);
  }

  .tagline {
    margin-bottom: 8px;
  }

  .profile-facts {
    gap: 4px;
    margin-bottom: 9px;
  }

  .profile-facts li {
    padding: 3px 6px;
    font-size: 0.61rem;
  }

  .intro-actions {
    gap: 8px;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .icon-button {
    width: 32px;
    height: 32px;
  }

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

  .project-card {
    aspect-ratio: 1 / 0.88;
    max-height: none;
  }

  .skills {
    display: block;
    padding: 13px 12px 11px;
  }

  .skills-heading {
    align-items: end;
    margin-bottom: 8px;
  }

  .skills-hint {
    display: block;
  }

  .skill-list {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .skill::after {
    bottom: auto;
    top: calc(100% + 5px);
  }
}

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

  .portrait-wrap {
    width: 72px;
    height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
