:root {
  --bg: #f9f8f4;
  --paper: #f2f0eb;
  --ink: #2d3a31;
  --muted: #687367;
  --sage: #8c9a84;
  --clay: #dccfc2;
  --stone: #e6e2da;
  --terracotta: #c27b66;
  --white: #fffdf8;
  --shadow: 0 20px 40px -10px rgba(45, 58, 49, 0.08);
  --shadow-strong: 0 25px 50px -12px rgba(45, 58, 49, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(140, 154, 132, 0.18), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(194, 123, 102, 0.13), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f4f1ea 54%, var(--bg) 100%);
  font-family: "Source Sans 3", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: auto -8vw -18vw auto;
  z-index: -1;
  width: 40vw;
  height: 40vw;
  border-radius: 48% 52% 38% 62%;
  background: rgba(220, 207, 194, 0.34);
  filter: blur(2px);
}

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

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
.brand span,
.stats strong {
  font-family: "Playfair Display", "Noto Serif SC", serif;
}

em {
  font-style: italic;
  color: var(--terracotta);
}

.paper-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(230, 226, 218, 0.85);
  background: rgba(249, 248, 244, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 2px;
}

.brand span {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand small,
.eyebrow,
.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand small,
.nav,
.lead,
.sectionLead,
.introText,
.project p,
.skillGrid p,
.fileGrid span,
.contact p,
.detailText {
  color: var(--muted);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 600;
}

.nav a,
.topAction,
.actions a,
.filters button,
.textLink,
.fileGrid a,
.moduleCard,
.project {
  transition:
    transform 500ms ease,
    box-shadow 500ms ease,
    color 300ms ease,
    border-color 300ms ease,
    background-color 300ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--terracotta);
}

.topAction,
.actions a,
.filters button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topAction,
.secondary,
.filters button {
  border: 1px solid var(--sage);
  color: var(--sage);
  background: rgba(255, 253, 248, 0.36);
}

.topAction {
  padding: 10px 18px;
}

.topAction:hover,
.secondary:hover,
.filters button:hover,
.filters button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.hero,
.intro,
.moduleStrip,
.stats,
.section,
.detailHero,
.detailBody {
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(42px, 7vw, 96px);
  align-items: center;
  min-height: calc(100vh - 84px);
  padding: clamp(72px, 10vw, 140px) 0 clamp(56px, 8vw, 108px);
}

.hero::before,
.organic-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(140, 154, 132, 0.22);
  border-radius: 52% 48% 44% 56%;
}

.hero::before {
  inset: 12% 42% auto auto;
  width: 180px;
  height: 260px;
  transform: rotate(-16deg);
}

.organic-section::after {
  right: -5vw;
  bottom: 9%;
  width: 260px;
  height: 180px;
  transform: rotate(12deg);
}

.eyebrow,
.label {
  margin-bottom: 14px;
  color: var(--sage);
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(54px, 8vw, 108px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(25px, 2.5vw, 35px);
  font-weight: 700;
  line-height: 1.16;
}

.identity {
  color: var(--sage);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
}

.lead,
.sectionLead,
.introText,
.detailText {
  font-size: 18px;
  line-height: 1.85;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary {
  padding: 12px 24px;
  border: 1px solid var(--ink);
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 18px 36px rgba(45, 58, 49, 0.16);
}

.primary:hover,
.primary:focus-visible {
  transform: translateY(-2px);
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.secondary {
  padding: 12px 24px;
}

.heroVisual {
  position: relative;
  justify-self: center;
  width: min(430px, 100%);
}

.heroVisual::before,
.heroVisual::after {
  content: "";
  pointer-events: none;
  position: absolute;
  border-radius: 230px 230px 42px 42px;
}

.heroVisual::before {
  inset: -18px 18px 18px -18px;
  z-index: -1;
  border: 1px solid rgba(140, 154, 132, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.62), rgba(220, 207, 194, 0.18)),
    radial-gradient(circle at 28% 18%, rgba(194, 123, 102, 0.2), transparent 34%);
  box-shadow: 0 22px 44px -22px rgba(45, 58, 49, 0.36);
  transform: rotate(-2.5deg);
}

.heroVisual::after {
  inset: 18px -20px -16px 20px;
  z-index: 0;
  border: 1px solid rgba(194, 123, 102, 0.62);
  transform: rotate(3deg);
}

.heroArch {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 52% 40%;
  border: 1px solid rgba(255, 253, 248, 0.92);
  border-radius: 230px 230px 42px 42px;
  box-shadow:
    0 0 0 12px rgba(255, 253, 248, 0.44),
    0 0 0 13px rgba(140, 154, 132, 0.5),
    var(--shadow-strong);
}

.quoteCard {
  position: absolute;
  z-index: 2;
  right: -38px;
  bottom: 42px;
  max-width: 210px;
  padding: 22px;
  border: 1px solid rgba(255, 253, 248, 0.72);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.quoteCard span {
  color: var(--sage);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quoteCard strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 60px;
  line-height: 0.9;
}

.quoteCard p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.intro {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(36px, 7vw, 88px);
  padding: clamp(70px, 10vw, 132px) 0 48px;
}

.moduleStrip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 0 54px;
}

.moduleCard {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: 32px;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.moduleCard:nth-child(even) {
  transform: translateY(28px);
}

.moduleCard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(45, 58, 49, 0.8));
}

.moduleCard img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  transition: transform 700ms ease;
}

.moduleCard span,
.moduleCard small {
  position: absolute;
  left: 22px;
  z-index: 1;
  color: var(--white);
}

.moduleCard span {
  bottom: 48px;
  font-family: "Playfair Display", "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 700;
}

