/*
 * Lumea (стиль «Перламутр»): жемчужная гладь, шёлковая лента, жемчужина с бликами, арки врачей.
 * Тема окна записи — --bk-*, переключателя способов показа — --m-*.
 * Анимации только при prefers-reduced-motion: no-preference; fill-mode backwards, без остаточного transform.
 * @author Maksym Mariukhnik <max@absoluteweb.com>
 */
:root {
    --pearl: #faf6f8;
    --mist: #efe6f2;
    --iris: #8c63b5;
    --iris-ink: #6a4590;
    --deep: #2a1d3a;
    --soft: #655a73;
    --blush: #efd7dd;
    --white: #ffffff;
    --serif: 'Cormorant Garamond', 'Noto Serif Georgian', Georgia, serif;
    --sans: 'Manrope', 'Noto Sans Georgian', system-ui, sans-serif;

    --bk-accent: var(--deep);
    --bk-on-accent: #fff;
    --bk-radius: 16px;
    --bk-font: var(--sans);
    --bk-ink: var(--deep);
    --bk-muted: var(--soft);
    --bk-line: rgba(42, 29, 58, .14);
    --bk-soft: rgba(140, 99, 181, .08);

    --m-bg: var(--pearl);
    --m-accent: var(--deep);
    --m-on-accent: #fff;
    --m-line: var(--mist);
    --m-chip: var(--white);
    --m-chip-hover: var(--mist);
    --m-radius: 20px;
    --m-btn-radius: 999px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-variant-numeric: lining-nums; margin: 0; background: var(--pearl); color: var(--deep); font: 400 17px/1.6 var(--sans); }
:lang(ka) body { font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--iris-ink); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.link { color: var(--iris-ink); font-weight: 600; text-underline-offset: 4px; }
.link:hover { color: var(--deep); }

/* Шапка */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--pearl) 88%, transparent); backdrop-filter: blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand b { font: 500 28px/1 var(--serif); letter-spacing: .01em; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; color: var(--soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--deep); }
body[data-page="home"] .nav a[data-href="home"],
body[data-page="services"] .nav a[data-href="services"],
body[data-page="doctors"] .nav a[data-href="doctors"],
body[data-page="about"] .nav a[data-href="about"],
body[data-page="contacts"] .nav a[data-href="contacts"] { color: var(--deep); border-bottom-color: var(--iris); }
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--mist); }
.langs button { border: 0; background: none; padding: 6px 10px; min-height: 34px; border-radius: 999px; font: 500 13px var(--sans); color: var(--soft); cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--white); color: var(--deep); box-shadow: 0 1px 2px rgba(42, 29, 58, .14); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px; border: 0; background: var(--deep); color: var(--white); font: 500 16px var(--sans); text-decoration: none; cursor: pointer; transition: background .2s, box-shadow .2s; }
.btn:hover { background: var(--iris-ink); }
.btn.ghost, .btn.svc-book { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 1px rgba(42, 29, 58, .28); }
.btn.ghost:hover, .btn.svc-book:hover { background: var(--white); }
.top .btn { min-height: 42px; padding: 0 20px; font-size: 15px; }
.sticky-book { display: none; }

