:root {
  --kiln: #171816;
  --kiln-soft: #242521;
  --kiln-line: #3a3b35;
  --paper: #ece5d6;
  --paper-deep: #d9cbb4;
  --paper-ink: #272925;
  --muted: #77786f;
  --clay: #a34f3b;
  --clay-dark: #70352b;
  --copper: #d0a16b;
  --glaze: #3b6f66;
  --glaze-pale: #87a69b;
  --chalk: #f2eadb;
  --line-light: rgba(236, 229, 214, 0.16);
  --line-dark: rgba(39, 41, 37, 0.18);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--paper-ink);
  background: var(--kiln);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--kiln); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100%; margin: 0; overflow-x: hidden; background: var(--kiln); }
button, input { font: inherit; }
button { letter-spacing: 0; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.workbench {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(248px, 0.76fr) minmax(500px, 1.58fr) minmax(310px, 0.9fr);
  grid-template-rows: 68px minmax(680px, calc(100svh - 106px)) 38px;
  background: var(--kiln);
}

.masthead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, 0.76fr) minmax(500px, 1.58fr) minmax(310px, 0.9fr);
  align-items: center;
  min-height: 68px;
  color: var(--chalk);
  border-bottom: 1px solid var(--kiln-line);
}

.wordmark {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 24px;
  color: inherit;
  text-decoration: none;
  border-right: 1px solid var(--kiln-line);
}
.wordmark-stamp { width: 30px; height: 34px; display: grid; place-items: center; color: var(--chalk); background: var(--clay); font-family: "Noto Serif SC", "STSong", serif; font-size: 18px; transform: rotate(-3deg); }
.wordmark b { display: block; font-family: "Noto Serif SC", "STSong", serif; font-size: 16px; font-weight: 600; }
.wordmark small { display: block; margin-top: 2px; color: #9a9b91; font-size: 9px; }
.heritage-line { display: flex; align-items: center; gap: 13px; padding: 0 26px; color: #adaea3; font-size: 11px; }
.heritage-line i { width: 48px; height: 1px; background: var(--clay); }
.edition { align-self: stretch; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; color: #85867e; border-left: 1px solid var(--kiln-line); font: 10px/1.2 Consolas, monospace; }
.edition b { color: var(--copper); font-weight: 500; }

.title-panel {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
  color: var(--paper-ink);
  background: var(--paper);
  border-right: 1px solid #bfb3a0;
}
.record-no { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 13px; color: var(--muted); border-bottom: 1px solid var(--line-dark); font: 9px/1.2 Consolas, monospace; }
.record-no b { color: var(--clay-dark); font-weight: 600; }
.title-lockup { margin: auto 0; }
.kicker { margin: 0 0 20px; color: var(--clay); font-family: "Noto Serif SC", "STSong", serif; font-size: 14px; line-height: 1.65; }
h1 { margin: 0; font-family: "Noto Serif SC", "STSong", serif; font-size: 58px; font-weight: 600; line-height: 1.02; }
.lead { max-width: 205px; margin: 24px 0 0; color: #595b55; font-size: 13px; line-height: 1.75; }
.material-notes { margin: 0; border-top: 1px solid var(--line-dark); }
.material-notes div { display: grid; grid-template-columns: 48px 1fr; padding: 8px 0; border-bottom: 1px solid var(--line-dark); }
.material-notes dt { color: var(--muted); font-size: 10px; }
.material-notes dd { margin: 0; font-family: "Noto Serif SC", "STSong", serif; font-size: 12px; }
.side-note { margin: 16px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.ar-stage {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-width: 0;
  min-height: 680px;
  overflow: hidden;
  color: var(--chalk);
  background: #20211e;
  isolation: isolate;
}
.ar-stage::before { content: ""; position: absolute; inset: 0; z-index: -3; background: #20211e; }
.ar-stage::after { content: ""; position: absolute; inset: 13% 10%; z-index: -2; border: 1px solid rgba(208, 161, 107, 0.17); pointer-events: none; }
.stage-head, .stage-foot { position: absolute; z-index: 8; right: 22px; left: 22px; display: flex; justify-content: space-between; align-items: center; color: #a4a59b; font: 10px/1.2 Consolas, monospace; }
.stage-head { top: 20px; }
.stage-foot { bottom: 18px; }
.stage-foot span:last-child { color: #cbc1ae; font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.live-state { display: flex; align-items: center; gap: 7px; }
.live-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px rgba(163, 79, 59, 0.16); }

#ar-mount { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
a-scene { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.a-enter-vr, .a-enter-ar { display: none !important; }

.scan-ui { position: absolute; top: 50%; left: 50%; z-index: 6; width: 330px; height: 440px; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; }
.scan-ui > div { align-self: end; display: grid; gap: 5px; margin-bottom: -44px; text-align: center; }
.scan-ui b { color: #d7cbb6; font-size: 12px; font-weight: 500; }
.scan-ui small { color: #7e7f77; font-size: 9px; }
.scan-corner { position: absolute; width: 30px; height: 30px; border-color: var(--copper); border-style: solid; }
.scan-corner-a { top: 0; left: 0; border-width: 2px 0 0 2px; }
.scan-corner-b { top: 0; right: 0; border-width: 2px 2px 0 0; }
.scan-corner-c { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.scan-corner-d { right: 0; bottom: 0; border-width: 0 2px 2px 0; }

.demo-scene { position: absolute; inset: 9% 7% 9%; z-index: 2; opacity: 0; transform: translateY(10px); transition: opacity 350ms ease, transform 350ms ease; pointer-events: none; }
body.is-demo .demo-scene { opacity: 1; transform: translateY(0); }
body.is-demo .scan-ui { opacity: 0.1; }
.kiln-grid { position: absolute; inset: 0; border: 1px solid rgba(236, 229, 214, 0.09); background-size: 40px 40px; background-image: linear-gradient(rgba(236,229,214,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(236,229,214,.035) 1px, transparent 1px); }
.demo-marker { position: absolute; left: 5%; bottom: 7%; width: 118px; aspect-ratio: 3 / 4; overflow: hidden; background: var(--paper); box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.24); transform: rotate(-4deg); }
.demo-marker img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shadow-disc { position: absolute; left: 50%; bottom: 18%; width: 250px; height: 45px; border-radius: 50%; background: rgba(0,0,0,.45); transform: translateX(-42%); filter: blur(5px); }

.demo-vessel { position: absolute; top: 50%; left: 55%; width: 230px; height: 360px; transform: translate(-50%, -50%); filter: drop-shadow(16px 18px 10px rgba(0,0,0,.3)); }
.demo-vessel > span { position: absolute; left: 50%; display: block; transform: translateX(-50%); transition: background-color 350ms ease, box-shadow 350ms ease, opacity 350ms ease; }
.vessel-lip { top: 24px; z-index: 5; width: 78px; height: 16px; border: 3px solid #d2a06d; border-radius: 50%; background: #3f201c; }
.vessel-neck { top: 35px; z-index: 3; width: 72px; height: 88px; background: #8f4435; border-radius: 10px 10px 20px 20px; }
.vessel-shoulder { top: 99px; z-index: 3; width: 166px; height: 88px; background: #994938; border-radius: 50% 50% 22% 22%; }
.vessel-body { top: 137px; z-index: 2; width: 194px; height: 164px; background: #9e4b39; border-radius: 36% 36% 22% 22%; box-shadow: inset 28px 2px 0 rgba(73,31,25,.22), inset -18px 6px 0 rgba(230,170,117,.14); }
.vessel-foot { top: 291px; z-index: 3; width: 100px; height: 26px; background: #6d342b; border-radius: 8px 8px 20px 20px; }
.vessel-cut { top: 203px; z-index: 4; width: 152px; height: 2px; background: #d3a06d; opacity: 0.55; }
.light-sweep { top: 75px; z-index: 6; width: 24px; height: 210px; background: rgba(242, 234, 219, .2); border-radius: 50%; transform: translateX(12px) rotate(9deg) !important; opacity: 0; }
.demo-scene[data-chapter="0"] .demo-vessel { animation: vessel-turn 8s linear infinite; }
.demo-scene[data-chapter="1"] .demo-vessel { animation: vessel-tap 2.6s ease-in-out infinite; }
.demo-scene[data-chapter="2"] .demo-vessel { animation: vessel-turn 9s linear infinite; }
.demo-scene[data-chapter="2"] .vessel-neck, .demo-scene[data-chapter="2"] .vessel-shoulder, .demo-scene[data-chapter="2"] .vessel-body { background: var(--glaze); }
.demo-scene[data-chapter="2"] .vessel-neck, .demo-scene[data-chapter="2"] .vessel-shoulder, .demo-scene[data-chapter="2"] .vessel-body { background: var(--glaze-live, var(--glaze)); }
.demo-scene[data-chapter="2"] .vessel-body { box-shadow: inset 28px 2px 0 rgba(21,48,45,.26), inset -24px 4px 0 var(--glaze-highlight, rgba(160,200,183,.2)); }
.demo-scene[data-chapter="2"] .light-sweep { opacity: var(--light-opacity, .38); animation: light-pass 2.8s ease-in-out infinite; }
.sound-rings { position: absolute; top: 47%; left: 55%; width: 230px; height: 230px; transform: translate(-50%, -50%); opacity: 0; }
.sound-rings i { position: absolute; inset: 42%; border: 1px solid var(--copper); border-radius: 50%; animation: ring-out 2.2s ease-out infinite; }
.sound-rings i:nth-child(2) { animation-delay: 550ms; border-color: var(--glaze-pale); }
.sound-rings i:nth-child(3) { animation-delay: 1100ms; }
.demo-scene[data-chapter="1"] .sound-rings { opacity: 1; }
.demo-scene.is-struck .sound-rings i { animation-duration: 850ms; }
.clay-sample { position: absolute; top: 18%; right: 8%; width: 100px; height: 80px; opacity: 0; }
.clay-sample i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--clay); animation: clay-fall 2.6s ease-in-out infinite; }
.clay-sample i:nth-child(2) { left: 28px; top: 10px; width: 12px; height: 12px; animation-delay: 200ms; background: var(--copper); }
.clay-sample i:nth-child(3) { left: 53px; top: 3px; width: 22px; height: 22px; animation-delay: 440ms; }
.clay-sample i:nth-child(4) { left: 76px; top: 24px; width: 10px; height: 10px; animation-delay: 680ms; background: var(--glaze); }
.clay-sample i:nth-child(5) { left: 18px; top: 42px; width: 8px; height: 8px; animation-delay: 900ms; }
.demo-scene[data-chapter="0"] .clay-sample { opacity: 1; }
.demo-caption { position: absolute; right: 3%; bottom: 3%; display: grid; justify-items: end; gap: 4px; margin: 0; }
.demo-caption span { color: var(--copper); font-family: "Noto Serif SC", "STSong", serif; font-size: 13px; }
.demo-caption b { color: var(--chalk); font-family: "Noto Serif SC", "STSong", serif; font-size: 22px; font-weight: 500; }

@keyframes vessel-turn { 50% { transform: translate(-50%, -50%) rotateY(14deg); } }
@keyframes vessel-tap { 10%, 20% { transform: translate(-50%, -50%) rotate(1.4deg); } 15%, 25% { transform: translate(-50%, -50%) rotate(-1.4deg); } }
@keyframes light-pass { 0%, 100% { transform: translateX(-52px) rotate(9deg); opacity: 0.05; } 50% { transform: translateX(38px) rotate(9deg); opacity: 0.42; } }
@keyframes ring-out { 0% { inset: 44%; opacity: .8; } 100% { inset: 0; opacity: 0; } }
@keyframes clay-fall { 0%, 100% { transform: translateY(0); opacity: .2; } 50% { transform: translateY(28px); opacity: .9; } }
@keyframes vessel-hand-turn { to { transform: translate(-50%, -50%) rotateY(720deg); } }
.demo-vessel.is-hand-turned { animation: vessel-hand-turn 1.8s ease-out !important; }

.field-panel {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 18px;
  background: #f0e8d9;
  border-left: 1px solid #bfb3a0;
}
.chapter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--paper-ink); }
.chapter-tab { min-width: 0; min-height: 62px; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 1fr; align-items: center; padding: 8px; color: #6d6f68; background: transparent; border: 0; border-right: 1px solid var(--paper-ink); cursor: pointer; }
.chapter-tab:last-child { border-right: 0; }
.chapter-tab span { grid-row: 1 / 3; color: var(--clay); font: 10px/1 Consolas, monospace; }
.chapter-tab b { align-self: end; overflow-wrap: anywhere; color: inherit; font-family: "Noto Serif SC", "STSong", serif; font-size: 13px; font-weight: 600; }
.chapter-tab small { align-self: start; color: inherit; font-size: 8px; }
.chapter-tab:hover, .chapter-tab.is-active { color: var(--chalk); background: var(--paper-ink); }
.chapter-tab.is-active span { color: var(--copper); }

.field-copy { padding: 25px 0 18px; border-bottom: 1px solid var(--line-dark); }
.field-label { margin: 0 0 10px; color: var(--clay); font: 9px/1.2 Consolas, monospace; }
.field-copy h2 { margin: 0 0 10px; font-family: "Noto Serif SC", "STSong", serif; font-size: 29px; font-weight: 600; line-height: 1.2; }
.field-copy > p:not(.field-label) { min-height: 66px; margin: 0; color: #63645e; font-size: 12px; line-height: 1.75; }
.field-copy blockquote { margin: 15px 0 0; padding-left: 12px; color: var(--glaze); border-left: 3px solid var(--glaze); font-family: "Noto Serif SC", "STSong", serif; font-size: 12px; }

.target-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 20px 0 16px; }
.target-card { position: relative; min-width: 0; padding: 0; overflow: hidden; background: #d9cbb4; border: 1px solid transparent; cursor: pointer; opacity: .58; transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease; }
.target-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.target-card span { position: absolute; right: 0; bottom: 0; left: 0; padding: 5px; color: var(--chalk); background: rgba(23,24,22,.82); font-size: 8px; text-align: center; }
.target-card:hover, .target-card.is-active { opacity: 1; transform: translateY(-3px); }
.target-card.is-active { border-color: var(--clay); }

.sensory-tools { min-height: 50px; margin-bottom: 14px; }
.tool-button { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: var(--paper-ink); background: transparent; border: 1px solid var(--paper-ink); cursor: pointer; }
.tool-button:hover { color: var(--chalk); background: var(--glaze); border-color: var(--glaze); }
.tool-icon { color: var(--clay); font-size: 17px; }
.light-tool { min-height: 50px; display: grid; grid-template-columns: 68px 1fr 26px; align-items: center; gap: 8px; font-size: 10px; }
.light-tool input { width: 100%; accent-color: var(--glaze); }
.light-tool output { color: var(--clay); font: 10px/1 Consolas, monospace; text-align: right; }
.is-hidden { display: none !important; }

.launch-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: auto; }
.launch-primary, .launch-secondary { min-height: 46px; border: 1px solid var(--paper-ink); cursor: pointer; }
.launch-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--chalk); background: var(--paper-ink); }
.launch-primary:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
.launch-secondary { padding: 0 13px; color: var(--paper-ink); background: transparent; font-size: 11px; }
.launch-secondary:hover { color: var(--clay-dark); border-color: var(--clay-dark); }
.camera-mark { color: var(--copper); font-size: 18px; }
.permission-note { margin: 9px 0 0; color: #898a82; font-size: 9px; text-align: center; }

.footer {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 38px;
  padding: 0 24px;
  color: #77786f;
  background: var(--kiln);
  border-top: 1px solid var(--kiln-line);
  font-size: 9px;
}
.footer span:nth-child(2) { color: #b79b76; }
.footer span:last-child { text-align: right; font-family: Consolas, monospace; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: min(360px, calc(100vw - 36px)); padding: 12px 14px; color: var(--chalk); background: var(--clay-dark); border-left: 3px solid var(--copper); box-shadow: 0 10px 30px rgba(0,0,0,.28); font-size: 11px; line-height: 1.65; }

@media (max-width: 1120px) {
  .workbench { grid-template-columns: minmax(220px, .62fr) minmax(500px, 1.38fr); grid-template-rows: 68px minmax(650px, 1fr) auto 38px; }
  .masthead { grid-template-columns: minmax(220px, .62fr) minmax(500px, 1.38fr); }
  .edition { display: none; }
  .title-panel { grid-column: 1; grid-row: 2; }
  .ar-stage { grid-column: 2; grid-row: 2; min-height: 650px; }
  .field-panel { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: 1fr 1.1fr 1fr; grid-template-rows: auto auto; gap: 18px 24px; border-top: 1px solid #bfb3a0; border-left: 0; }
  .chapter-tabs { grid-column: 1; align-self: start; }
  .field-copy { grid-column: 2; grid-row: 1 / 3; padding: 0; border-bottom: 0; }
  .target-strip { grid-column: 3; grid-row: 1; margin: 0; }
  .sensory-tools { grid-column: 1; grid-row: 2; margin: 0; }
  .launch-row { grid-column: 3; grid-row: 2; margin: 0; }
  .permission-note { display: none; }
  .footer { grid-row: 4; }
}

@media (max-width: 720px) {
  .workbench { display: block; min-height: 100svh; }
  .masthead { display: flex; justify-content: space-between; min-height: 62px; }
  .wordmark { padding: 0 16px; border-right: 0; }
  .heritage-line { padding: 0 16px; }
  .heritage-line span:first-child, .heritage-line i { display: none; }
  .title-panel { min-height: 370px; padding: 20px 18px; border-right: 0; }
  .title-lockup { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 18px; margin: 38px 0; }
  .kicker { grid-column: 1 / -1; margin: 0; }
  h1 { font-size: 48px; }
  .lead { margin: 0; }
  .material-notes { display: grid; grid-template-columns: repeat(3, 1fr); }
  .material-notes div { grid-template-columns: 1fr; gap: 4px; border-right: 1px solid var(--line-dark); }
  .material-notes div:last-child { border-right: 0; }
  .side-note { display: none; }
  .ar-stage { min-height: 610px; }
  .ar-stage::after { inset: 11% 5%; }
  .scan-ui { width: min(74vw, 300px); height: min(98vw, 400px); }
  .demo-scene { inset: 8% 4% 10%; }
  .demo-vessel { left: 57%; width: 215px; transform: translate(-50%, -50%) scale(.9); }
  .demo-marker { left: 2%; bottom: 9%; width: 92px; }
  .demo-caption b { font-size: 18px; }
  .field-panel { display: block; padding: 22px 18px 18px; border-left: 0; }
  .field-copy { padding: 24px 0 16px; border-bottom: 1px solid var(--line-dark); }
  .field-copy > p:not(.field-label) { min-height: 0; }
  .target-strip { margin: 18px 0 14px; }
  .sensory-tools { margin-bottom: 13px; }
  .launch-row { margin-top: 0; }
  .permission-note { display: block; }
  .footer { min-height: 62px; display: flex; justify-content: space-between; padding: 0 18px; }
  .footer span:nth-child(2) { display: none; }
}

@media (max-width: 390px) {
  .heritage-line { display: none; }
  .title-lockup { grid-template-columns: 1fr; }
  .lead { max-width: none; }
  .ar-stage { min-height: 560px; }
  .demo-vessel { left: 60%; transform: translate(-50%, -50%) scale(.78); }
  .demo-caption { right: 2%; }
  .demo-caption b { max-width: 190px; text-align: right; }
  .chapter-tab { padding: 6px; }
}

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