/*
 * Aurum (стиль «Бархат»): изумруд и латунь, «ракушка» вместо верха фото, латунный блик, линии таблицы.
 * Тема окна записи — --bk-*, переключателя способов показа — --m-*.
 * Анимации только при prefers-reduced-motion: no-preference; fill-mode backwards, без остаточного transform.
 * @author Maksym Mariukhnik <max@absoluteweb.com>
 */
:root {
    --emerald: #0f4a3c;
    --emerald-deep: #0a3329;
    --brass: #c6a46c;
    --brass-soft: #e6d3ad;
    --brass-ink: #7a5c22;
    --marble: #f1f2ef;
    --stone: #e7ebe7;
    --ink: #13231f;
    --muted: #5d6d68;
    --display: 'Tenor Sans', 'Noto Sans Georgian', sans-serif;
    --sans: 'Onest', 'Noto Sans Georgian', system-ui, sans-serif;

    --bk-accent: var(--emerald);
    --bk-on-accent: #fff;
    --bk-radius: 4px;
    --bk-font: var(--sans);
    --bk-ink: var(--ink);
    --bk-muted: var(--muted);
    --bk-line: rgba(15, 74, 60, .2);
    --bk-soft: rgba(15, 74, 60, .06);

    --m-bg: #f6f7f4;
    --m-accent: var(--emerald);
    --m-on-accent: #fff;
    --m-line: rgba(198, 164, 108, .6);
    --m-chip: transparent;
    --m-chip-hover: rgba(15, 74, 60, .08);
    --m-radius: 2px;
    --m-btn-radius: 2px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--marble); color: var(--ink); font: 400 17px/1.6 var(--sans); }
