:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #dfd6c8;
  --primary: #136f63;
  --primary-dark: #0d4f47;
  --accent: #c65f2e;
  --shadow: 0 18px 48px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(223, 214, 200, 0.8);
  background: rgba(247, 244, 238, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 1rem;
  font-weight: 800;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a:hover {
  color: var(--primary);
}

.hero,
.section,
.footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding: 72px 0;
}

.hero__content {
  max-width: 760px;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero__title {
  font-size: clamp(2rem, 4.6vw, 4.2rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.hero__summary,
.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
}

.hero__summary {
  margin: 24px 0 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.button--primary:hover {
  background: var(--primary-dark);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.44);
}

.button--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.profile-panel {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.avatar-frame {
  width: 148px;
  height: 148px;
  margin-bottom: 28px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: 0 10px 26px rgba(31, 41, 51, 0.18);
  flex: 0 0 148px;
}

.avatar {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.facts {
  display: grid;
  gap: 18px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.facts dd {
  margin: 0;
  font-weight: 800;
}

.section {
  padding: 78px 0;
}

.section--tinted {
  width: 100%;
  max-width: none;
  padding: 78px max(20px, calc((100% - 1120px) / 2));
  border-block: 1px solid var(--line);
  background: #edf7f4;
}

.section__heading {
  margin-bottom: 24px;
}

.section__intro {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.skill-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 8px 12px;
  color: var(--primary-dark);
  font-weight: 800;
}

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

.project-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  border: 1px solid #cfe1dc;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 24px;
}

.project-card p {
  color: var(--muted);
}

.project-card__tag {
  margin: 0 0 18px;
  color: var(--accent) !important;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card a {
  margin-top: auto;
  color: var(--primary);
  font-weight: 900;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reading-section {
  border-top: 1px solid var(--line);
}

.reading-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid #cfe1dc;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 24px;
}

.reading-card__tag {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reading-card__meta {
  margin: 12px 0 0;
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.reading-card__summary {
  margin: 16px 0 0;
  color: var(--muted);
}

.reading-card__link {
  width: fit-content;
  color: var(--primary);
  font-weight: 900;
}

.reading-card__link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.timeline {
  display: grid;
  gap: 20px;
}

.timeline article {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.timeline time {
  color: var(--accent);
  font-weight: 900;
}

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

.contact-section,
.friend-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  border-top: 1px solid var(--line);
}

.contact-section p {
  max-width: 640px;
  color: var(--muted);
}

.contact-links,
.friend-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.contact-links a,
.friend-links a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  padding: 10px 14px;
  font-weight: 800;
}

.contact-links a:hover,
.friend-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.footer {
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

.beian-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 10px;
  color: #7a8491;
  font-size: 0.82rem;
}

.beian-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.beian-links a:hover {
  color: var(--primary);
}

.beian-links img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 54px 0;
  }

  .profile-panel {
    width: 100%;
  }

  .project-grid,
  .reading-grid,
  .contact-section,
  .friend-section {
    grid-template-columns: 1fr;
  }

  .contact-links,
  .friend-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .hero,
  .section,
  .footer {
    width: min(100% - 28px, 1120px);
  }

  h1 {
    font-size: 2.4rem;
  }

  .hero__title {
    font-size: 2.05rem;
  }

  .facts div,
  .timeline article {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .button {
    width: 100%;
  }
}
