/* Lexory — стили сайта. Токены — docs/Site/TZ_SITE_B_design.md §2. Без JS. */
:root {
  --bg: #FAF7F0; --surface: #FFFFFF; --paper: #F3EDDF;
  --text: #1C1A17; --text-muted: #5E584E;
  --accent: #B1520E; --link: #9A4509; --on-accent: #FFFFFF;
  --border: #E3DCCD; --border-strong: #7F776A; --focus: #B1520E;
  --navy: #0B1F5C; --navy-2: #01329B; --navy-3: #06143D; --on-navy: #FFFFFF; --on-navy-muted: #C9D2F0; --gold: #D9A441;
  --frame: #1C1C1E; --frame-edge: #3A3A3C; --shadow: 0 18px 40px -18px rgba(12, 20, 60, .45);
  --radius: 14px; --wrap: 75rem; --narrow: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414; --surface: #1C1C1E; --paper: #26231F;
    --text: #ECE6DA; --text-muted: #A9A295;
    --accent: #E8833A; --link: #F0A05E; --on-accent: #141414;
    --border: #2E2C29; --border-strong: #7A746B; --focus: #E8833A;
    --navy: #0B1F5C; --navy-2: #0B1F5C; --navy-3: #06143D; --gold: #E0B457;
    --frame: #26262A; --frame-edge: #45454A; --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(16px, 0.95rem + 0.2vw, 17px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.55; hyphens: auto; -webkit-hyphens: auto;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; text-wrap: balance; hyphens: manual; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.625rem, 1.3rem + 1vw, 1.875rem); font-weight: 700; max-width: 28ch; }
h3 { font-size: 1.25rem; font-weight: 600; }
p, ul, ol { margin: 0 0 1em; }
.muted { color: var(--text-muted); }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: var(--narrow); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { top: 1rem; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 600px) { .wrap { padding-inline: 24px; } }
@media (min-width: 900px) { .wrap { padding-inline: 32px; } }
.narrow { max-width: calc(var(--narrow) + 64px); }
.section { padding-block: 48px; }
@media (min-width: 600px) { .section { padding-block: 64px; } }
@media (min-width: 900px) { .section { padding-block: 96px; } }
.section--paper { background: var(--paper); }
.section__title { margin-bottom: 1.5em; }
.page { max-width: calc(var(--narrow) + 64px); margin-inline: auto; padding: 32px 16px 64px; }
.page__head { margin-bottom: 1.5rem; }
.prose { max-width: var(--narrow); }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.prose th, .prose td, .keys th, .keys td { text-align: left; padding: .5em .75em; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--paper); padding: .1em .35em; border-radius: 4px; }