.moduleCard small {
  bottom: 24px;
  color: rgba(255, 253, 248, 0.76);
  font-weight: 600;
}

.moduleCard:hover {
  box-shadow: var(--shadow-strong);
}

.moduleCard:hover img {
  transform: scale(1.06);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 26px 0 46px;
}

.stats article,
.project,
.skillGrid article,
.fileGrid a,
.detailPanel,
.detailAside {
  border: 1px solid rgba(230, 226, 218, 0.95);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow);
}

.stats article {
  padding: 26px;
  border-radius: 32px;
}

.stats strong {
  display: block;
  margin-bottom: 4px;
  color: var(--terracotta);
  font-size: 58px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-weight: 700;
}

.section {
  padding: clamp(70px, 10vw, 132px) 0 24px;
}

.sectionHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 42px;
}

.sectionLead {
  max-width: 760px;
  margin: 18px 0 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.filters button {
  padding: 10px 16px;
  cursor: pointer;
}

.filters button.active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

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

.project {
  display: grid;
  overflow: hidden;
  border-radius: 34px;
}

.project:nth-child(3n + 2) {
  transform: translateY(28px);
}

.project.feature {
  grid-column: span 2;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
}

.project:nth-child(3n + 2):hover {
  transform: translateY(20px);
}

.projectImage {
  overflow: hidden;
}

.project img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 700ms ease;
}

.project:hover img {
  transform: scale(1.05);
}

.project div {
  padding: 28px;
}

.project p {
  line-height: 1.75;
}

.textLink {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  color: var(--terracotta);
  font-weight: 700;
}

.textLink::after {
  content: "→";
  margin-left: 8px;
  transition: transform 300ms ease;
}

.textLink:hover::after {
  transform: translateX(4px);
}

.skillSection,
.contact,
.detailBody {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 42px;
}

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

.skillGrid article,
.fileGrid a {
  border-radius: 32px;
  padding: 28px;
}

.skillGrid span {
  color: var(--sage);
  font-family: "Playfair Display", serif;
  font-size: 48px;
  font-weight: 700;
}

.fileGrid a {
  display: grid;
  gap: 8px;
}

.fileGrid strong {
  font-family: "Playfair Display", "Noto Serif SC", serif;
  font-size: 26px;
}

.fileGrid a:hover,
.fileGrid a:focus-visible {
  transform: translateY(-4px);
  border-color: var(--sage);
  box-shadow: var(--shadow-strong);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 96px;
  padding: 32px clamp(20px, 5vw, 72px);
  color: rgba(255, 253, 248, 0.76);
  background: var(--ink);
}

.project.is-hidden {
  display: none;
}

.detailHero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(34px, 6vw, 84px);
  align-items: center;
  padding: clamp(54px, 8vw, 110px) 0 54px;
}

.detailHero img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 240px 240px 46px 46px;
  box-shadow: var(--shadow-strong);
}

.backLink {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--sage);
  font-weight: 700;
}

.detailMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.detailMeta span {
  padding: 8px 13px;
  border: 1px solid var(--stone);
  border-radius: 999px;
  color: var(--sage);
  background: rgba(255, 253, 248, 0.6);
  font-size: 14px;
  font-weight: 700;
}

.detailBody {
  padding: 24px 0 68px;
}

.detailPanel,
.detailAside {
  border-radius: 34px;
  padding: clamp(26px, 4vw, 42px);
}

.detailPanel h2,
.detailAside h2 {
  margin-bottom: 22px;
  font-size: clamp(34px, 4vw, 54px);
}

.detailList {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detailList li {
  padding-left: 24px;
  border-left: 1px solid var(--sage);
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.detailGallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1280px, calc(100% - 44px));
  margin: 0 auto 78px;
}

.detailGallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.detailGallery img:nth-child(2) {
  margin-top: 28px;
  border-radius: 180px 180px 34px 34px;
}

.notFound {
  width: min(760px, calc(100% - 44px));
  margin: 90px auto;
  padding: 42px;
  border: 1px solid var(--stone);
  border-radius: 34px;
  background: rgba(255, 253, 248, 0.72);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

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

.delay-1 {
  transition-delay: 90ms;
}

.delay-2 {
  transition-delay: 160ms;
}

.delay-3 {
  transition-delay: 230ms;
}

.delay-4 {
  transition-delay: 300ms;
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 4px;
}

@media (max-width: 1080px) {
  .hero,
  .intro,
  .skillSection,
  .contact,
  .detailHero,
  .detailBody {
    grid-template-columns: 1fr;
  }

  .moduleStrip,
  .stats,
  .projectGrid,
  .detailGallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project.feature {
    grid-column: span 1;
  }

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

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

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .hero,
  .intro,
  .moduleStrip,
  .stats,
  .section,
  .detailHero,
  .detailBody,
  .detailGallery {
    width: min(100% - 28px, 1280px);
  }

  h1 {
    font-size: clamp(48px, 16vw, 68px);
  }

  h2 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .quoteCard {
    right: 12px;
    bottom: 22px;
  }

  .moduleStrip,
  .stats,
  .projectGrid,
  .skillGrid,
  .fileGrid,
  .detailGallery {
    grid-template-columns: 1fr;
  }

  .moduleCard:nth-child(even),
  .project:nth-child(3n + 2),
  .project:nth-child(3n + 2):hover,
  .detailGallery img:nth-child(2) {
    margin-top: 0;
    transform: none;
  }

  .actions a,
  .filters button,
  .topAction {
    width: 100%;
  }

  .actions,
  .filters {
    width: 100%;
  }

  footer {
    flex-direction: column;
  }
}

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