/* Токены ENBOM (site/src/styles/global.css :root): песок, чернила, барвинок; Cormorant Garamond + Inter.
   Ни скруглений, ни теней, ни капса, ни градиентов. */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/cormorant-regular.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/cormorant-italic.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/inter-regular.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/inter-medium.woff2) format('woff2'); }

:root {
  --paper: #f2ede0; --paper-deep: #e8e0cd; --ink: #13202f;
  --ink-soft: rgba(19, 32, 47, .75); --ink-faint: rgba(19, 32, 47, .65);
  --accent: #4a5f9c; --gold: #b2894a;
  --line: rgba(74, 95, 156, .22); --line-strong: rgba(74, 95, 156, .4);
  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --edge: 20px;
}
* { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.6 var(--ui); }
button { font: inherit; color: inherit; }

.g { padding: 28px var(--edge) 48px; max-width: 1600px; margin: 0 auto; }
.g-head h1 { margin: 0 0 18px; font: 300 clamp(38px, 6vw, 72px)/1 var(--display); letter-spacing: -.01em; }

.g-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 6px; min-height: 32px; }
.g-name { font: 400 clamp(26px, 3.2vw, 36px)/1.1 var(--display); }
.g-group { font-size: 13px; color: var(--ink-faint); }
.g-note { margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-faint); }

/* ---- выбор золота и камня: стили из Select.astro и Viewer3D.astro ---- */
.v3d { --v3d-ink: var(--ink); width: 100%; color: var(--ink); font: 400 15px/1.4 var(--ui); }
.v3d [hidden] { display: none !important; }
.v3d--side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.v3d-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 72svh; min-height: 280px; overflow: hidden; background: var(--paper-deep); }
.v3d-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; outline-offset: -2px; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-stage canvas:focus-visible { outline: 2px solid var(--accent); }
.v3d-status { position: absolute; left: 0; right: 0; top: 50%; margin: 0; text-align: center; font-size: 14px; color: var(--ink-soft); pointer-events: none; }
.v3d-hint { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font-size: 13px; color: var(--ink-faint); pointer-events: none; opacity: 0; transition: opacity .6s var(--ease); }
.v3d[data-ready]:not([data-touched]) .v3d-hint { opacity: 1; }
.v3d-side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; --select-bg: var(--paper); --select-fg: var(--ink); }
@media (max-width: 520px) { .v3d-side { grid-template-columns: 1fr; gap: 14px; } }

.c-select { position: relative; min-width: 0; }
.c-select__label { display: block; margin-bottom: 2px; font-size: 13px; line-height: 1.3; color: var(--ink-faint); }
.c-select__row { display: flex; align-items: stretch; }
.c-select__btn { position: relative; display: block; flex: 1; min-width: 0; width: 100%; min-height: 48px; padding: 8px 26px; text-align: center; font-size: 15px; line-height: 1.3; color: inherit;
  background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; }
.c-select__btn::after { content: ''; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px; margin-top: -7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease), margin-top .3s var(--ease); }
.c-select.is-open .c-select__btn::after { transform: rotate(225deg); margin-top: -2px; }
.c-select__btn:hover, .c-select.is-open .c-select__btn { border-bottom-color: var(--gold); }
.c-select__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.c-select__drop { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 100%; width: max-content; max-width: min(88vw, 360px); background: var(--select-bg); color: var(--select-fg);
  border: 1px solid var(--line-strong); border-top: 0; clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .5s cubic-bezier(.65, .05, .36, 1), visibility 0s .5s; }
.c-select.is-open .c-select__drop { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .5s cubic-bezier(.65, .05, .36, 1), visibility 0s; }
.c-select.is-up .c-select__drop { top: auto; bottom: 100%; border-top: 1px solid var(--line-strong); border-bottom: 0; clip-path: inset(100% 0 0 0); }
.c-select.is-up.is-open .c-select__drop { clip-path: inset(0 0 0 0); }
.c-select__list { margin: 0; padding: 4px 0; list-style: none; max-height: min(52svh, 420px); overflow-y: auto; outline: 0; }
.c-select__list li { min-height: 44px; display: flex; align-items: center; padding: 6px 16px; font-size: 15px; line-height: 1.3; cursor: pointer; }
.c-select__list li.is-active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.c-select__list li[aria-selected='true'] { font-weight: 500; }
.c-select__sw { display: inline-block; flex: none; width: 12px; height: 12px; margin-right: 10px; clip-path: circle(50%); vertical-align: -1px; outline: 1px solid rgba(0, 0, 0, .22); outline-offset: -1px; }
.c-select__btn .c-select__sw { margin-right: 8px; }
.c-select__arrow { position: relative; flex: none; width: 44px; min-height: 48px; padding: 0; background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; }
.c-select__arrow::before { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -5px 0 0 -3px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease); }
.c-select__arrow--next::before { margin-left: -7px; transform: rotate(-135deg); }
.c-select__arrow--prev:hover::before { transform: translateX(-3px) rotate(45deg); }
.c-select__arrow--next:hover::before { transform: translateX(3px) rotate(-135deg); }
.c-select__arrow:hover { border-bottom-color: var(--gold); }
.c-select__arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- список моделей ---- */
.g-list { margin-top: 36px; }
.g-tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab { flex: none; min-height: 44px; padding: 0; background: none; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.g-tab[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }
.g-tab:focus-visible, .g-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.g-tile { display: block; width: 100%; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; }
.g-tile img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: var(--paper-deep); border: 1px solid transparent; }
.g-tile span { display: block; margin-top: 6px; padding-bottom: 4px; font-size: 13px; line-height: 1.35; color: var(--ink-soft); border-bottom: 1px solid transparent; }
.g-tile[aria-current='true'] img { border-color: var(--line-strong); }
.g-tile[aria-current='true'] span { color: var(--ink); border-bottom-color: var(--ink); }

@media (min-width: 1000px) {
  :root { --edge: 40px; }
  .g { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: 'head head' 'view list'; column-gap: clamp(32px, 4vw, 72px); align-items: start; }
  .g-head { grid-area: head; }
  .g-view { grid-area: view; position: sticky; top: 24px; }
  .g-list { grid-area: list; margin-top: 44px; }
  .v3d-stage { aspect-ratio: 4 / 3; max-height: calc(100svh - 250px); }
  .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 1400px) { .g-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- режим миниатюры (?thumb=slug): только сцена, прозрачный фон ---- */
html[data-thumb], html[data-thumb] body { background: transparent; }
html[data-thumb] .g { padding: 0; max-width: none; display: block; }
html[data-thumb] .g-head, html[data-thumb] .g-cap, html[data-thumb] .g-note, html[data-thumb] .g-list, html[data-thumb] .v3d-side, html[data-thumb] .v3d-hint, html[data-thumb] .v3d-status { display: none; }
html[data-thumb] .g-view { position: static; }
html[data-thumb] .v3d-stage { width: 480px; height: 480px; max-height: none; aspect-ratio: auto; background: transparent; }
@media (prefers-reduced-motion: reduce) { .v3d-hint, .c-select__btn::after, .c-select__arrow::before, .c-select__drop { transition: none; } }