/* Шапка */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header--dark { background: var(--navy-2); border-bottom: 0; color: var(--on-navy); }
.site-header__row { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; min-height: 44px; }
.site-nav { display: flex; gap: 0 18px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; margin-inline-start: auto; order: 3; width: 100%; padding-bottom: 4px; font-size: .9375rem; -webkit-overflow-scrolling: touch; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: inherit; text-decoration: none; padding: 8px 0; display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-underline-offset: .3em; color: inherit; }
.site-header--dark .site-nav a:hover { color: var(--on-navy); }
@media (min-width: 900px) { .site-nav { order: 0; width: auto; padding: 0; margin-inline-start: auto; } }
.menu { position: relative; }
.dev { margin-inline-start: auto; }
@media (min-width: 900px) { .dev { margin-inline-start: 0; } }
.menu summary { list-style: none; cursor: pointer; gap: 6px; padding-inline: 8px; border: 1px solid transparent; border-radius: 8px; color: inherit; text-decoration: none; padding-block: 8px; display: inline-flex; align-items: center; min-height: 44px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { border-color: var(--border-strong); }
.menu__list { position: absolute; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); min-width: 11rem; z-index: 20; }
.menu__list a, .menu__list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 44px; text-decoration: none; color: var(--text); border-radius: 6px; cursor: pointer; }
.menu__list a { justify-content: space-between; }
.menu__list a:hover, .menu__list label:hover { background: var(--paper); }
.menu__list a[aria-current]::after { content: "✓"; color: var(--accent); }
.dev__label { font-size: .9375rem; }
@media (max-width: 599px) { .dev__label { display: none; } }
.dev__icon { display: none; }
.dev__icon--iphone { display: inline-flex; }
@media (min-width: 600px) { .dev__icon--iphone { display: none; } .dev__icon--ipad { display: inline-flex; } }
html:has(#device-iphone:checked) .dev__icon { display: none; } html:has(#device-iphone:checked) .dev__icon--iphone { display: inline-flex; }
html:has(#device-ipad:checked) .dev__icon { display: none; } html:has(#device-ipad:checked) .dev__icon--ipad { display: inline-flex; }
html:has(#device-mac:checked) .dev__icon { display: none; } html:has(#device-mac:checked) .dev__icon--mac { display: inline-flex; }
.dev__opt::after { content: ""; margin-inline-start: auto; }
html:has(#device-iphone:checked) .dev__opt--iphone::after,
html:has(#device-ipad:checked) .dev__opt--ipad::after,
html:has(#device-mac:checked) .dev__opt--mac::after { content: "✓"; color: var(--accent); }

/* Hero: текст по центру, ниже — MacBook, iPad и iPhone */
.hero { background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 55%, var(--navy-3) 100%); color: var(--on-navy); padding-block: 40px 0; overflow: hidden; }
@media (min-width: 900px) { .hero { padding-block: 64px 0; } }
.hero__text { text-align: center; max-width: 48rem; }
.hero__icon { width: clamp(88px, 6vw + 60px, 128px); height: auto; margin: 0 auto 20px; border-radius: 22.4%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 18px 40px -12px rgba(0,0,0,.6); }
.hero__title { font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem); line-height: 1.1; margin-bottom: .4em; max-width: none; }
.hero__title::after { content: ""; display: block; width: 56px; height: 3px; background: var(--gold); margin: .5em auto 0; border-radius: 2px; }
.hero__subtitle { font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem); line-height: 1.45; color: var(--on-navy-muted); max-width: 40rem; margin-inline: auto; }
.hero__cta { margin-top: 1.5rem; }
.hero__under { margin: .75rem 0 .25rem; }
.hero__devices { color: var(--on-navy-muted); font-size: .875rem; margin: 0 0 1rem; }
.hero__tagline { hyphens: manual; -webkit-hyphens: manual; text-wrap: balance; font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem); font-weight: 600; color: var(--on-navy); margin: 0 auto .5em; max-width: none; }
.nowrap { white-space: nowrap; }
.hero__offer { margin: .9rem 0 .2rem; font-weight: 600; color: var(--on-navy); }
.hero__price { margin: 0 0 .35rem; color: var(--on-navy-muted); font-size: .9375rem; }

/* Картинка первого экрана (готовое изображение автора: MacBook, iPad, iPhone с Lexory) */
.hero { padding-bottom: 48px; }
.hero__image { display: block; max-width: 1040px; margin: 16px auto 0; }
.hero__image img { width: 100%; height: auto; }

/* Бейдж App Store */
.badge { display: inline-block; line-height: 0; }
.badge img { height: 50px; width: auto; }
.badge:focus-visible { outline-offset: 4px; }

/* Переключатель устройства (без JS) */
.device-switch-inputs { border: 0; margin: 0; padding: 0; position: absolute; }
.device-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .875rem; }
.hero .device-switch { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: var(--on-navy); }
.device-switch__opt { padding: 8px 16px; min-height: 36px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; }
/* Рамки устройств */
.device { margin: 0; display: inline-block; max-width: 100%; }
.shot--iphone { width: min(70vw, 320px); }
.shot--ipad { width: min(92vw, 440px); }
.shot img, .shot video { width: 100%; height: auto; display: block; }
.shot--iphone picture, .shot--iphone video { display: block; border-radius: 11.5% / 5.3%; padding: 3.2%; background: var(--frame); box-shadow: inset 0 0 0 1px var(--frame-edge), var(--shadow); }
.shot--iphone img { border-radius: 9% / 4.2%; }
.shot--ipad picture, .shot--ipad video { display: block; border-radius: 5% / 3.75%; padding: 2.5%; background: var(--frame); box-shadow: inset 0 0 0 1px var(--frame-edge), var(--shadow); }
.shot--ipad img { border-radius: 2.5% / 1.9%; }
.device--hero .shot--iphone { width: min(62vw, 300px); }
.device--hero .shot--ipad { width: min(90vw, 480px); }
/* CarPlay (`frame: carplay`): снимок экрана машины 800 × 480 — широкий экран в тёмной рамке, без скруглений iPhone */
.device--carplay .shot--iphone { width: min(92vw, 480px); }
.device--carplay .shot--iphone picture { border-radius: 20px; padding: 12px; }
.device--carplay .shot--iphone img { border-radius: 10px; }

/* Сценарные блоки */
.feature-row { display: grid; gap: 24px; align-items: center; padding-block: 24px; }
.feature-row + .feature-row { padding-top: 40px; }
.feature-row__media { display: flex; justify-content: center; }
.feature-row__text { max-width: 34rem; }
@media (min-width: 900px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 40px; }
  .feature-row--flip .feature-row__text { order: 2; }
  .feature-row--flip .feature-row__media { order: 1; }
  .feature-row:has(.shot--ipad:not([style*="none"])) { grid-template-columns: 1fr 1.1fr; }
}
.more { font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }
.chips { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; font-size: .875rem; font-weight: 500; }
.list { padding-left: 1.2em; }
.list li, .ways li { margin-bottom: .4em; }
.ways { padding-left: 1.2em; }
.privacy-block .icon { color: var(--accent); margin-bottom: .75rem; }
.price .badge { margin-top: .5rem; }
.more-links { display: flex; flex-wrap: wrap; gap: .4em 1.4em; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.6em; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.privacy-block .checklist, .price .checklist { display: inline-block; text-align: left; }

/* Раздел «Возможности» */
.feature-page .page__head, .features-index .page__head { padding-top: 32px; }
.crumbs { font-size: .875rem; margin-bottom: .5rem; }
.crumbs a { text-decoration: none; color: var(--text-muted); }
.good-to-know { background: var(--paper); border-radius: var(--radius); padding: 24px; margin-block: 40px; }
.good-to-know h2 { font-size: 1.25rem; }
.good-to-know ul { margin: 0; padding-left: 1.2em; }
.good-to-know li { margin-bottom: .5em; }
.see-also h2 { font-size: 1.25rem; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards a { display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); height: 100%; }
.cards a:hover { border-color: var(--border-strong); }
.card h2 { font-size: 1.125rem; margin: .75rem 0 .25rem; }
.card p { color: var(--text-muted); font-size: .9375rem; margin: 0; }
.card__media .shot--iphone { width: min(50vw, 180px); margin-inline: auto; }
.card__media .shot--ipad { width: 100%; }
.cta { text-align: center; padding-block: 48px; }
.feature-row--text { grid-template-columns: 1fr; }
.feature-row--text .feature-row__text { max-width: var(--narrow); }
.chips--also li { border-color: var(--border); background: var(--surface); }
.also { padding-block: 24px; }
.keys { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.keys th { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; white-space: nowrap; }

/* FAQ */
.faq { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.0625rem; }
.faq summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform .2s; flex: none; margin-right: 4px; }
.faq[open] summary::after { transform: rotate(225deg); }
.faq__a { padding: 0 0 16px; color: var(--text); }
.faq__a p:last-child { margin-bottom: 0; }

/* Футер — компактная полоса */
.site-footer { background: var(--navy-3); color: var(--on-navy-muted); margin-top: 48px; font-size: .875rem; }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: .2em; }
.site-footer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 24px 16px; }
.site-footer .brand { font-size: 1.0625rem; min-height: 40px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 2px 16px; flex: 1 1 auto; }
@media (min-width: 900px) { .site-footer__row { display: grid; grid-template-columns: auto 1fr auto; } .site-footer__nav { justify-content: center; } }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--on-navy-muted); }
.site-footer__nav a:hover { color: var(--on-navy); }
.badge--footer img { height: 40px; width: auto; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: 12px 16px; font-size: .75rem; }
.site-footer__bottom p { margin: 0; opacity: .8; }

