:root {
  --bg: #f6efe5;
  --bg-soft: #fff8f0;
  --surface: rgba(255, 250, 242, 0.84);
  --surface-strong: #fffaf2;
  --ink: #1f2a2d;
  --muted: #5d6764;
  --line: rgba(31, 42, 45, 0.12);
  --accent: #bc5f3b;
  --accent-deep: #8d3f25;
  --accent-soft: #f0d6c7;
  --secondary: #2f6c67;
  --shadow: 0 20px 50px rgba(58, 47, 37, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --container: min(1180px, calc(100vw - 2rem));
  --font-display: "STSong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-mono: "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(188, 95, 59, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(47, 108, 103, 0.18), transparent 28%),
    linear-gradient(180deg, #f9f2e8 0%, var(--bg) 44%, #efe2d3 100%);
  font-family: var(--font-body);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
  opacity: 0.35;
}

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

button,
input {
  font: inherit;
}

.page-shell {
  width: var(--container);
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.site-header,
.site-footer,
.hero,
.section,
.hero-card,
.post-card,
.project-card,
.subscribe-card,
.timeline-item {
  backdrop-filter: blur(18px);
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  background: rgba(255, 248, 238, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #d28c57);
  color: white;
  font-family: var(--font-display);
  font-size: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text {
  display: grid;
  gap: 0.1rem;
}

.brand-text strong {
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-text small,
.section-heading p,
.hero-text,
.form-note,
.timeline-item p,
.project-card p,
.post-excerpt {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.site-nav a {
  position: relative;
  padding-bottom: 0.15rem;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-toggle span {
  display: block;
  width: 1rem;
  height: 2px;
  margin: 0.22rem auto;
  background: var(--ink);
  transition: transform 180ms ease, opacity 180ms ease;
}

.hero,
.section,
.site-footer {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.95fr;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  overflow: hidden;
}

.hero::after,
.section::after {
  content: "";
  position: absolute;
  inset: auto auto -18% -4%;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 108, 103, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-label,
.project-type,
.post-category,
.timeline-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow,
.card-label,
.project-type,
.post-category {
  color: var(--secondary);
}

.hero h1,
.section h2,
.hero-card-main h2,
.project-card h3,
.post-title,
.timeline-item h3,
.subscribe-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
}

.hero h1 {
  margin-top: 0.65rem;
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 5.8rem);
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 62ch;
  font-size: 1.03rem;
  margin: 1rem 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.button-primary {
  background: var(--accent);
  color: white;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-deep);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--line);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 2rem 0 0;
}

.hero-stats div {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-stats dt {
  font-family: var(--font-display);
  font-size: 2rem;
}

.hero-stats dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 1rem;
}

.hero-card {
  padding: 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.58);
}

.hero-card-main {
  min-height: 19rem;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background:
    linear-gradient(180deg, rgba(47, 108, 103, 0.06), rgba(188, 95, 59, 0.16)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 248, 242, 0.68));
}

.hero-card-main p {
  max-width: 32ch;
}

.hero-card-note {
  background: rgba(255, 255, 255, 0.55);
}

.hero-card-note ul {
  padding-left: 1.2rem;
  margin: 1rem 0 0;
}

.card-meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.section,
.site-footer {
  margin-top: 1.25rem;
  padding: clamp(1.35rem, 3vw, 2rem);
}

.section-grid {
  display: grid;
  gap: 1rem;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.03em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.filter-chip {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip.active {
  transform: translateY(-1px);
  background: var(--accent-soft);
  color: var(--ink);
}

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

.post-card,
.project-card,
.timeline-item,
.subscribe-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-card::after,
.project-card::after,
.timeline-item::after,
.subscribe-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -25% auto;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 95, 59, 0.12), transparent 68%);
  pointer-events: none;
}

.post-card:hover,
.project-card:hover,
.timeline-item:hover,
.subscribe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(58, 47, 37, 0.1);
  border-color: rgba(188, 95, 59, 0.28);
}

.post-title,
.project-card h3,
.timeline-item h3,
.subscribe-card h3 {
  margin-top: 0.75rem;
  font-size: 1.55rem;
}

.post-excerpt {
  margin: 0.75rem 0 1.2rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 1.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(188, 95, 59, 0.13);
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  min-height: 15rem;
  display: flex;
  flex-direction: column;
}

.project-card a {
  margin-top: auto;
  color: var(--accent-deep);
}

.about {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.about-copy p + p {
  margin-top: 1rem;
}

.subscribe-card {
  display: grid;
  gap: 1rem;
}

.subscribe-card input {
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

body.motion-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .hero,
  .about,
  .split-layout,
  .posts-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 0.6rem;
  }

  .site-header {
    top: 0.5rem;
    border-radius: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    padding-top: 0.35rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header.open .site-nav {
    display: flex;
  }

  .site-header.open .nav-toggle span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .site-header.open .nav-toggle span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .hero-stats,
  .posts-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  body.motion-ready .reveal,
  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