/* Первый экран: шёлк и жемчужина */
.hero { position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; min-height: min(720px, calc(100vh - 100px)); gap: 24px; }
.hero h1 { font: 500 clamp(44px, 5.4vw, 76px)/1.04 var(--serif); margin: 0 0 24px; max-width: 14ch; letter-spacing: -.01em; }
:lang(ka) .hero h1 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.25; max-width: 16ch; letter-spacing: 0; }
.hero p.lead { font-size: 19px; color: var(--soft); max-width: 44ch; margin: 0 0 36px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.silk { position: relative; aspect-ratio: 1; width: 100%; }
.silk svg { overflow: visible; position: absolute; inset: -12% -30% -12% -10%; width: 140%; height: 124%; }
.sheen { transform: translateX(-160px) skewX(-18deg); transform-box: fill-box; }

/* Лента прорисовывается, жемчужина всплывает и вспыхивает; потом лента дышит, на жемчужине скользит блик */
@media (prefers-reduced-motion: no-preference) {
    .ribbon { animation: draw 2.6s cubic-bezier(.3, .6, .2, 1) backwards; stroke-dasharray: 3000; }
    .ribbon.r2 { animation-delay: .25s; }
    .ribbon.r3 { animation-delay: .5s; }
    .pearl { transform-origin: center; transform-box: fill-box; animation: pearl 1.4s 1.4s ease-out backwards; }
    .drift { animation: drift 9s ease-in-out infinite alternate; }
    .drift.d2 { animation-duration: 7s; animation-delay: -2s; }
    .drift.d3 { animation-duration: 11s; animation-delay: -5s; }
    .float { animation: float 6s ease-in-out infinite; }
    .par { transform: translate(calc(var(--px, 0) * 18px), calc(var(--py, 0) * 18px)); transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
    .spark { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: spark 4.8s 3s ease-in-out infinite; }
    .spark.s2 { animation-delay: 4.6s; }
    .spark.s3 { animation-delay: 6.1s; }
    .sheen { animation: sheen 5.2s 3.2s ease-in-out infinite; }
}
@keyframes draw { from { stroke-dashoffset: 3000; } to { stroke-dashoffset: 0; } }
@keyframes pearl { from { opacity: 0; transform: scale(.8); } }
@keyframes drift { from { transform: translate(0, -10px); } to { transform: translate(-14px, 12px); } }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes spark {
    0%, 70%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    78% { transform: scale(1) rotate(45deg); opacity: 1; }
    88% { transform: scale(.2) rotate(90deg); opacity: 0; }
}
@keyframes sheen {
    0%, 55%, 100% { transform: translateX(-160px) skewX(-18deg); }
    80% { transform: translateX(210px) skewX(-18deg); }
}

/* Секции */
.sec { padding: 96px 0; }
.sec-white { background: var(--white); }
.h2 { font: 500 clamp(36px, 4.2vw, 56px)/1.08 var(--serif); margin: 0 0 16px; }
:lang(ka) .h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.35; }
.sub { color: var(--soft); max-width: 60ch; margin: 0 0 48px; }
.all { margin: 28px 0 0; }

/* Направления: три главных крупно, остальные списком */
.key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-bottom: 64px; }
.key article { position: relative; padding-top: 24px; }
.key article::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--iris); transform-origin: left; }
.key h3 { font: 500 30px/1.15 var(--serif); margin: 0 0 10px; }
:lang(ka) .key h3 { font-size: 20px; line-height: 1.45; }
.key p { margin: 0; color: var(--soft); }
.more { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 64px; }
.more > div { padding: 18px 0; border-bottom: 1px solid var(--mist); display: grid; grid-template-columns: 14px 1fr; gap: 14px; }
.more > div::before { content: ""; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--blush) 60%, #bba5d3); }
.more p { margin: 0; }
.more b { font-weight: 600; display: block; }
.more span { color: var(--soft); font-size: 15px; }

