:root {
  --bg: #f2e8d6;
  --bg-soft: #f8f2e5;
  --paper: rgba(255, 249, 237, 0.8);
  --ink: #1d2a24;
  --muted: #5f6c62;
  --line: rgba(61, 76, 59, 0.18);
  --accent: #9e593d;
  --accent-strong: #71361f;
  --gold: #d3b16f;
  --green: #51694e;
  --green-soft: #dae6d1;
  --shadow: 0 20px 60px rgba(55, 42, 27, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 30%),
    radial-gradient(circle at bottom right, rgba(167, 194, 149, 0.28), transparent 25%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0.3) 2px,
      transparent 2px,
      transparent 44px
    ),
    linear-gradient(180deg, #f5ecde 0%, #efe2cc 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(80, 68, 49, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 68, 49, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
}

.page-glow {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: 8rem;
  left: -8rem;
  background: rgba(216, 166, 123, 0.38);
}

.page-glow-right {
  right: -8rem;
  bottom: 8rem;
  background: rgba(123, 163, 132, 0.3);
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 20px auto 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(72, 60, 42, 0.12);
  background: rgba(255, 249, 238, 0.72);
  box-shadow: var(--shadow);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(64, 76, 60, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(223, 208, 177, 0.6)),
    #fff;
  color: var(--accent-strong);
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 0.96rem;
  letter-spacing: 0.08em;
}

.brand-text small {
  color: var(--muted);
  letter-spacing: 0.12em;
}

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

.nav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: 0.25s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(81, 105, 78, 0.18);
}

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

.section {
  padding: 96px 0 24px;
}

.hero {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 36px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-strong);
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero h1,
.section-heading h2,
.profile-meta h2 {
  font-family: "Georgia", "Times New Roman", "STSong", "Songti SC", serif;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.95;
  margin: 0 0 22px;
}

.hero-lead,
.panel p,
.mini-card p,
.skill-card p,
.project-card p,
.timeline-content p,
.contact-copy {
  color: var(--muted);
  line-height: 1.9;
  font-size: 1.02rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}

.hero-tags span {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(95, 108, 98, 0.16);
  box-shadow: inset 0 -8px 18px rgba(193, 176, 145, 0.14);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff7ef;
  background: linear-gradient(135deg, #9b5b42, #6f3420);
  box-shadow: 0 16px 30px rgba(113, 54, 31, 0.26);
}

.button-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(81, 105, 78, 0.18);
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 254, 248, 0.86), rgba(246, 238, 223, 0.76)),
    var(--paper);
  border: 1px solid rgba(69, 80, 66, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-profile {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.panel-profile::after {
  content: "";
  position: absolute;
  inset: auto -30px -30px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 177, 111, 0.28), transparent 70%);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(82, 96, 78, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.profile-card {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
}

.avatar-ring {
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(217, 232, 208, 0.6));
  border: 1px solid rgba(81, 105, 78, 0.16);
  box-shadow: inset 0 0 0 8px rgba(255, 251, 240, 0.72);
}

.avatar-core {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #d3b16f, #8a5e31);
  color: white;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.meta-label {
  margin: 0 0 8px;
  color: var(--accent-strong);
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-meta h2 {
  margin: 0 0 10px;
  font-size: 2rem;
}

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

.stats-grid article,
.mini-card,
.skill-card,
.project-card,
.timeline-content {
  border: 1px solid rgba(73, 88, 70, 0.12);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.stats-grid article {
  padding: 18px;
  border-radius: var(--radius-md);
}

.stat-number {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 2rem;
  font-weight: 800;
}

.stats-grid span {
  color: var(--muted);
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
}

.section-split .section-heading {
  margin-bottom: 28px;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}

.dossier-card {
  padding: 22px;
}

.mini-cards {
  display: grid;
  gap: 18px;
}

.mini-card {
  padding: 22px;
  border-radius: var(--radius-md);
}

.mini-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(211, 177, 111, 0.32), rgba(255, 255, 255, 0.74));
  color: var(--accent-strong);
  font-weight: 800;
}

.mini-card h3,
.skill-card h3,
.project-card h3,
.timeline-content h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

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

.skill-card {
  padding: 22px;
  border-radius: var(--radius-md);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.skill-header span {
  color: var(--green);
  font-weight: 800;
}

.meter {
  width: 100%;
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(85, 101, 82, 0.12);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ca06d, #d1b16d);
}

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

.project-card {
  min-height: 280px;
  padding: 24px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(123, 163, 132, 0.18), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(244, 236, 223, 0.8));
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto -50px -50px auto;
  width: 140px;
  height: 140px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(18deg);
}

.project-tall {
  grid-row: span 2;
}

.project-badge {
  display: inline-flex;
  padding: 8px 12px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.project-card ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-card li {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(81, 105, 78, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

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

.timeline::before {
  content: "";
  position: absolute;
  left: 88px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, rgba(158, 89, 61, 0.2), rgba(81, 105, 78, 0.24));
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  align-items: start;
}

.timeline-year {
  padding-top: 10px;
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.timeline-content {
  position: relative;
  padding: 20px 22px;
  border-radius: var(--radius-md);
}

.timeline-content::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d3b16f, #7ca06d);
  box-shadow: 0 0 0 6px rgba(255, 250, 240, 0.82);
}

.guestbook-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}

.guestbook-intro,
.guestbook-panel {
  padding: 24px;
}

.guestbook-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(81, 105, 78, 0.12);
  color: var(--muted);
  line-height: 1.8;
}

.guestbook-form {
  display: grid;
  gap: 18px;
}

.guestbook-fields {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(81, 105, 78, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(113, 54, 31, 0.42);
  box-shadow: 0 0 0 4px rgba(211, 177, 111, 0.14);
}

.field textarea {
  resize: vertical;
  min-height: 132px;
}

.guestbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.guestbook-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 24px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.guestbook-list {
  display: grid;
  gap: 14px;
}

.guestbook-item,
.guestbook-empty {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(73, 88, 70, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.guestbook-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.guestbook-item__name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.guestbook-item__time {
  color: var(--muted);
  font-size: 0.88rem;
}

.guestbook-item__message,
.guestbook-empty {
  color: var(--muted);
  line-height: 1.85;
}

.section-contact {
  padding-bottom: 88px;
}

.contact-panel {
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.contact-list span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(81, 105, 78, 0.12);
  color: var(--muted);
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

@media (max-width: 960px) {
  .topbar {
    border-radius: 28px;
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .nav {
    justify-content: center;
  }

  .hero,
  .about-layout,
  .guestbook-layout,
  .contact-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-tall {
    grid-row: auto;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .section {
    padding-top: 74px;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .profile-card {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .timeline::before {
    left: 15px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: 34px;
  }

  .timeline-content::before {
    left: -26px;
  }

  .contact-list {
    flex-direction: column;
  }
}
