:root {
  --background: #d9e3d3;
  --accent: #38f9d7;
  --ink: #15201a;
  --muted: #536159;
  --surface: #eff5ec;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 50%;
  display: flex;
  width: max-content;
  max-width: calc(100% - 24px);
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px;
  border: 1px solid rgba(21, 32, 26, 0.16);
  border-radius: 0 0 18px 18px;
  background: rgba(239, 245, 236, 0.88);
  box-shadow: 0 10px 32px rgba(21, 32, 26, 0.08);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-brand {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2px;
}

.site-nav a {
  padding: 7px 20px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="location"] {
  background: var(--accent);
  color: var(--ink);
}

.site-brand:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .site-header {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 8px));
  }

  .site-header.is-visible,
  .site-header:focus-within {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%);
  }
}

.hero,
.about,
.projects,
.contact {
  scroll-margin-top: 64px;
}

.hero {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 100svh;
  place-items: center;
  padding: 48px clamp(24px, 7vw, 112px);
  isolation: isolate;
}

.hero__content {
  width: min(100%, 1120px);
}

.hero__eyebrow {
  display: inline-block;
  margin: 0 0 32px;
  padding: 10px 16px;
  border: 1px solid rgba(21, 32, 26, 0.22);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.08;
}

h1 span {
  position: relative;
  z-index: 0;
}

h1 span::after {
  position: absolute;
  z-index: -1;
  right: -0.03em;
  bottom: 0.04em;
  left: -0.02em;
  height: 0.24em;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.hero__intro {
  max-width: 600px;
  margin: 36px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  min-height: 52px;
  margin-top: 40px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--ink);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.hero__cta:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.hero__cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}

.hero__mark {
  position: absolute;
  z-index: -1;
  right: -4vw;
  bottom: -5vw;
  display: grid;
  width: clamp(220px, 32vw, 500px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(21, 32, 26, 0.12);
  border-radius: 50%;
  color: rgba(21, 32, 26, 0.08);
  font-size: clamp(5rem, 16vw, 15rem);
  font-weight: 900;
  letter-spacing: -0.1em;
}

.about {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(48px, 8vw, 120px);
  padding: clamp(88px, 12vw, 160px) clamp(24px, 7vw, 112px);
  background: var(--surface);
}

.section-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.about h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.about__lead {
  max-width: 720px;
  margin: 0;
  font-size: clamp(1.65rem, 3.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.35;
}

.about__body {
  max-width: 680px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.9;
}

.about__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.about__roles li {
  padding: 10px 16px;
  border: 1px solid rgba(21, 32, 26, 0.2);
  border-radius: 999px;
  background: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
}

.projects {
  padding: clamp(88px, 12vw, 160px) clamp(24px, 7vw, 112px);
  background: var(--background);
}

.projects__heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px clamp(40px, 8vw, 120px);
  align-items: end;
}

.projects__heading .section-label {
  grid-column: 1 / -1;
}

.projects__heading h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.projects__heading > p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.8;
}

.projects__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: clamp(48px, 7vw, 88px) 0 0;
  padding: 0;
  list-style: none;
}

.project-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(21, 32, 26, 0.16);
  border-radius: 24px;
  background: var(--surface);
}

.project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.project-card__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-card__status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 249, 215, 0.22);
  content: "";
}

.project-card h3 {
  margin: auto 0 20px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.project-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: clamp(56px, 8vw, 120px);
  padding: clamp(88px, 12vw, 160px) clamp(24px, 7vw, 112px);
  background: var(--surface);
  color: var(--ink);
}

.contact .section-label {
  color: var(--muted);
}

.contact h2 {
  margin: 0;
  font-size: clamp(2.75rem, 6vw, 6rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.contact__methods {
  display: grid;
  gap: 16px;
  align-content: end;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 132px;
  padding: 24px;
  border: 1px solid rgba(21, 32, 26, 0.16);
  border-radius: 20px;
  background: var(--background);
  color: var(--ink);
  text-decoration: none;
}

.contact-card > span:first-child {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.contact-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

a.contact-card {
  transition: border-color 160ms ease, background 160ms ease;
}

a.contact-card:hover {
  border-color: var(--ink);
  background: var(--accent);
}

a.contact-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.error-page {
  min-height: 100svh;
}

.not-found {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 100svh;
  place-items: center;
  padding: 48px clamp(24px, 7vw, 112px);
  isolation: isolate;
}

.not-found__content {
  width: min(100%, 1120px);
}

.not-found__code {
  display: inline-block;
  margin: 0 0 32px;
  padding: 10px 16px;
  border: 1px solid rgba(21, 32, 26, 0.22);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.not-found h1 {
  max-width: 900px;
  margin: 0;
}

.not-found__content > p:not(.not-found__code) {
  max-width: 620px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.8;
}

.not-found__link {
  display: inline-flex;
  align-items: center;
  gap: 64px;
  margin-top: 48px;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.not-found__link:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.not-found__link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}

.not-found__mark {
  position: absolute;
  z-index: -1;
  right: -4vw;
  bottom: -5vw;
  display: grid;
  width: clamp(220px, 32vw, 500px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(21, 32, 26, 0.12);
  border-radius: 50%;
  color: rgba(21, 32, 26, 0.08);
  font-size: clamp(5rem, 16vw, 15rem);
  font-weight: 900;
  letter-spacing: -0.1em;
}

@media (max-width: 900px) {
  .projects__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects__list .project-card:last-child {
    grid-column: 1 / -1;
  }

  .project-card {
    min-height: 300px;
  }

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

@media (max-width: 640px) {
  .site-header {
    padding: 3px;
    border-color: rgba(239, 245, 236, 0.24);
    background: var(--ink);
    box-shadow: 0 10px 32px rgba(21, 32, 26, 0.18);
  }

  .site-brand {
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: var(--ink);
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding: 7px 10px;
    color: var(--surface);
    font-size: 0.75rem;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="location"] {
    background: var(--surface);
    color: var(--ink);
  }

  .site-brand:focus-visible,
  .site-nav a:focus-visible {
    outline-color: var(--surface);
  }

  .hero {
    align-items: center;
    padding-top: 64px;
    padding-bottom: 32px;
  }

  .hero__eyebrow {
    margin-bottom: 24px;
    font-size: 0.68rem;
  }

  h1 {
    font-size: clamp(1.75rem, 10vw, 3rem);
  }

  h1 span {
    white-space: nowrap;
  }

  .hero__intro {
    margin-top: 28px;
  }

  .not-found {
    align-items: center;
    padding-top: 64px;
    padding-bottom: 32px;
  }

  .not-found h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }

  .not-found__content > p:not(.not-found__code) {
    margin-top: 28px;
  }

  .not-found__link {
    width: 100%;
    justify-content: space-between;
  }

  .hero__cta {
    width: 100%;
    justify-content: space-between;
    background: var(--ink);
    color: var(--surface);
    box-shadow: 5px 5px 0 var(--accent);
  }

  .about {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .about,
  .projects,
  .contact {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .about__body {
    margin-top: 24px;
  }

  .about__roles {
    margin-top: 28px;
  }

  .projects__heading,
  .projects__list {
    grid-template-columns: 1fr;
  }

  .projects__heading {
    gap: 24px;
  }

  .projects__list {
    margin-top: 48px;
  }

  .projects__list .project-card:last-child {
    grid-column: auto;
  }

  .project-card {
    min-height: 280px;
  }

  .contact-card {
    min-height: 120px;
  }
}

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

  .hero__cta,
  .not-found__link,
  a.contact-card,
  .site-nav a,
  .site-header {
    transition: none;
  }
}
