:root {
  color-scheme: light;
  --base: #eee7da;
  --surface: #e1d7c7;
  --line: #b7a99b;
  --text: #291c1a;
  --secondary: #5c4941;
  --accent: #92311f;
  --display: "Songti SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--base);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1230px, calc(100% - clamp(2rem, 7vw, 7rem))); margin-inline: auto; }

.opening {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100svh;
  color-scheme: dark;
  --base: #211112;
  --surface: #2e1b1a;
  --text: #fff3df;
  --secondary: #e0c6b5;
  --accent: #ffc49e;
  color: var(--text);
  background: var(--base);
}
.masthead { border-bottom: 1px solid #80574670; }
.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .85rem 2rem;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font: 1.85rem Georgia, serif;
  letter-spacing: -.06em;
}
.brand-mark { display: block; width: 2.15rem; height: 2.15rem; }
.brand-name { white-space: nowrap; }
.brand-ai {
  margin-left: .065em;
  color: var(--accent);
  font: 650 .78em/1 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.055em;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: .65rem 1.45rem; }
.masthead nav a { color: var(--secondary); font-size: .875rem; }
.masthead nav a:hover { color: var(--text); text-decoration: underline; }
.language-switch {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  border-left: 1px solid #80574670;
  padding-left: .75rem;
  font-size: .875rem;
  white-space: nowrap;
}
.language-switch [aria-current] { color: var(--accent); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  overflow: clip;
}
.hero-art, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { z-index: -2; object-fit: cover; object-position: 72% top; }
.hero::after {
  content: "";
  z-index: -1;
  background: linear-gradient(90deg, #19090beb 0%, #19090bb0 28%, #19090b25 58%, transparent 78%);
}
.hero-copy { padding-block: 4rem; }
h1 {
  margin: 0;
  font: 700 clamp(2.5rem, 7.2vw, 7rem)/1.04 var(--display);
  letter-spacing: -.085em;
}
h1 em { color: var(--accent); font-style: normal; }
.hero-intro { margin: 0 0 1rem; color: var(--accent); letter-spacing: .12em; }
.hero-description { max-width: 22rem; margin: 1.55rem 0 0; color: var(--secondary); line-height: 1.85; }
:lang(en) .hero-description { max-width: min(29rem, 43vw); }
.hero-action {
  display: inline-block;
  margin-top: 1.55rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
}
.hero-action:hover { color: var(--text); border-color: var(--text); }

main {
  border-top: 1px solid #b77e60;
  padding-top: clamp(3rem, 6vw, 5rem);
}

.category { margin-bottom: clamp(3rem, 8vw, 6rem); scroll-margin-top: 1rem; }

.category-header {
  --ribbon: #d87555;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: clamp(12rem, 24vw, 19rem);
  color: #fff1df;
  background: linear-gradient(120deg, #422021, #612b29);
}
.category-ai .category-header {
  --ribbon: #c58561;
  background: linear-gradient(120deg, #1d302c, #29423a);
}
.category-tools .category-header {
  --ribbon: #e2a266;
  background: linear-gradient(120deg, #402d21, #604230);
}
.category-copy { align-self: center; padding: clamp(1.2rem, 4.5vw, 3.5rem); }
.category h2 {
  margin: 0;
  font: 700 clamp(1.65rem, 4vw, 3.25rem)/1.13 var(--display);
  letter-spacing: -.04em;
}
.category-copy p { max-width: 25rem; margin: .8rem 0 0; line-height: 1.7; color: #f1d9c8; }
.category-note { margin: .6rem 0 0; color: var(--secondary); }
.category-art {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  background: radial-gradient(ellipse, #ed976929, transparent 70%);
}
.category-art::before {
  content: "";
  position: absolute;
  inset: 13% -9% 9% 4%;
  z-index: -1;
  border: solid color-mix(in srgb, var(--ribbon), transparent 56%);
  border-width: 1px 2px .6rem .2rem;
  border-radius: 50%;
  transform: rotate(-14deg);
}
.category-art i { display: block; position: absolute; }

.book { perspective: 550px; }
.book i {
  top: 25%;
  width: 27%;
  height: 51%;
  border: 1px solid #e9a587;
  background:
    repeating-linear-gradient(0deg, transparent 0 12px, #993e3329 13px 14px),
    linear-gradient(90deg, #b85d49, #e3a183);
  box-shadow: 0 .8rem 1.8rem #291012a0;
}
.book i:nth-child(1) { right: 50%; border-radius: 12% 0 0 9%; transform: skewY(9deg); }
.book i:nth-child(2) { left: 50%; border-radius: 0 12% 9% 0; transform: skewY(-9deg); }
.book i:nth-child(3) {
  left: 50%;
  border-radius: 0 12% 9% 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 12px, #57312632 13px 14px),
    linear-gradient(90deg, #bb684e, #f5c49f);
  transform-origin: left center;
  animation: turn-page 7s cubic-bezier(.45,.04,.28,1) infinite;
}
@keyframes turn-page {
  0%, 18% { transform: skewY(-9deg) rotateY(0); }
  69%, 89% { transform: skewY(-9deg) rotateY(-177deg); }
  90%, 100% { transform: skewY(-9deg) rotateY(-177deg); opacity: 0; }
}

.machine i {
  --rotation: 13deg;
  width: clamp(3rem, 30cqi, 9rem);
  aspect-ratio: 1;
  background:
    repeating-conic-gradient(from 6deg, transparent 0 16deg, #ba785733 17deg 20deg),
    radial-gradient(circle, #283d35 0 13%, #dfb391 14% 17%, #8b5541 18% 34%, #c78660 35% 61%, #a96547 62%);
  clip-path: polygon(92.0% 50.0%, 98.1% 59.6%, 95.3% 68.8%, 84.9% 73.3%, 79.7% 79.7%, 77.2% 90.7%, 68.8% 95.3%, 58.2% 91.2%, 50.0% 92.0%, 40.4% 98.1%, 31.2% 95.3%, 26.7% 84.9%, 20.3% 79.7%, 9.3% 77.2%, 4.7% 68.8%, 8.8% 58.2%, 8.0% 50.0%, 1.9% 40.4%, 4.7% 31.2%, 15.1% 26.7%, 20.3% 20.3%, 22.8% 9.3%, 31.2% 4.7%, 41.8% 8.8%, 50.0% 8.0%, 59.6% 1.9%, 68.8% 4.7%, 73.3% 15.1%, 79.7% 20.3%, 90.7% 22.8%, 95.3% 31.2%, 91.2% 41.8%);
  transform: rotate(var(--rotation));
  animation: turn-gear 21s linear infinite;
}
.machine i:nth-child(1) { left: 22%; top: 22%; }
.machine i:nth-child(2) { --rotation: 30deg; width: clamp(2.5rem, 25cqi, 7.4rem); left: 48%; top: 45%; animation-direction: reverse; animation-duration: 17s; }
.machine i:nth-child(3) { --rotation: 18deg; width: clamp(2rem, 18cqi, 5.25rem); left: 68%; top: 21%; animation-duration: 13s; }
@keyframes turn-gear { to { transform: rotate(calc(var(--rotation) + 360deg)); } }

.toolbox i {
  width: 52%;
  height: 18%;
  border: 1px solid #ebb381;
  border-radius: .25rem;
  background:
    linear-gradient(90deg, #6c3e2b 0 10%, transparent 10% 90%, #6c3e2b 90%),
    repeating-linear-gradient(90deg, #865334 0 1px, transparent 1px 12%),
    linear-gradient(180deg, #ce8d55, #956144);
  box-shadow: .5rem .75rem 0 #33221788;
  transform: skewY(-11deg) translateY(var(--shelf));
}
.toolbox i:nth-child(1) { --shelf: -115%; }
.toolbox i:nth-child(2) { --shelf: 0%; }
.toolbox i:nth-child(3) { --shelf: 115%; }
.toolbox i::after {
  content: "";
  position: absolute;
  top: 40%;
  left: 40%;
  width: 20%;
  height: 21%;
  border: 1px solid #f1c89e;
  border-radius: 1rem;
  background: #644431;
}

@media (prefers-reduced-motion: reduce) {
  .category-art i:nth-child(n) { animation: none; }
}

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3.4rem);
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.category-ai .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.products a { display: block; height: 100%; border-bottom: 1px solid var(--line); }
.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface);
}
.category-creation .product-image { object-fit: cover; }
.product-copy { padding: 1rem 0 1.15rem; }
.products h3 { margin: 0; font: 700 clamp(1.25rem, 2.6vw, 1.9rem)/1.2 var(--display); overflow-wrap: anywhere; }
.products p { margin: .6rem 0 .8rem; color: var(--secondary); line-height: 1.65; }
.product-copy span { color: var(--accent); font-size: .875rem; }
.products a:hover .product-copy span { text-decoration: underline; }
.category-archive { padding-top: 1.6rem; border-top: 1px solid var(--line); }
.category-archive h2 { font-size: 1.65rem; }
.category-archive .products h3 { font-size: 1.3rem; }
.category-archive .products img { max-height: 10rem; }
.footer { padding-block: 1.35rem; border-top: 1px solid var(--line); color: var(--secondary); }

@media (max-width: 820px) {
  .masthead-inner { flex-direction: column; align-items: flex-start; padding-block: .85rem; }
  .hero { grid-template-rows: auto 1fr; }
  .hero-art { position: relative; z-index: auto; display: block; height: auto; aspect-ratio: 5 / 3; object-position: right top; }
  .hero::after { content: none; }
  .hero-copy { padding-block: 1.6rem 2.4rem; }
  h1 { font-size: clamp(2.5rem, 10vw, 4rem); }
  .hero-description { margin-top: 1rem; }
  :lang(en) .hero-description { max-width: 32rem; }
  .category-header { grid-template-columns: 1fr; }
  .category-copy { padding-bottom: .35rem; }
  .category-art { height: clamp(8rem, 34vw, 13rem); }
  .products, .category-ai .products { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (min-width: 821px) and (min-aspect-ratio: 11/5) {
  .hero-art { object-fit: contain; object-position: right center; }
}