:lang(ka) body { font-size: 16px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.link { color: var(--emerald); font-weight: 500; text-underline-offset: 4px; text-decoration-color: var(--brass); }
.link:hover { color: var(--emerald-deep); }

/* Ракушка: верх арки волнами, как спинка дивана в холле. Контур <clipPath id="shell"> лежит в layout.html */
.shell, .about-photo { clip-path: url(#shell); }

/* Шапка: на главной поверх изумруда, на внутренних страницах — сплошная */
.top { position: relative; z-index: 10; color: var(--marble); background: var(--emerald-deep); }
body[data-page="home"] .top { height: 0; background: none; }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand b { font: 400 22px/1 var(--display); letter-spacing: .14em; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; opacity: .8; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { opacity: 1; }
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"] { opacity: 1; border-bottom-color: var(--brass); }
.langs { display: flex; gap: 4px; }
.langs button { background: none; border: 1px solid transparent; color: inherit; font: 500 13px var(--sans); padding: 6px 9px; min-height: 34px; cursor: pointer; opacity: .75; border-radius: 2px; }
.langs button:hover { opacity: 1; }
.langs button[aria-pressed="true"] { border-color: var(--brass); color: var(--brass-soft); opacity: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 30px; background: var(--brass); color: var(--emerald-deep); font: 500 16px var(--sans); text-decoration: none; border: 0; border-radius: 2px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.btn:hover { background: var(--brass-soft); }
.btn.line { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.btn.line:hover { background: rgba(255, 255, 255, .08); }
.btn.dark { background: var(--emerald); color: var(--marble); }
.btn.dark:hover { background: var(--emerald-deep); }
.top .btn { min-height: 42px; padding: 0 20px; font-size: 15px; }
.sticky-book { display: none; }

/* Первый экран */
.hero { background: radial-gradient(120% 90% at 85% 10%, #15604e 0%, var(--emerald) 45%, var(--emerald-deep) 100%); color: var(--marble); padding: 140px 0 0; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; }
.hero h1 { font: 400 clamp(40px, 5.2vw, 76px)/1.06 var(--display); margin: 0 0 28px; letter-spacing: -.01em; }
:lang(ka) .hero h1 { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.22; }
.hero .lead { font-size: 19px; color: #cfdcd7; max-width: 44ch; margin: 0 0 40px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 80px; }
.hero .facts { display: flex; gap: 48px; padding: 28px 0 40px; border-top: 1px solid rgba(198, 164, 108, .35); }
.hero .facts b { font: 400 34px/1 var(--display); color: var(--brass-soft); display: block; margin-bottom: 6px; font-variant-numeric: lining-nums; }
.hero .facts span { font-size: 14px; color: #b7c8c2; display: block; max-width: 16ch; }
.hero figure { margin: 0; align-self: stretch; display: flex; align-items: flex-end; }
.hero figure .pic { position: relative; width: 100%; }
.hero figure img { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; object-position: 38% 50%; }

/* Латунный блик: пробегает по фото-«ракушке», по эмблеме и по фото врача */
.glint, .doc .ph::after, .emblem::after, .about-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(214, 178, 112, .45) 46%, rgba(255, 246, 222, .85) 50%, rgba(214, 178, 112, .45) 54%, transparent 60%); background-size: 250% 100%; background-position: 130% 0; opacity: 0; }
.about-photo { position: relative; }

/* Позиционирование клиники */
.claim { padding: 120px 0 40px; }
.claim p { font: 400 clamp(26px, 3vw, 40px)/1.3 var(--display); max-width: 30ch; margin: 0; color: var(--emerald); }
:lang(ka) .claim p { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.5; max-width: 36ch; }

section { padding: 100px 0; }
.h2 { font: 400 clamp(32px, 3.6vw, 52px)/1.1 var(--display); margin: 0 0 18px; color: var(--emerald); }
:lang(ka) .h2 { font-size: clamp(26px, 3vw, 42px); line-height: 1.3; }
.sub { color: var(--muted); max-width: 58ch; margin: 0 0 56px; }
.all { margin: 36px 0 0; }

/* Направления: таблица с латунными линиями */
.svc { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 72px; border-top: 1px solid var(--brass); }
.svc > div, .svc-card { position: relative; padding: 26px 0; }
.svc > div::after, .svc-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(198, 164, 108, .6); transform-origin: left; }
.svc h3, .svc-title { font: 500 19px/1.35 var(--sans); margin: 0 0 6px; color: var(--ink); }
.svc p { margin: 0; color: var(--muted); font-size: 15px; }
.svc .key h3 { color: var(--emerald); }
.svc .key h3::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; vertical-align: middle; border-radius: 50%; background: var(--brass); }

/* Врачи */
#doctors { background: var(--stone); }
.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.doc { display: flex; flex-direction: column; }
.doc .ph { position: relative; aspect-ratio: 3/4; background: var(--emerald); margin-bottom: 24px; overflow: hidden; }
.doc .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.doc .info { display: flex; flex-direction: column; flex: 1; }
.doc h3, .doc h2 { font: 400 26px/1.2 var(--display); margin: 0 0 6px; color: var(--emerald); }
:lang(ka) .doc h3, :lang(ka) .doc h2 { font-size: 22px; line-height: 1.4; }
.doc .role { font-weight: 500; margin: 0 0 12px; }
.doc .focus { color: var(--muted); font-size: 15px; margin: 0 0 18px; flex: 1; }
.doc .meta { font-size: 14px; color: var(--muted); margin: 0 0 22px; display: grid; gap: 2px; }
.doc .meta b { color: var(--ink); font-weight: 500; }
.doc .row { display: flex; align-items: center; gap: 20px; border-top: 1px solid rgba(15, 74, 60, .2); padding-top: 18px; }
.bk-book { background: var(--emerald); color: var(--marble); }
.bk-book:hover { background: var(--emerald-deep); }
.docs[data-mode="inline"] { grid-template-columns: 1fr; gap: 80px; }
.docs[data-mode="inline"] .doc { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.docs[data-mode="inline"] .focus { flex: 0; }
.docs[data-mode="inline"] .ph { margin-bottom: 0; }
.g-modes-row button { box-shadow: inset 0 0 0 1px rgba(15, 74, 60, .25); }

/* Пространство */
.space { display: grid; grid-template-columns: .8fr 1.2fr; gap: 72px; align-items: center; }
.emblem { position: relative; aspect-ratio: 4/5; background: radial-gradient(90% 70% at 50% 35%, #15604e, var(--emerald) 60%, var(--emerald-deep)); display: grid; place-items: center; }
.emblem img { width: 46%; height: auto; opacity: .95; }
.space p { font-size: 18px; margin: 0 0 28px; max-width: 52ch; }

/* Контакты */
#contacts { background: var(--emerald-deep); color: var(--marble); }
#contacts .h2 { color: var(--marble); }
#contacts .sub { color: #b7c8c2; }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact dl { margin: 0; display: grid; gap: 28px; align-content: start; }
.contact dt { font-size: 14px; color: var(--brass); margin-bottom: 4px; }
.contact dd { margin: 0; font: 400 22px/1.35 var(--display); }
:lang(ka) .contact dd { font-size: 19px; line-height: 1.45; }
.contact dd small { display: block; font: 400 15px/1.5 var(--sans); color: #b7c8c2; margin-top: 4px; }
.contact dd a { text-decoration: none; }
.contact dd a:hover { text-decoration: underline; }
.contact .btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.map { min-height: 420px; border: 1px solid rgba(198, 164, 108, .4); }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; filter: grayscale(.6) sepia(.15); }
.foot { background: var(--emerald-deep); color: #8fa9a1; font-size: 14px; }
.foot a { color: var(--brass-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid rgba(198, 164, 108, .25); }
body:not([data-page="home"]) .foot { padding-top: 24px; }
body:not([data-page="home"]) .foot .wrap { border-top: 0; }

/* Внутренние страницы (общие блоки shared/pages) */
.page { max-width: 1240px; margin: 0 auto; padding: 64px 32px 100px; }
.page-title { font: 400 clamp(38px, 5vw, 64px)/1.08 var(--display); margin: 0 0 48px; color: var(--emerald); padding-bottom: 24px; border-bottom: 1px solid var(--brass); }
:lang(ka) .page-title { font-size: clamp(28px, 3.8vw, 46px); line-height: 1.3; }
.page-doctors .docs { margin-top: 0; }

.svc-list { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 72px; }
.svc-card { display: flex; flex-direction: column; align-items: flex-start; padding: 30px 0; }
.svc-title { font: 400 24px/1.25 var(--display); color: var(--emerald); }
:lang(ka) .svc-title { font-size: 20px; line-height: 1.4; }
.svc-text { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.svc-docs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.svc-docs b { color: var(--ink); font-weight: 500; }
.svc-book { margin-top: auto; min-height: 44px; padding: 0 22px; font-size: 15px; background: transparent; color: var(--emerald); box-shadow: inset 0 0 0 1px rgba(15, 74, 60, .4); }
.svc-book:hover { background: var(--emerald); color: var(--marble); }

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 72px; align-items: start; }
.about-text p { font-size: 18px; margin: 0 0 22px; max-width: 54ch; }
.about-photo { aspect-ratio: 4/5; background: var(--emerald); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }
.about-facts { display: flex; flex-wrap: wrap; gap: 24px 64px; margin: 64px 0 0; padding: 32px 0 0; border-top: 1px solid var(--brass); list-style: none; }
.about-facts strong { font: 400 52px/1 var(--display); color: var(--emerald); display: block; margin-bottom: 6px; }
.about-facts span { color: var(--muted); font-size: 15px; display: block; max-width: 18ch; }

.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 72px; align-items: start; }
.ct-list { margin: 0; }
.ct-list dt { color: var(--brass-ink); font-size: 14px; margin: 24px 0 4px; }
.ct-list dt:first-child { margin-top: 0; }
.ct-list dd { margin: 0; font: 400 24px/1.35 var(--display); color: var(--emerald); }
:lang(ka) .ct-list dd { font-size: 19px; line-height: 1.45; }
.ct-list a { text-underline-offset: 4px; text-decoration-color: var(--brass); }
.ct-msgs a { margin-right: 20px; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 14px; align-content: start; }
.btn-ghost { background: transparent; color: var(--emerald); box-shadow: inset 0 0 0 1px rgba(15, 74, 60, .4); }
.btn-ghost:hover { background: rgba(15, 74, 60, .08); }
.ct-map { grid-column: 1 / -1; width: 100%; height: 400px; border: 1px solid rgba(198, 164, 108, .6); filter: grayscale(.6) sepia(.15); background: var(--stone); }

/* Движение: «ракушка» раскрывается, по ней пробегает латунный блик; линии таблицы прорисовываются */
@media (prefers-reduced-motion: no-preference) {
    .hero figure img { animation: unveil 1.8s .2s cubic-bezier(.2, .7, .2, 1) backwards; }
    .glint { animation: glint 7s 1.8s ease-in-out infinite; }
    .emblem img { animation: breathe 6s ease-in-out infinite; }
    html.motion .emblem.in::after { animation: glint 6s .6s ease-in-out infinite; }
    html.motion .svc:not(.in) > div::after, html.motion .svc-list:not(.in) .svc-card::after { transform: scaleX(0); }
    html.motion .svc.in > div::after, html.motion .svc-list.in .svc-card::after { animation: line 1.1s cubic-bezier(.6, 0, .2, 1) backwards; }
    html.motion .svc.in > div:nth-child(n+3)::after, html.motion .svc-list.in .svc-card:nth-child(n+3)::after { animation-delay: .12s; }
    html.motion .svc.in > div:nth-child(n+5)::after, html.motion .svc-list.in .svc-card:nth-child(n+5)::after { animation-delay: .24s; }
    html.motion .svc.in > div:nth-child(n+7)::after, html.motion .svc-list.in .svc-card:nth-child(n+7)::after { animation-delay: .36s; }
    html.motion .docs.in .ph img, .about-photo img { animation: unveil 1.6s cubic-bezier(.2, .7, .2, 1) backwards; }
    html.motion .docs.in .ph::after, .about-photo::after { animation: glint-once 1.6s .7s ease-in-out backwards; }
    html.motion .docs.in .doc:nth-child(2) .ph::after { animation-delay: .9s; }
    html.motion .docs.in .doc:nth-child(3) .ph::after { animation-delay: 1.1s; }
    .doc:hover .ph::after { animation: glint-once 1.2s ease-in-out; }
    html.motion .claim p.in { transition-duration: 1.4s; }
}
@keyframes unveil { from { opacity: 0; transform: scale(1.14); } }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes line { from { transform: scaleX(0); } }
@keyframes glint { 0% { opacity: 1; background-position: 130% 0; } 30% { opacity: 1; background-position: -30% 0; } 31%, 100% { opacity: 0; background-position: -30% 0; } }
@keyframes glint-once { from { opacity: 1; background-position: 130% 0; } to { opacity: 1; background-position: -30% 0; } }

@media (max-width: 1080px) {
    .top .wrap { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; padding-bottom: 4px; 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 8px; }
    .nav a { padding: 10px 0; font-size: 14px; }
}
@media (max-width: 420px) { .nav a { font-size: 13px; } .nav { gap: 0 4px; } }
@media (max-width: 980px) {
    .hero { padding-top: 124px; }
    .hero .wrap, .space, .contact, .about-grid, .ct-grid { grid-template-columns: minmax(0, 1fr); }
    .hero figure { order: -1; align-self: auto; max-width: 560px; }
    .hero figure img { aspect-ratio: 16/9; }
    .hero .actions { margin-bottom: 48px; }
    .svc, .svc-list, .docs { grid-template-columns: 1fr; }
    .docs { gap: 64px; }
    .doc .ph { max-width: 400px; }
    .docs[data-mode="inline"] .doc { grid-template-columns: 1fr; gap: 0; }
    .docs[data-mode="inline"] .ph { margin-bottom: 24px; }
    .about-photo { max-width: 420px; }
    .emblem { max-width: 320px; }
    section { padding: 72px 0; }
    .claim { padding: 72px 0 0; }
    .page { padding: 40px 32px 72px; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .page { padding-left: 16px; padding-right: 16px; }
    .top .top-book { display: none; }
    .hero { padding-top: 112px; }
    .hero .facts { gap: 28px; }
    .ct-list dd { font-size: 20px; overflow-wrap: anywhere; }
    .ct-msgs a { display: inline-block; margin-right: 16px; }
    .hero h1 { font-size: 38px; }
    :lang(ka) .hero h1 { font-size: 29px; }
    .hero .lead { font-size: 17px; }
    .sticky-book { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30; box-shadow: 0 10px 30px rgba(10, 51, 41, .4); }
    body { padding-bottom: 80px; }
    body.hero-in .sticky-book { display: none; }
}

/* Форма обратной связи: строгая, поля с одной нижней линией, латунная черта над заголовком. */
[data-contact-form] {
    --cf-accent: var(--emerald);
    --cf-radius: 0;
    --cf-btn-radius: 2px;
    --cf-line-strong: rgba(15, 74, 60, .35);
    --cf-field-bg: transparent;
    --cf-error: #9c2b1d;
    --cf-bg: var(--marble);
    --cf-pad: 56px 0 0;
    border-top: 1px solid var(--brass);
}
.cf-intro h2 { font: 400 clamp(30px, 3.6vw, 44px)/1.15 var(--display); color: var(--emerald); }
:lang(ka) .cf-intro h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.3; }
.cf-field input[type=text], .cf-field input[type=tel], .cf-field textarea { border-width: 0 0 1px; padding-left: 2px; padding-right: 2px; }
.cf-field input[aria-invalid=true] { box-shadow: 0 1px 0 var(--cf-error); }
.cf-field > label, .cf-via legend { color: var(--brass-ink); }
.cf-pill span { border-radius: 2px; }
.cf-pill input:checked + span { background: var(--emerald); color: var(--marble); }
.cf-submit { background: var(--brass); color: var(--emerald-deep); }
.cf-submit:hover:not(:disabled) { filter: none; background: var(--brass-soft); }
.cf-done { background: var(--stone); border-color: var(--brass); }
.cf-done h2 { font-family: var(--display); font-weight: 400; color: var(--emerald); }
.cf-tick { border-radius: 0; background: var(--emerald); }
@media (max-width: 820px) { [data-contact-form] { --cf-pad: 36px 0 0; } }
