:root {
  --sage: #8b9d83;
  --clay: #b08b6e;
  --terracotta: #c66b3d;
  --ochre: #c08e3a;
  --moss: #606c38;
  --sand: #e8dcc7;
  --oat: #d4b895;
  --bark: #4f432f;
  --leaf-dark: #34442b;
  --leaf-soft: #6f805c;
  --line: rgba(79, 67, 47, 0.26);
  --shadow: rgba(52, 68, 43, 0.18);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--leaf-dark);
  background: var(--sand);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.74' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

a { color: inherit; }

a:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--sand);
  background: var(--leaf-dark);
  transform: translateY(-150%);
  transition: transform 250ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(1440px, calc(100% - 48px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

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

.brand-seal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 58px;
  border: 1px solid var(--moss);
  border-radius: 20px 20px 16px 16px;
  color: var(--sand);
  background: var(--moss);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.08;
  letter-spacing: 0.12em;
}

.brand strong,
.brand small { display: block; }

.brand strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 4px;
  color: var(--leaf-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.collection-count {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--leaf-soft);
  font-size: 13px;
}

.collection-count strong {
  color: var(--moss);
  font-family: var(--display);
  font-size: 31px;
  font-weight: 500;
}

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

.hero {
  min-height: 530px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: clamp(50px, 8vw, 130px);
  align-items: center;
  padding: 74px 4vw 82px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 16px;
  color: var(--terracotta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
h3 { font-family: var(--display); }

h1 {
  max-width: 820px;
  margin: 0;
  color: var(--leaf-dark);
  font-size: clamp(42px, 5.2vw, 78px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.015em;
}

.hero-intro {
  max-width: 690px;
  margin: 28px 0 34px;
  color: var(--bark);
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.85;
}

.primary-action,
.enter-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 22px;
  color: var(--sand);
  background: var(--moss);
  font-weight: 700;
  text-decoration: none;
  transition: transform 350ms ease, background 350ms ease;
}

.primary-action:hover,
.enter-tool:hover {
  background: var(--leaf-dark);
  transform: translateY(-2px);
}

.primary-action svg,
.enter-tool svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.specimen-index {
  position: relative;
  min-height: 340px;
  padding: 48px 34px 36px 70px;
  overflow: hidden;
  border: 1px solid rgba(52, 68, 43, 0.18);
  border-radius: 32px;
  background: var(--oat);
  box-shadow: 0 24px 60px var(--shadow);
}

.specimen-index::after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border: 28px solid rgba(96, 108, 56, 0.16);
  border-radius: 50%;
}

.index-ring {
  position: absolute;
  top: 43px;
  left: 28px;
  display: grid;
  gap: 55px;
}

.index-ring span {
  width: 15px;
  height: 15px;
  border: 3px solid var(--sand);
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 1px rgba(79, 67, 47, 0.28);
}

.specimen-index ol {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.specimen-index li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 4px 12px;
  padding: 0 0 24px;
  margin-bottom: 23px;
  border-bottom: 1px solid rgba(79, 67, 47, 0.2);
}

.specimen-index li:last-child { margin-bottom: 0; }

.specimen-index li > span {
  grid-row: 1 / span 2;
  color: var(--terracotta);
  font-family: var(--display);
  font-size: 17px;
}

.specimen-index strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

.specimen-index small {
  color: var(--bark);
  font-size: 13px;
}

.catalog { padding: 78px 4vw 100px; }

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

.catalog-heading h2 {
  margin: 0;
  font-size: clamp(35px, 4vw, 54px);
  font-weight: 500;
}

.catalog-heading > p {
  max-width: 330px;
  margin: 0 0 7px;
  color: var(--leaf-soft);
  font-size: 14px;
  text-align: right;
}

.tool-shelf {
  position: relative;
  padding: 26px 26px 34px;
  border: 1px solid rgba(52, 68, 43, 0.2);
  border-radius: 32px;
  background: var(--sage);
  box-shadow: inset 0 -16px 0 rgba(52, 68, 43, 0.12);
}

.tool-shelf::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -14px;
  height: 24px;
  border-radius: 0 0 28px 28px;
  background: var(--clay);
  box-shadow: 0 18px 30px var(--shadow);
}

.tool-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(330px, 0.88fr) minmax(460px, 1.12fr);
  min-height: 460px;
  overflow: hidden;
  border-radius: 26px;
  background: var(--sand);
  transition: transform 450ms cubic-bezier(.2,.78,.2,1), box-shadow 450ms ease;
}

