:root {
  color-scheme: light;
  --paper: #f6f3e9;
  --ink: #273f38;
  --green: #39594c;
  --muted: #586b5d;
  --line: #cfcebe;
  --accent: #923e38;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .2em; }
button, select, input { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #a56526; outline-offset: 4px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; padding: .8rem max(5vw, calc((100vw - 1216px) / 2)); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: .87rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; white-space: nowrap; }
.brand-seal { color: #78804b; border: 1px solid #a0a37b; padding: .1rem .35rem; font: 1.65rem/1.1 serif; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1.4rem; }
nav a { text-decoration: none; color: var(--muted); font-size: .91rem; }
nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: #ad8855; text-decoration-thickness: 2px; text-underline-offset: .7rem; }
main { max-width: 1320px; margin: auto; padding: 0 clamp(1.1rem, 5vw, 3.25rem); }
.intro { display: grid; grid-template-columns: 1fr minmax(200px, 36%); align-items: stretch; margin-top: clamp(1.5rem, 4vw, 3.5rem); background: #354e46; color: #fff5d9; border-radius: .65rem; overflow: hidden; }
.intro > div { padding: clamp(1.5rem, 4.3vw, 3.5rem); align-self: center; }
h1,h2,h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1.03; letter-spacing: -.045em; margin: 0 0 .75rem; }
.intro p { max-width: 33rem; margin: 0; font-size: clamp(.98rem, 1.5vw, 1.13rem); color: #e2e5cc; }
.cover { display: block; position: relative; }
.cover img { width: 100%; height: 100%; position: absolute; object-fit: cover; object-position: 40% 36%; }
.guide { margin: .9rem 0 2rem; color: var(--muted); font-size: .88rem; }
.guide summary { width: fit-content; }
.guide p { max-width: 75ch; }
.source-links { display: flex; gap: .5rem 1rem; flex-wrap: wrap; }
.controls { display: grid; grid-template-columns: minmax(180px, 1fr) 10rem 10rem; gap: .8rem; }
.controls label { display: grid; gap: .35rem; font-size: .81rem; font-weight: 650; }
.controls input,.controls select { min-height: 44px; width: 100%; padding: .55rem .8rem; border: 1px solid #b4bcaa; border-radius: .35rem; background: #fffdf5; font-size: .99rem; font-weight: 400; }
.index-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.45rem 0 1rem; }
.segments { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.segments button, .empty button { background: transparent; padding: .45rem .86rem; border: 1px solid var(--line); border-radius: 2rem; font-size: .88rem; }
.segments button[aria-pressed="true"] { color: #fff; background: var(--green); border-color: var(--green); }
#status { margin: 0; color: var(--muted); font-size: .86rem; text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(225px,100%),1fr)); gap: 1rem; align-items: start; }
.card { min-width: 0; border: 1px solid var(--line); background: #fffdf5; border-radius: .5rem; overflow: hidden; height: 100%; }
.card > a { display: grid; text-decoration: none; color: inherit; height: 100%; align-content: start; }
.card img { width: 100%; aspect-ratio: 1.85; display: block; object-fit: cover; object-position: center 35%; background: #e4e2d7; }
.card img.chart-portrait { object-fit: contain; padding: .35rem; background: #eae6d8; }
.card > a:hover .name,.credits a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.card .text { padding: .94rem 1.03rem 1.07rem; display: grid; gap: .3rem; }
.name { font: 1.5rem/1.15 Georgia, serif; }
.group { font-size: .76rem; color: var(--accent); }
.card .blurb { font-size: .87rem; line-height: 1.45; color: var(--muted); }
.list-heading { margin: 2.3rem 0 .8rem; font-size: 1.5rem; }
.credits { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(255px,100%),1fr)); gap: 0 1.3rem; padding: 0; margin: 0; list-style: none; }
.credits a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.credits small { display: block; margin-top: .2rem; font-weight: 450; color: var(--muted); }
.empty { padding: 2rem; border: 1px dashed var(--line); text-align: center; }
.empty p { margin-top: 0; }
footer { display: flex; justify-content: space-between; gap: .6rem 2rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 1.6rem 0 2.5rem; margin-top: 4rem; font-size: .8rem; color: var(--muted); }
dialog { width: min(555px,calc(100vw - 2rem)); max-height: min(88vh,55rem); border: 1px solid #7a8472; border-radius: .6rem; padding: 0; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(20 34 30 / .72); }
.close { position: sticky; display: block; float: right; top: .65rem; margin: .65rem .65rem -3.3rem 0; z-index: 2; width: 2.3rem; height: 2.3rem; padding: 0; border: 1px solid #c6cab8; border-radius: 50%; background: #fffdf4; color: var(--ink); font-size: 1.5rem; line-height: 1; }
.profile-image { margin: 0; }
.profile-image img { display: block; width: 100%; max-height: 310px; object-fit: contain; background: #e0e1d4; }
.profile-image figcaption { margin: .25rem 1.3rem; color: var(--muted); font-size: .76rem; }
.profile-text { padding: 1.3rem 1.55rem 1.7rem; }
.profile-text h2 { margin: .25rem 2.2rem .7rem 0; font-size: 2.25rem; line-height: 1.1; }
.profile-text h3 { margin: 1.15rem 0 .25rem; font: 650 .84rem/1.35 system-ui,sans-serif; }
.profile-text p { margin: .35rem 0; }
.profile-text .detail { font-size: .89rem; color: var(--muted); overflow-wrap: anywhere; }
.profile-text .sources { display: grid; gap: .2rem; margin-top: .4rem; font-size: .84rem; }
@media (max-width: 640px) {
  .masthead { flex-wrap: wrap; gap: .7rem; padding: .85rem 1.1rem; }
  nav { gap: .95rem; }
  .intro { grid-template-columns: 1fr; }
  .cover { height: 130px; }
  .controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-label { grid-column: 1/-1; }
  .index-bar { align-items: start; flex-direction: column; gap: .6rem; }
  .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .card .text { padding: .65rem; }
  .name { font-size: 1.25rem; }
  .card .blurb { font-size: .8rem; }
}
@media (max-width: 350px) { .gallery { grid-template-columns: 1fr; } }

.card:has(.card-model) { position: relative; padding-bottom: 2.65rem; }
.card > .card-model { position: absolute; bottom: .7rem; left: 1rem; display: inline; height: auto; color: var(--green); font-size: .82rem; text-decoration: underline; }
.open-model { display: inline-block; padding: .45rem .9rem; margin: .12rem 0 .7rem; color: #fffaf0; background: var(--green); text-decoration: none; border-radius: .3rem; }
dialog.has-model { width: min(915px, calc(100vw - 1.6rem)); max-height: 92dvh; }
.pose-heading { padding: 1.1rem 3.4rem .9rem 1.4rem; }
.pose-heading h2 { margin: .12rem 0 .24rem; font-size: 2.1rem; line-height: 1; }
.pose-heading a { font-size: .83rem; }
.pose-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 30%); border-top: 1px solid var(--line); }
.pose-stage { position: relative; overflow: hidden; min-width: 0; height: clamp(350px,62dvh,620px); background: radial-gradient(ellipse at 44% 38%,#fffae9 3%,#e8e8d7 53%,#bac7b7); }
.pose-stage canvas { touch-action: none; width: 100%; height: 100%; display: block; cursor: grab; }
.pose-stage canvas:active { cursor: grabbing; }
.pose-tools { position: absolute; bottom: .65rem; left: .65rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.pose-tools button,.pose-presets button { padding: .35rem .66rem; border: 1px solid #aeb9a6; border-radius: 1.2rem; color: #354c40; background: #fffcf0e8; font-size: .79rem; }
.pose-tools button[aria-pressed=true], .pose-presets button[aria-pressed=true] { background: var(--green); color: white; }
.pose-editor { padding: 1.05rem 1.18rem; align-self: start; }
.pose-editor h3 { font-size: 1.45rem; margin: 0 0 .45rem; }
.pose-presets { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.pose-joint { display: grid; gap: .2rem; font-size: .83rem; }
.pose-joint select { max-width: 100%; padding: .42rem; background: #fffdf4; border-radius: .3rem; border: 1px solid #aeb9a6; }
.pose-axis { display: grid; grid-template-columns: 1fr auto; margin: .72rem 0; font-size: .81rem; }
.pose-axis output { font-variant-numeric: tabular-nums; }
.pose-axis input { grid-column: 1/-1; width: 100%; margin: .25rem 0; accent-color: var(--green); }
.pose-help { font-size: .79rem; line-height: 1.45; color: var(--muted); }
.pose-pins { position: absolute; inset: 0; pointer-events: none; }
.pose-pins button { position: absolute; transform: translate(-50%,-50%); width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff8df; background: #3a6559; box-shadow: 0 0 0 1px #365348; pointer-events: auto; padding: 0; }
.pose-pins button.selected { background: #b34b36; }
.pose-axis[hidden], .pose-pins[hidden], .pose-pins button[hidden] { display: none; }
@media (max-width: 650px) {
  .pose-layout { grid-template-columns: minmax(0,1fr); }
  .pose-stage { height: clamp(275px,44dvh,425px); }
  .pose-editor { width: 100%; }
  .pose-editor .pose-presets { margin-bottom: .55rem; }
}
.pose-pins button { touch-action: none; cursor: move; }
.pose-render { position: absolute; inset: 0; }
.pose-frame { position: absolute; inset: 0 50% 0 0; overflow: hidden; margin: 0; }
.pose-frame img { display: block; height: 100%; width: 100%; object-fit: cover; object-position: 46.8% center; }
.pose-frame a, .pose-stage.is-comparing .pose-render::after { position: absolute; top: .5rem; left: .5rem; border-radius: 3px; padding: .17rem .4rem; font: .72rem/1.3 system-ui,sans-serif; background: #fffbeaeb; color: #334439; }
.pose-stage.is-comparing .pose-render { left: 50%; border-left: 1px solid #9d9d85; }
.pose-stage.is-comparing .pose-render::after { content: "3D-модель"; pointer-events: none; }
.pose-lighting { margin-bottom: .95rem; }
.pose-motion { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .4rem; margin-bottom: .85rem; }
.pose-motion select { width: 100%; }
.pose-motion button { min-height: 2.05rem; padding: .3rem .58rem; color: var(--green); font-size: .79rem; font-weight: 600; border: 1px solid #aeb9a6; border-radius: .3rem; background: #faf8e9; }
.pose-motion button:hover { background: #e1e8da; }

.pose-heading a + a { margin-left: 1.1rem; }