/* Движение */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* Видимость снимков по устройству — в конце файла, чтобы побеждать правила рамок.
   Авто (без скрипта): телефон — iPhone, шире — iPad. Mac — снимки iPad в окне macOS (на Mac Lexory — приложение iPad). */
.shot--ipad { display: none; }
@media (min-width: 600px) { .shot--iphone { display: none; } .shot--ipad { display: block; } }
html:has(#device-iphone:checked) .shot--iphone { display: block; }
html:has(#device-iphone:checked) .shot--ipad { display: none; }
html:has(#device-ipad:checked) .shot--ipad,
html:has(#device-mac:checked) .shot--ipad { display: block; }
html:has(#device-ipad:checked) .shot--iphone,
html:has(#device-mac:checked) .shot--iphone { display: none; }
/* Окно Mac: строка заголовка с тремя кнопками, тонкая рамка, без скругления экрана iPad */
html:has(#device-mac:checked) .shot--ipad picture,
html:has(#device-mac:checked) .shot--ipad video {
  border-radius: 12px; padding: 30px 0 0; background:
    radial-gradient(circle at 18px 15px, #FF5F57 5.5px, transparent 6px),
    radial-gradient(circle at 38px 15px, #FEBC2E 5.5px, transparent 6px),
    radial-gradient(circle at 58px 15px, #28C840 5.5px, transparent 6px),
    linear-gradient(#E9E7E3, #DEDBD6) top / 100% 30px no-repeat, #DEDBD6;
  box-shadow: 0 0 0 1px rgba(0,0,0,.18), var(--shadow);
}
html:has(#device-mac:checked) .shot--ipad img { border-radius: 0 0 11px 11px; }
@media (prefers-color-scheme: dark) {
  html:has(#device-mac:checked) .shot--ipad picture, html:has(#device-mac:checked) .shot--ipad video {
    background:
      radial-gradient(circle at 18px 15px, #FF5F57 5.5px, transparent 6px),
      radial-gradient(circle at 38px 15px, #FEBC2E 5.5px, transparent 6px),
      radial-gradient(circle at 58px 15px, #28C840 5.5px, transparent 6px),
      linear-gradient(#3A3A3C, #2C2C2E) top / 100% 30px no-repeat, #2C2C2E;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12), var(--shadow);
  }
}
/* Подсветка выбранного сегмента */
html:has(#device-iphone:checked) .device-switch__opt--iphone,
html:has(#device-ipad:checked) .device-switch__opt--ipad,
html:has(#device-mac:checked) .device-switch__opt--mac,
html:has(#device-auto:checked) .device-switch__opt--iphone { background: var(--accent); color: var(--on-accent); }
@media (min-width: 600px) {
  html:has(#device-auto:checked) .device-switch__opt--iphone { background: transparent; color: inherit; }
  html:has(#device-auto:checked) .device-switch__opt--ipad { background: var(--accent); color: var(--on-accent); }
}
.device-switch-inputs input:focus-visible { outline: none; }
html:has(#device-iphone:focus-visible) .device-switch__opt--iphone,
html:has(#device-ipad:focus-visible) .device-switch__opt--ipad,
html:has(#device-mac:focus-visible) .device-switch__opt--mac { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Снимок или ролик есть только для одного устройства — показывать при любом выборе */
/* (правила выбора устройства — html:has(#device-…:checked) — сильнее обычного класса, поэтому !important) */
.shot.shot--only { display: block !important; }
