/* Общая основа всех страниц demo.craftgen.app. Цвета компании — переменные из theme.<hash>.css.
   Раскладка — только по ширине: @media (--phone|--tablet|--desktop|--wide) подставляет build.mjs (src/config.mjs). */
:root {
  --bg: #ffffff; --surface: #f3f2ee; --ink: #16201f; --muted: #55605e; --line: #dcdedb;
  --c1: #0e6e6a; --c1-ink: #fff; --c1-text: #0e6e6a; --c1-soft: #e7f1f0; --btn: #0e6e6a; --btn-ink: #fff;
  --c2: #173c3a; --c2-ink: #fff; --acc: #e8b13c; --acc-ink: #141414;
  --radius: 10px; --radius-lg: 20px;
  --body-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --head-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --head-weight: 700;
  --nav-tt: none; --nav-ls: 0;
  --banner-bg: #111; --banner-ink: #f4f4f4;
  --gut: 16px; --max: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body-font); overflow-wrap: break-word; }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--head-font); font-weight: var(--head-weight); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.1rem + 3vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--c1-text); text-underline-offset: .15em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--c1-text); margin-bottom: .6em; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: var(--radius);
  background: var(--btn); color: var(--btn-ink); font: 600 1rem/1.2 var(--body-font); text-decoration: none; border: 2px solid var(--btn); cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--c1-text); border-color: currentColor; }
.btn-big { min-height: 56px; font-size: 1.1rem; padding: 12px 28px; }

/* языки */
.langs { display: flex; gap: 2px; flex-shrink: 0; }
.langs a { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 8px; border-radius: 8px;
  font: 700 .8rem/1 var(--body-font); color: inherit; text-decoration: none; opacity: .85; }
.langs a[aria-current] { background: rgba(127,127,127,.22); opacity: 1; }

/* листы: 3D и QR. Явные строки сетки — Safari (L-032) */
dialog.sheet { border: 0; padding: 0; width: min(920px, 100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  border-radius: var(--radius-lg); background: var(--bg); color: var(--ink); display: none; grid-template-rows: auto 1fr auto; }
dialog.sheet[open] { display: grid; }
dialog.sheet::backdrop { background: rgba(10, 12, 12, .55); }
.sheet-sm { width: min(420px, 100vw - 32px); }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 8px 20px; }
.sheet-hd h2 { font-size: 1.1rem; margin: 0; }
.x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.sheet-body { padding: 0 12px; min-height: 0; overflow: auto; }
.sheet-hint { padding: 8px 20px 16px; margin: 0; font-size: .88rem; color: var(--muted); }
.qr { display: grid; place-items: center; padding: 8px 20px; }
.qr svg { width: 200px; height: 200px; }

/* подвал */
.ft { background: var(--c2); color: var(--c2-ink); margin-top: 48px; }
.ft-in { max-width: var(--max); margin: 0 auto; padding: 28px var(--gut) 32px; font-size: .9rem; }
.ft a { color: inherit; }
.ft-brand { font: 800 1.1rem/1 var(--head-font); }

/* корень и 404 */
.root main { max-width: 480px; margin: 18vh auto; padding: 0 var(--gut); }
.root ul { list-style: none; padding: 0; }
.root li a { display: inline-flex; min-height: 44px; align-items: center; font-size: 1.1rem; }

@media (min-width: 761px) and (min-height: 501px), (min-width: 761px) and (pointer: fine) { :root { --gut: 32px; } }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; }
}
