/* ==========================================================================
   ENNEAGRAM Professional — дизайн-система
   Фирменный стиль: золото, графит, слоновая кость; прямые углы, тонкие линии,
   золотые уголки. Шрифты: Playfair Display, EB Garamond, Inter.
   ========================================================================== */

:root {
    --gold: #DFAC2A;
    --gold-deep: #A9801A;
    --gold-ink: #8C6A12;
    --gold-light: #FFF0BB;
    --gold-pale: #F7E7BF;
    --gold-line: rgba(223, 172, 42, .28);
    --gold-hair: rgba(223, 172, 42, .16);
    --gold-glow: 0 0 35px 2px rgba(223, 172, 42, .45);
    --ink: #1A1A1A;
    --ink-2: #3A3A3A;
    --muted: #6E6E6E;
    --muted-2: #9A9A9A;
    --line: #E7E3DA;
    --line-warm: #EFE6D2;
    --paper: #FFFFFF;
    --bg: #FAF9F7;
    --bg-2: #F4F1EA;
    --night: #141414;
    --night-2: #1E1E1E;
    --ok: #4F7A5A;
    --danger: #9E3B32;

    --f-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --f-text: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    --shadow: 0 8px 24px rgba(0, 0, 0, .07);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .10);
    --ease: cubic-bezier(.23, 1, .32, 1);
    --gutter: clamp(18px, 5vw, 60px);
    --container: 1200px;
    --measure: 690px;
    --header-h: 88px;
}
@media (max-width: 1024px) { :root { --header-h: 73px; } }

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-text);
    font-size: 19px;
    line-height: 1.6;
    font-variant-numeric: lining-nums;
    overflow-x: hidden;
}
@media (max-width: 600px) { body { font-size: 18px; } }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .3s; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.18; color: var(--ink); margin: 0 0 .55em; letter-spacing: -.005em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3.1rem); }
h3 { font-size: clamp(1.35rem, 1.15rem + .7vw, 1.75rem); }
h4 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
em, i { font-style: italic; }
strong, b { font-weight: 600; }
::selection { background: var(--gold-light); color: var(--ink); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--ink); color: #fff; padding: 10px 16px; font: 500 13px var(--f-ui); }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Сетка и ритм ---------- */
.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.measure { width: min(var(--measure), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 140px); }
.section--tight { padding-block: clamp(48px, 6vw, 84px); }
.section--white { background: var(--paper); }
.section--dark { background: var(--night); color: rgba(250, 249, 247, .78); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.center { text-align: center; }

/* ---------- Типографика ---------- */
.kicker { display: inline-block; font-family: var(--f-ui); font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 18px; }
.section--dark .kicker { color: var(--gold); }
.lead { font-size: clamp(1.12rem, 1.02rem + .45vw, 1.35rem); line-height: 1.6; color: var(--ink-2); max-width: 44em; }
.section--dark .lead { color: rgba(250, 249, 247, .72); }
.muted { color: var(--muted); }
.ui { font-family: var(--f-ui); }
.gold { color: var(--gold-deep); }
.accent { color: var(--gold); font-style: italic; }
.rule { display: block; width: 60px; height: 1px; background: var(--gold); border: 0; margin: 28px 0; }
.center .rule { margin-inline: auto; }
.numeral { font-family: var(--f-display); font-weight: 400; color: var(--gold); font-variant-numeric: lining-nums; }
.section-head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head.center { margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 54px; padding: 0 34px; border: 1px solid transparent; border-radius: 4px;
    font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1;
    cursor: pointer; text-decoration: none; white-space: nowrap; position: relative; overflow: hidden;
    transition: box-shadow .25s ease, background-color .25s, color .25s, border-color .25s;
}
.btn .icon { width: 16px; height: 16px; }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover, .btn--gold:focus-visible { box-shadow: var(--gold-glow); color: #fff; }
.btn--dark { background: var(--ink); color: var(--bg); letter-spacing: .2em; }
.btn--dark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent); transform: translateX(-100%); animation: shimmer 3.2s ease-in-out 1.5s infinite; }
.btn--dark:hover { color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--bg); }
.section--dark .btn--line { color: #fff; border-color: rgba(255, 255, 255, .45); }
.section--dark .btn--line:hover { background: #fff; color: var(--ink); }
.btn--sm { min-height: 42px; padding: 0 22px; font-size: 11px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); padding-bottom: 5px; border-bottom: 1px solid currentColor; }
.text-link:hover { color: var(--gold-deep); }
.section--dark .text-link { color: #fff; }
.section--dark .text-link:hover { color: var(--gold); }

/* ---------- Карточка с золотыми уголками (фирменный мотив) ---------- */
.frame { position: relative; background: var(--paper); box-shadow: var(--shadow); }
.frame::before, .frame::after { content: ""; position: absolute; width: clamp(56px, 7vw, 96px); height: clamp(56px, 7vw, 96px); pointer-events: none; z-index: 1; }
.frame::before { top: 0; left: 0; border-top: 3px solid var(--gold-pale); border-left: 3px solid var(--gold-pale); }
.frame::after { right: 0; bottom: 0; border-right: 3px solid var(--gold-pale); border-bottom: 3px solid var(--gold-pale); }
.plate { background: var(--paper); border: 1px solid var(--line); }

/* ---------- Шапка (фирменный логотип) ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000; height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 0 var(--gutter);
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(223, 172, 42, .15);
}
.logo-link { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.logo-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--gold); transition: box-shadow .1s ease-in-out; }
.logo-icon span { color: var(--gold); font-family: var(--f-display); font-size: 20px; font-weight: 600; line-height: 1; }
@media (hover: hover) { .logo-link:hover .logo-icon { box-shadow: var(--gold-glow); } }
.logo-text { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.logo-title { font-family: var(--f-display); font-size: 20px; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; line-height: 1; }
.logo-subtitle { font-family: var(--f-ui); font-size: 10.5px; color: var(--muted); letter-spacing: .22em; text-transform: uppercase; line-height: 1; }
.main-nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 34px); }
.nav-item { position: relative; font-family: var(--f-ui); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 6px 0; transition: color .3s; }
.nav-item::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--gold); transition: width .3s cubic-bezier(.4, 0, .2, 1); }
.nav-item:hover, .nav-item.active { color: var(--gold-deep); }
.nav-item:hover::after, .nav-item.active::after { width: 100%; }
.btn-test { margin-left: 8px; padding: 12px 24px; background: var(--gold); color: #fff; font-family: var(--f-ui); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border-radius: 6px; transition: box-shadow .1s ease-in-out; }
.btn-test:hover, .btn-test:focus-visible { color: #fff; box-shadow: var(--gold-glow); }
.burger-menu { display: none; width: 30px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; z-index: 1002; flex-direction: column; justify-content: space-between; }
.burger-menu span { display: block; height: 2px; width: 100%; background: var(--ink); transition: transform .3s, opacity .2s, background-color .3s; transform-origin: left center; }
.burger-menu[aria-expanded="true"] span:first-child { transform: rotate(45deg); background: var(--gold); }
.burger-menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger-menu[aria-expanded="true"] span:last-child { transform: rotate(-45deg); background: var(--gold); }
.nav-shade { display: none; }
.nav-item, .btn-test { white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 901px) { .main-nav { gap: 18px; } .nav-item { font-size: 10px; } .btn-test { padding: 10px 18px; font-size: 10px; } }
/* Телефон и планшет в портрете: меню в выезжающей панели. */
@media (max-width: 900px) {
    .burger-menu { display: flex; }
    .main-nav { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(78vw, 340px); z-index: 1001; flex-direction: column; justify-content: center; align-items: stretch; gap: 0; padding: 40px 34px; background: #fff; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); clip-path: inset(0 0 0 100%); visibility: hidden; transition: clip-path .45s var(--ease), visibility 0s linear .45s; }
    .main-nav.active { clip-path: inset(0 0 0 -60px); visibility: visible; transition: clip-path .45s var(--ease), visibility 0s; }
    .nav-item { font-size: 13px; padding: 18px 0; border-bottom: 1px solid var(--line); }
    .nav-item::after { display: none; }
    .btn-test { margin: 28px 0 0; text-align: center; padding: 16px; font-size: 12px; }
    .nav-shade { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(20, 20, 20, .35); opacity: 0; pointer-events: none; transition: opacity .3s; }
    .nav-shade.active { opacity: 1; pointer-events: auto; }
}
@media (max-width: 767px) {
    .logo-title { font-size: 17px; }
    .logo-subtitle { font-size: 9px; }
    .logo-icon { width: 34px; height: 34px; }
}

/* ---------- Подвал ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .6); border-top: 1px solid rgba(223, 172, 42, .2); padding: 64px var(--gutter) calc(40px + env(safe-area-inset-bottom)); font-family: var(--f-ui); }
.footer-content { max-width: var(--container); margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 32px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.footer-logo { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.footer-tagline { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .6); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 13px; padding-top: 6px; }
.footer-links a { color: rgba(255, 255, 255, .7); font-weight: 500; letter-spacing: .05em; }
.footer-links a:hover { color: #fff; }
.footer-legal { max-width: var(--container); margin: 40px auto 0; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: rgba(255, 255, 255, .4); line-height: 1.6; }
@media (max-width: 768px) { .footer-content { flex-direction: column; } }

/* ---------- Формы ---------- */
.field { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { font-family: var(--f-ui); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); padding: 0; }
.field__hint { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.field__error { font-family: var(--f-ui); font-size: 12.5px; color: var(--danger); }
.input, .select { width: 100%; min-height: 54px; padding: 0 16px; border: 1px solid #E2DED5; border-radius: 0; background: #fff; font-family: var(--f-ui); font-size: 16px; color: var(--ink); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23A9801A' stroke-width='1.3'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.input:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(223, 172, 42, .14); }
.input::placeholder { color: #ABABAB; }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-row label { position: relative; }
.choice-row input { position: absolute; opacity: 0; inset: 0; }
.choice-row span { display: flex; align-items: center; justify-content: center; min-height: 54px; border: 1px solid #E2DED5; background: #fff; font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); cursor: pointer; transition: all .25s; }
.choice-row input:checked + span { background: linear-gradient(90deg, var(--gold) 0%, #D4AF37 100%); border-color: var(--gold); color: #fff; }
.choice-row input:focus-visible + span { box-shadow: 0 0 0 3px rgba(223, 172, 42, .25); }
.check { display: flex; gap: 12px; align-items: flex-start; font-family: var(--f-ui); font-size: 13px; line-height: 1.55; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--gold); }
.check a { color: var(--gold-deep); border-bottom: 1px solid var(--gold-line); }

/* ---------- Диалоги и уведомления ---------- */
.dialog { border: 0; padding: 0; background: #fff; color: var(--ink); width: min(540px, calc(100% - 28px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(20, 20, 20, .55); }
.dialog__body { position: relative; padding: clamp(28px, 5vw, 44px); }
.dialog__body::before { content: ""; position: absolute; top: 0; left: 0; width: 70px; height: 70px; border-top: 3px solid var(--gold-pale); border-left: 3px solid var(--gold-pale); pointer-events: none; }
.dialog__close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); }
.dialog__close:hover { color: var(--ink); }
.dialog h2 { font-size: 1.8rem; padding-right: 30px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 3000; transform: translate(-50%, 16px); opacity: 0; padding: 14px 24px; background: var(--ink); color: #fff; font-family: var(--f-ui); font-size: 13px; letter-spacing: .02em; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .35s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center; border-left: 3px solid var(--gold); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Появление ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- Простые страницы ---------- */
.page-hero { padding: clamp(56px, 8vw, 110px) 0 clamp(36px, 5vw, 60px); }
.page-hero h1 { max-width: 920px; }
.prose { font-size: 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--gold); }
.prose a { color: var(--gold-deep); border-bottom: 1px solid var(--gold-line); }
.note { display: flex; gap: 14px; padding: 20px 22px; background: #fff; border-left: 2px solid var(--gold); font-family: var(--f-ui); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.note a { color: var(--gold-deep); border-bottom: 1px solid var(--gold-line); }
.r-label { display: block; font-family: var(--f-ui); font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 10px; }
.r-small { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.55; }

@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff; font-size: 11.5pt; }
    .reveal { opacity: 1 !important; transform: none !important; }
}