.tool-card:hover {
  transform: translateY(-6px) translateX(5px);
  box-shadow: -12px 18px 32px rgba(52, 68, 43, 0.18);
}

.tool-cover {
  position: relative;
  display: block;
  min-height: 360px;
  overflow: hidden;
  background: var(--leaf-soft);
}

.tool-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(52, 68, 43, 0.04), rgba(52, 68, 43, 0.24));
}

.tool-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(.2,.78,.2,1);
}

.tool-card:hover .tool-cover img { transform: scale(1.035); }

.cover-status {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 20px;
  padding: 8px 13px;
  border-radius: 16px;
  color: var(--sand);
  background: var(--moss);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tool-content {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr;
  grid-template-rows: 1fr auto;
  gap: 24px 20px;
  padding: clamp(30px, 4vw, 58px);
}

.tool-number {
  color: var(--terracotta);
  font-family: var(--display);
  font-size: 42px;
  line-height: 1;
}

.tool-subject {
  margin: 0 0 12px;
  color: var(--terracotta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.tool-copy h3 {
  margin: 0 0 20px;
  font-size: clamp(29px, 3.1vw, 46px);
  font-weight: 500;
  line-height: 1.18;
}

.tool-copy > p:last-of-type {
  max-width: 700px;
  margin: 0;
  color: var(--bark);
  font-size: 16px;
  line-height: 1.78;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 8px 12px;
  border: 1px solid rgba(96, 108, 56, 0.3);
  border-radius: 16px;
  color: var(--moss);
  font-size: 12px;
  font-weight: 700;
}

.tool-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--bark);
  font-size: 13px;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ochre);
  box-shadow: 0 0 0 4px rgba(192, 142, 58, 0.16);
}

.service-state[data-state="online"] .state-dot {
  background: var(--moss);
  box-shadow: 0 0 0 4px rgba(96, 108, 56, 0.18);
}

.service-state[data-state="offline"] .state-dot {
  background: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(198, 107, 61, 0.15);
}

.enter-tool { flex: 0 0 auto; }

.site-footer {
  width: min(1440px, calc(100% - 48px));
  min-height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--leaf-soft);
  font-size: 13px;
}

.site-footer strong {
  color: var(--leaf-dark);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.08em;
}

body.is-leaving .site-header,
body.is-leaving main,
body.is-leaving .site-footer {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 300ms ease, transform 300ms ease;
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 62px 2vw 66px;
  }

  .specimen-index { min-height: 0; }

  .catalog { padding: 62px 2vw 84px; }

  .tool-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .tool-cover { height: min(54vw, 460px); }
}

@media (max-width: 650px) {
  .site-header,
  main,
  .site-footer { width: min(100% - 28px, 1440px); }

  .site-header { min-height: 78px; }
  .brand-seal { width: 42px; height: 50px; border-radius: 17px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .collection-count > span:first-child { display: none; }

  .hero { padding: 48px 0 54px; }
  h1 { font-size: clamp(38px, 12vw, 56px); }
  .hero-intro { font-size: 16px; }
  .specimen-index { padding: 34px 22px 28px 58px; border-radius: 24px; }
  .index-ring { left: 20px; top: 31px; gap: 54px; }
  .specimen-index strong { font-size: 19px; }

  .catalog { padding: 52px 0 72px; }
  .catalog-heading { display: block; }
  .catalog-heading > p { margin-top: 12px; text-align: left; }
  .tool-shelf { padding: 12px 12px 24px; border-radius: 24px; }
  .tool-card { border-radius: 19px; }
  .tool-cover { height: 55vw; min-height: 220px; }
  .tool-content { grid-template-columns: 42px 1fr; padding: 28px 22px; }
  .tool-number { font-size: 30px; }
  .tool-copy h3 { font-size: 29px; }
  .tool-copy > p:last-of-type { font-size: 14px; }
  .tool-actions { align-items: stretch; flex-direction: column; }
  .enter-tool { width: 100%; }

  .site-footer { align-items: flex-start; flex-direction: column; padding: 25px 0; }
}

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