/* Врачи в арках */
.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.doc { display: flex; flex-direction: column; }
.doc .ph { aspect-ratio: 4/5; border-radius: 999px 999px 28px 28px; overflow: hidden; background: var(--mist); margin-bottom: 22px; }
.doc .ph img, .doc-photo { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.doc .info { display: flex; flex-direction: column; flex: 1; }
.doc h3 { font: 500 32px/1.1 var(--serif); margin: 0 0 6px; }
:lang(ka) .doc h3 { font-size: 22px; line-height: 1.4; }
.doc .role { color: var(--iris-ink); font-weight: 600; margin: 0 0 12px; }
.doc .focus { color: var(--soft); font-size: 15px; margin: 0 0 16px; flex: 1; }
.doc dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 22px; font-size: 14px; }
.doc dt { color: var(--soft); }
.doc dd { margin: 0; font-weight: 500; }
.doc .row { display: flex; align-items: center; gap: 12px; }
.docs[data-mode="inline"] { grid-template-columns: 1fr; gap: 72px; }
.docs[data-mode="inline"] .doc { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.docs[data-mode="inline"] .ph { margin-bottom: 0; }
.docs[data-mode="inline"] .focus { flex: 0; }
.g-list { margin: 0 auto; }

/* О клинике */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about .photo { border-radius: 999px 999px 28px 28px; overflow: hidden; aspect-ratio: 4/5; background: var(--mist); }
.about .photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.about p { font-size: 18px; margin: 0 0 8px; }
.stats { display: flex; flex-wrap: wrap; gap: 20px 40px; margin-top: 32px; }
.stats b, .about-facts strong { font: 500 56px/1 var(--serif); display: block; color: var(--iris-ink); }
.stats span, .about-facts span { color: var(--soft); font-size: 15px; display: block; max-width: 16ch; }

/* Контакты */
.sec-dark { background: var(--deep); color: var(--white); }
.sec-dark .sub, .sec-dark .muted { color: #cdbfdc; }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact .lines { display: grid; gap: 26px; }
.contact .lines b { display: block; font: 500 26px/1.25 var(--serif); }
:lang(ka) .contact .lines b { font-size: 20px; line-height: 1.4; }
.contact .lines a { text-decoration: none; }
.contact .lines a:hover b { text-decoration: underline; }
.contact .muted { font-size: 15px; }
.contact .btns { display: flex; flex-wrap: wrap; gap: 12px; }
.sec-dark .btn { background: var(--white); color: var(--deep); }
.sec-dark .btn:hover { background: var(--mist); }
.sec-dark .btn.ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }
.sec-dark .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.sec-dark :focus-visible { outline-color: #e3d6f0; }
.foot { background: var(--deep); color: #a99bb9; font-size: 14px; padding: 0 0 40px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 24px; }
.foot a { color: #e3d6f0; }

/* Внутренние страницы (общие блоки shared/pages) */
.page { max-width: 1180px; margin: 0 auto; padding: 56px 24px 96px; }
.page-title { font: 500 clamp(44px, 5.6vw, 72px)/1.05 var(--serif); margin: 0 0 40px; }
:lang(ka) .page-title { font-size: clamp(32px, 4vw, 48px); line-height: 1.25; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px; }
.doc-card { display: flex; flex-direction: column; }
.doc-photo { aspect-ratio: 4/5; border-radius: 999px 999px 28px 28px; margin-bottom: 22px; background: var(--mist); }
.doc-name { font: 500 32px/1.1 var(--serif); margin: 0 0 6px; }
:lang(ka) .doc-name { font-size: 22px; line-height: 1.4; }
.doc-role { color: var(--iris-ink); font-weight: 600; margin: 0 0 8px; }
.doc-meta { color: var(--soft); font-size: 14px; margin: 0 0 12px; }
.doc-bio { color: var(--soft); font-size: 15px; margin: 0 0 18px; }
.doc-body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.doc-grid[data-mode="inline"], .doc-grid[data-mode="list"] { grid-template-columns: 1fr; }
.doc-grid[data-mode="inline"] .doc-card { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.doc-grid[data-mode="inline"] .doc-photo { margin-bottom: 0; }
.doc-body .bk-inline { align-self: stretch; }

.svc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 56px; }
.svc-card { position: relative; padding-top: 24px; display: flex; flex-direction: column; align-items: flex-start; }
.svc-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--iris); }
.svc-title { font: 500 32px/1.15 var(--serif); margin: 0 0 10px; }
:lang(ka) .svc-title { font-size: 22px; line-height: 1.4; }
.svc-text { margin: 0 0 12px; color: var(--soft); }
.svc-docs { margin: 0 0 18px; font-size: 15px; }
.svc-docs b { color: var(--iris-ink); font-weight: 600; }
.svc-book { margin-top: auto; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-text p { font-size: 18px; margin: 0 0 20px; }
.about-photo { border-radius: 999px 999px 28px 28px; overflow: hidden; aspect-ratio: 4/5; background: var(--mist); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.about-facts { display: flex; flex-wrap: wrap; gap: 24px 56px; margin: 56px 0 0; padding: 0; list-style: none; }

.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 56px; align-items: start; }
.ct-list { margin: 0; display: grid; gap: 4px; }
.ct-list dt { color: var(--soft); font-size: 14px; margin-top: 18px; }
.ct-list dt:first-child { margin-top: 0; }
.ct-list dd { margin: 0; font: 500 26px/1.25 var(--serif); }
:lang(ka) .ct-list dd { font-size: 20px; line-height: 1.4; }
.ct-list a { text-underline-offset: 4px; }
.ct-msgs a { margin-right: 16px; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-ghost { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 1px rgba(42, 29, 58, .28); }
.btn-ghost:hover { background: var(--white); }
.ct-map { grid-column: 1 / -1; width: 100%; height: 380px; border: 0; border-radius: 28px; filter: grayscale(.35) contrast(.95); background: var(--mist); }

/* Движение: линии над направлениями, арки врачей проявляются снизу вверх */
@media (prefers-reduced-motion: no-preference) {
    html.motion .key:not(.in) article::before { transform: scaleX(0); }
    html.motion .key.in article::before { animation: line 1.2s cubic-bezier(.6, 0, .2, 1) backwards; }
    html.motion .key.in article:nth-child(2)::before { animation-delay: .15s; }
    html.motion .key.in article:nth-child(3)::before { animation-delay: .3s; }
    html.motion .docs.in .ph { animation: arch 1.3s cubic-bezier(.6, 0, .2, 1) backwards; }
    html.motion .docs.in .doc:nth-child(2) .ph { animation-delay: .12s; }
    html.motion .docs.in .doc:nth-child(3) .ph { animation-delay: .24s; }
    html.motion .docs.in .ph img { animation: zoom 1.8s cubic-bezier(.2, .7, .2, 1) backwards; }
    html.motion .doc-card.in .doc-photo, html.motion .about .photo.in img, html.motion .about-photo img { animation: zoom 1.8s cubic-bezier(.2, .7, .2, 1) backwards; }
    .doc .ph img { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
    .doc:hover .ph img { transform: scale(1.04); }
}
@keyframes line { from { transform: scaleX(0); } }
@keyframes arch { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes zoom { from { transform: scale(1.18); } }

@media (max-width: 1080px) {
    .top { position: static; }
    .top .wrap { flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; padding-bottom: 6px; min-height: 0; }
    .langs { margin-left: auto; }
    .nav { order: 3; flex-basis: 100%; margin-left: 0; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; }
    .nav a { padding: 10px 0; font-size: 14px; }
}
@media (max-width: 960px) {
    .hero .wrap { grid-template-columns: 1fr; min-height: 0; padding-top: 16px; }
    .silk { order: -1; max-width: 230px; margin: 0 auto -76px; }
    .key, .docs { grid-template-columns: 1fr; }
    .more, .about, .contact, .about-grid, .ct-grid, .svc-list { grid-template-columns: 1fr; }
    .docs { gap: 56px; }
    .doc .ph { max-width: 380px; }
    .about .photo, .about-photo { max-width: 420px; }
    .docs[data-mode="inline"] .doc, .doc-grid[data-mode="inline"] .doc-card { grid-template-columns: 1fr; gap: 0; }
    .docs[data-mode="inline"] .ph, .doc-grid[data-mode="inline"] .doc-photo { margin-bottom: 22px; }
    .sec { padding: 72px 0; }
    .page { padding: 40px 24px 72px; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .page { padding-left: 16px; padding-right: 16px; }
    .top .btn { display: none; }
    .sticky-book { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; box-shadow: 0 10px 30px rgba(42, 29, 58, .3); }
    body { padding-bottom: 80px; }
    body.hero-in .sticky-book { display: none; }
    .hero h1 { font-size: 44px; }
    :lang(ka) .hero h1 { font-size: 30px; }
    .hero p.lead { font-size: 17px; margin-bottom: 28px; }
    .stats b, .about-facts strong { font-size: 46px; }
}

/* Форма обратной связи: перламутровая карточка, мягкие поля, таблетки способов связи. */
[data-contact-form] {
    --cf-accent: var(--deep);
    --cf-radius: 18px;
    --cf-btn-radius: 999px;
    --cf-line-strong: rgba(42, 29, 58, .22);
    --cf-field-bg: rgba(255, 255, 255, .85);
    --cf-error: #a32a4a;
    --cf-bg: linear-gradient(135deg, var(--white) 0%, var(--mist) 100%);
    --cf-pad: 48px;
    border-radius: 32px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 24px 60px -30px rgba(106, 69, 144, .35);
}
.cf-intro h2 { font: 500 clamp(34px, 4vw, 52px)/1.05 var(--serif); }
:lang(ka) .cf-intro h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; }
.cf-pill input:checked + span { background: var(--deep); }
.cf-done h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.6vw, 42px); }
@media (max-width: 820px) { [data-contact-form] { --cf-pad: 28px 20px; border-radius: 26px; } }
