/* 青铜司历案 — existing artwork is split into working rings; no new raster dependencies. */
:root {
  --graphite:#141714; --graphite-warm:#1c211b; --paper-dark:#20241e; --paper-elev:#262c24;
  --ink:#f0e6d1; --ink-soft:#e4d8bd; --muted:#c0b7a2;
  --metal:#b58a54; --metal-light:#efce98; --patina:#54776d;
  --cinnabar:#a84d3c; --seal-light:#efa58f; --reading-paper:#eadfc9;
  --line:#b58a5455; --line-strong:#b58a5490;
  --serif:"Songti SC","Noto Serif CJK SC","Noto Serif SC",STSong,SimSun,Georgia,serif;
  --sans:"DM Sans Local","PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
}
body { background:var(--graphite); }
.masthead { background:#141714f5; border-color:var(--line); }
.brand-seal { background:#35221e; border-color:#c37563; color:#f9ccba; }
.first-visit-opening {
  background:
    radial-gradient(ellipse at 73% 39%,#47655b44,transparent 37%),
    radial-gradient(ellipse at 65% 43%,#503a25aa,transparent 65%),
    #141714;
}
.bronze-kicker,.bronze-plate-label {
  color:var(--metal-light); font:600 .76rem/1.5 var(--sans); letter-spacing:.15em;
  text-transform:uppercase;
}
.bronze-kicker { display:flex; gap:.65rem; align-items:center; justify-content:center; margin-bottom:16px; }
.bronze-kicker::before { content:""; width:28px; height:1px; background:var(--metal); }
.first-visit-opening h1 span { background:none; color:#edcb91; }
.first-visit-opening #opening-intro { color:var(--ink-soft); font-size:clamp(1rem,1.4vw,1.15rem); }
.first-visit-opening .opening-engine { color:var(--muted); }
#first-visit .first-visit-direct textarea {
  background:linear-gradient(150deg,#29302a80,#181b17);
  border:1px solid #b58a5499; color:var(--ink); padding:12px 14px;
}
#first-visit .first-visit-direct textarea::placeholder { color:#bab29f; opacity:1; }
body[data-desk-view="home"] .instrument {
  --dial-size:clamp(246px,41vw,480px);
  min-height:calc(var(--dial-size) + 50px);
  align-self:center;
}
.bronze-plate-label {
  position:absolute; top:calc(var(--dial-size) + 17px); left:50%; translate:-50% 0;
  white-space:nowrap; padding-inline:14px; border-inline:1px solid var(--line-strong);
}
body:not([data-desk-view="home"]) .bronze-plate-label { display:none; }
.instrument::after {
  animation:none; background:repeating-conic-gradient(from -.6deg,#e0b97a9c 0 1.15deg,transparent 1.15deg 15deg);
}
body[data-desk-view="home"] .dial-outer .dial-face { animation:none; }
body[data-desk-view="home"] .dial-trigrams .dial-face { animation:bronze-index-in .82s cubic-bezier(.22,.74,.26,1) both; }
body[data-desk-view="home"] .dial-hours .dial-face { animation:bronze-inner-in .82s cubic-bezier(.22,.74,.26,1) both; }
body[data-desk-view="home"] .dial-light { animation:bronze-gleam .92s ease-out both; }
@keyframes bronze-index-in { from { transform:rotate(-15deg); } to { transform:rotate(0); } }
@keyframes bronze-inner-in { from { transform:rotate(10deg); } to { transform:rotate(0); } }
@keyframes bronze-gleam { from { transform:rotate(-36deg); opacity:0; } 46% { opacity:.47; } to { transform:rotate(8deg); opacity:.13; } }
body[data-ambient-paused] .dial-light,.instrument[data-ambient-outside] .dial-light { animation-play-state:paused; }
.instrument .open-chart strong {
  min-height:44px; display:grid; place-items:center; top:78%;
  padding:6px 21px; border:1px solid #e2bc81; border-radius:2px;
  background:linear-gradient(#342e22,#201d17); color:#ffeecc;
  box-shadow:0 0 0 3px #171811c0,inset 0 0 0 2px #78603c60,0 7px 16px #0b0907;
}
.instrument .open-chart:is(:hover,:focus-visible) strong { color:#241b12; background:#e6bc80; }
#chart .chart-panel { --shell-image:url("/desk/assets/tortoise-scute.webp"); }
body[data-desk-view="chart"] .instrument { --panel-width:min(calc(100vw - 32px),590px); }
#chart[data-state="open"] .dial-seat { opacity:.76; }
.chart-heading-row { border-bottom:1px solid var(--line); padding-bottom:8px; margin-bottom:18px; }
.chart-heading-row h2 { font-family:var(--serif); }
.chart-fields { gap:16px 18px; }
.chart-fields :is(legend,.birth-place > span) { color:var(--ink-soft); font:600 .88rem/1.5 var(--sans); margin-bottom:7px; }
.birth-reels { gap:7px; }
.birth-reel { min-height:48px; }
.birth-reel::before,.birth-reel::after { display:none; }
.birth-reel .reel-value { visibility:hidden; }
#chart-form .birth-reel select,#chart-form .birth-place select {
  appearance:none; opacity:1; min-height:48px; padding:0 22px 0 9px;
  border:1px solid #a7845b !important; border-radius:2px !important;
  color:var(--ink); background-color:#20241e !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23efce98' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size:12px; background-position:right 6px center; background-repeat:no-repeat;
  text-shadow:none; font:500 1rem/1.1 var(--sans); font-variant-numeric:tabular-nums;
}
#chart-form select option { background:#20241e; color:var(--ink); }
#chart-form .birth-reel:has(select:focus-visible) { outline:none; border-radius:2px; }
#chart-form select:focus-visible { outline:2px solid #f0ce97; outline-offset:3px; }
#chart-form[aria-busy="true"] .birth-reel::before { display:block; }
#chart-form[aria-busy="true"] .birth-reel select { opacity:0; }
#chart-form[aria-busy="true"] .birth-reel .reel-value { visibility:visible; }
.chart-submit { gap:8px 16px; margin-top:18px; }
#chart .cast-chart {
  min-height:48px; padding:6px 18px; color:#21180d; text-shadow:none;
  border:1px solid #e9c589; border-radius:2px; background:linear-gradient(#edcc91,#c59b61); font-family:var(--sans);
}
#chart .cast-chart:hover { background:#f0d3a1; }
#chart .cast-chart span:last-child { border:0; }
#chart .cast-chart .shell-mark { display:none; }
#chart .chart-support { font-size:.87rem; color:var(--muted); gap:4px 12px; }
#chart #your-slips { gap:5px; }
#your-slips .slip { min-width:0; min-height:84px; border:1px solid var(--line); background:#242820; }
#your-slips .slip strong { font-family:var(--serif); }
#your-slips .slip[aria-pressed="true"] { border-color:#db907e; background:#3b2521; box-shadow:inset 0 -3px 0 #bf6a57; }
#chart-note {
  margin:10px 0 18px; padding:8px 12px; border-inline-start:2px solid #829f90;
  background:#29423952; color:#eadfca; font-size:.89rem; text-align:start;
}
#chart-note[data-comparison="different"] { background:#502b245c; border-color:#ed927c; }
#pillar-reader .ag-ritual-reader { display:grid; grid-template-columns:136px minmax(0,1fr); gap:6px 16px; align-items:center; }
#pillar-reader .ag-ritual-guide { grid-column:1 / -1; text-align:start; margin:0; color:var(--muted); }
#pillar-reader .ag-ritual-stage { margin:0; display:grid; grid-template-columns:1fr; }
#pillar-reader .ag-ritual-stop { display:none; } /* Four labelled, keyboard-focusable slips above select the same stops. */
#pillar-reader .ag-ritual-dial { grid-area:1/1; width:min(100%,122px); justify-self:center; }
#pillar-reader .ag-ritual-strip {
  border-radius:2px; min-height:81px; align-self:center; padding:11px 13px;
  background:linear-gradient(120deg,#f3e8d3,var(--reading-paper));
}
#pillar-reader .ag-ritual-note { color:#362a22; font-size:.88rem; line-height:1.55; }
#pillar-reader .ag-ritual-tag { color:#833e30; font-size:.82rem; }
@media (min-width:900px) {
  body[data-desk-view="home"] .first-visit-opening {
    display:grid; grid-template-columns:minmax(0,500px) minmax(0,550px);
    grid-template-rows:minmax(550px,calc(100svh - 160px)) auto;
    gap:32px clamp(32px,6vw,96px); padding-inline:clamp(38px,5vw,84px);
    justify-content:center; align-items:center;
  }
  body[data-desk-view="home"] .first-visit-opening > .opening-copy { width:100%; padding-inline:0; text-align:start; }
  body[data-desk-view="home"] .opening-copy > p, body[data-desk-view="home"] #first-visit { margin-inline:0; }
  body[data-desk-view="home"] .bronze-kicker { justify-content:flex-start; }
  body[data-desk-view="home"] .instrument { width:100%; margin-top:0; }
  body[data-desk-view="home"] .agd-direct-tray { grid-column:1/-1; }
}
@media (max-width:620px) {
  body[data-desk-view="home"] .first-visit-opening { padding-top:28px; padding-bottom:32px; }
  body[data-desk-view="home"] .opening-copy { text-align:start; }
  .bronze-kicker { justify-content:flex-start; margin-bottom:10px; }
  .first-visit-opening h1 { font-size:clamp(33px,8.5vw,48px); }
  .first-visit-opening #opening-intro { margin:11px 0 0; }
  .first-visit-opening .opening-engine { margin:5px 0 0; }
  .first-visit-opening #first-visit { margin-top:16px; }
  #first-visit .first-visit-direct textarea { min-height:66px; }
  body[data-desk-view="chart"] .instrument { --panel-width:min(calc(100% - 4px),550px); width:100%; margin-top:0; }
  body[data-desk-view="chart"] #top { padding-top:12px; }
  #chart[data-state="open"] .dial-seat { opacity:.34; }
  #chart .chart-panel { padding:14px max(16px,5vw); }
  .chart-fields { grid-template-columns:1fr; gap:11px; }
  .birth-time .birth-reels { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #pillar-reader .ag-ritual-reader { grid-template-columns:min(92px,29%) minmax(0,1fr); gap:6px 8px; }
  #pillar-reader .ag-ritual-strip { gap:7px; padding:8px; }
  #pillar-reader .ag-ritual-glyph { min-width:0; font-size:17px; padding-right:7px; }
  #your-slips .slip { min-height:68px; }
}
@media (prefers-reduced-motion:reduce) {
  .instrument :is(.dial-face,.dial-light),.instrument::after { animation:none !important; transition:none !important; }
}

/* Keep the reading folio wide enough and the split bronze outside mobile controls. */
#pillar-reader .ag-ritual-reader { max-width:none; margin-inline:0; }
@media (max-width:620px) {
  body[data-desk-view="chart"] .instrument { --panel-width:min(calc(100vw - 12px),550px); }
  #chart[data-state="open"] .chart-panel { position:relative; z-index:3; }
  #chart[data-state="open"] .dial-seat { opacity:.23; }
  #chart-result .agd-whisper-chips { flex-wrap:wrap; overflow:visible; }
}

/* Site-specific engraving marks: seal, solar track, moon cloud, year wheel. */
.agd-direct-card[data-agd-topic="names"] { --bronze-glyph:url("/desk/assets/glyphs/names.svg"); --glyph-color:#e99c86; }
.agd-direct-card[data-agd-topic="dates"] { --bronze-glyph:url("/desk/assets/glyphs/dates.svg"); --glyph-color:#e6c18b; }
.agd-direct-card[data-agd-topic="dreams"] { --bronze-glyph:url("/desk/assets/glyphs/dreams.svg"); --glyph-color:#c4d7cc; }
.agd-direct-card[data-agd-topic="years"] { --bronze-glyph:url("/desk/assets/glyphs/years.svg"); --glyph-color:#e6c18b; }
.agd-direct-card .agd-seal-tag {
  box-sizing:border-box; display:grid; place-items:center; width:46px; height:46px;
  min-width:46px; padding:0; font-size:0; color:var(--glyph-color);
  border:1px solid #b58a547d; background:#17211e; box-shadow:inset 0 0 0 2px #131713;
}
.agd-direct-card .agd-seal-tag::after {
  content:""; grid-area:1/1; width:34px; height:34px; background:currentColor;
  -webkit-mask:var(--bronze-glyph) center / contain no-repeat;
  mask:var(--bronze-glyph) center / contain no-repeat;
  transition:transform 280ms cubic-bezier(.17,.8,.26,1);
}
.agd-direct-card:is(:hover,:focus-visible) .agd-seal-tag::after { transform:translateY(-2px); }
@media (max-width:640px) {
  :lang(en) .agd-direct-card { grid-template-columns:auto minmax(0,1fr); grid-template-areas:"seal title" "sub sub"; }
  :lang(en) .agd-direct-card .agd-seal-tag { display:grid; }
  .agd-direct-card .agd-seal-tag { width:36px; min-width:36px; height:36px; }
  .agd-direct-card .agd-seal-tag::after { width:28px; height:28px; }
}
@media (prefers-reduced-motion:reduce) {
  .agd-direct-card .agd-seal-tag::after { transition:none; transform:none !important; }
}
