/* TurkEye Clinic — site styles
   Palette is taken from the logo (navy #212E65 on white) with a cool
   porcelain grey for quiet sections. */

/* Self-hosted fonts (variable woff2, Latin + Cyrillic incl. Tajik letters) */
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/literata-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/literata-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/literata-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/fonts/literata-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --navy: #212E65;
    --navy-deep: #18214C;
    --ink: #1C2344;
    --muted: #585F80;
    --porcelain: #F3F5FA;
    --line: #DCE1EC;
    --linen: #E8DFDB;
    --white: #FFFFFF;
    --on-navy-muted: #B9C0DC;

    --serif: "Literata", Georgia, "Times New Roman", serif;
    --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --section: clamp(72px, 10vw, 128px);
    --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font: 400 1.0625rem/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    color: var(--navy);
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5.2vw, 4.25rem); line-height: 1.06; letter-spacing: -0.02em; overflow-wrap: break-word; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.12; }
h3 { font-size: 1.25rem; line-height: 1.3; }
h4 { font-size: 1.1875rem; line-height: 1.3; }
p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.on-navy :focus-visible { outline-color: var(--white); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--navy); color: var(--white); padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 0 22px;
    border: 1px solid var(--navy); border-radius: 2px;
    font: 600 0.9375rem/1.25 var(--sans); text-decoration: none; text-align: center;
    padding-block: 8px;
    transition: background-color .2s ease, color .2s ease, transform .1s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--navy); color: var(--white); }
.btn-solid:hover { background: var(--navy-deep); }
.btn-line { background: transparent; color: var(--navy); }
.btn-line:hover { background: var(--porcelain); }
.on-navy .btn-solid { background: var(--white); color: var(--navy); border-color: var(--white); }
.on-navy .btn-solid:hover { background: var(--porcelain); }
.on-navy .btn-line { color: var(--white); border-color: rgba(255,255,255,.45); }
.on-navy .btn-line:hover { background: rgba(255,255,255,.08); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav > a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .9375rem; color: var(--ink); }
.nav > a[aria-current="page"] { color: var(--navy); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav > a:not(.btn):hover { color: var(--navy); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.lang { display: flex; gap: 2px; font-size: .8125rem; font-weight: 600; }
.lang a { padding: 6px 8px; text-decoration: none; color: var(--muted); border-radius: 2px; }
.lang a[aria-current="page"] { color: var(--navy); background: var(--porcelain); }
.lang a:hover { color: var(--navy); }
.header-cta { min-height: 42px; padding: 0 18px; }
.nav-toggle { display: none; }
.nav-contact { display: none; }

/* ---------- Hero ---------- */
.hero { padding: clamp(32px, 5vw, 64px) 0 clamp(24px, 4vw, 48px); }
.hero-grid {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(32px, 5vw, 72px); align-items: stretch;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding-block: 24px; }
.hero-copy h1 { text-wrap: balance; }
.hero-lead { margin: 28px 0 36px; max-width: 34em; font-size: 1.1875rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-where { display: none; }
.lang-switch { display: none; }

/* Live "open now" status (filled in by site.js in clinic time) */
.open-status { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; font-size: .9375rem; font-weight: 500; color: var(--ink); }
.open-status[hidden] { display: none; }
.open-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #B45309; }
.open-status.is-open::before { background: #1FA855; animation: live-dot 2.4s ease-out infinite; }
.open-status.on-dark { color: var(--white); margin: -8px 0 28px; }
@keyframes live-dot {
    0%   { box-shadow: 0 0 0 0 rgba(31,168,85,.45); }
    70%  { box-shadow: 0 0 0 8px rgba(31,168,85,0); }
    100% { box-shadow: 0 0 0 0 rgba(31,168,85,0); }
}
.hero-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
    margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--line);
    font-size: .9375rem;
}
.hero-facts dt { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.hero-facts dd { margin: 0; color: var(--muted); }

/* The eye chart: Sivtsev rows, largest to smallest, with acuity values. */
.chart {
    position: relative; margin: 0;
    background: var(--navy); color: var(--white);
    padding: clamp(32px, 4vw, 52px) clamp(24px, 3.5vw, 48px);
    display: flex; flex-direction: column; justify-content: center;
    min-height: 520px;
}
.chart-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55em; }
.chart-row {
    display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 16px;
    animation: focus-in .8s cubic-bezier(.2,.7,.2,1) both;
    animation-delay: calc(0.2s + var(--i) * 0.05s);
}
.chart-row span:first-child {
    text-align: center; font-family: var(--sans); font-weight: 700;
    letter-spacing: .32em; padding-left: .32em; line-height: 1;
    font-size: var(--size);
}
.chart-row span:last-child {
    font-size: .6875rem; color: var(--on-navy-muted); font-variant-numeric: tabular-nums;
    min-width: 3.2em; text-align: right;
}
@keyframes focus-in {
    from { filter: blur(9px); opacity: .25; }
    to   { filter: blur(0);   opacity: 1; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { margin: 0; color: var(--muted); max-width: 36em; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.about-photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--porcelain); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 35% 50%; }
.about-text h2 { margin-bottom: 28px; }
.about-text .lead { font-family: var(--serif); font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.5; color: var(--ink); }
.about-text p { max-width: 38em; }
.about-text p:not(.lead) { color: var(--muted); }

/* Services: an index in four groups, not a card grid */
.services { background: var(--porcelain); }
.service-groups { display: grid; gap: clamp(40px, 5vw, 56px); }
.service-group-title {
    font-size: 1.375rem; padding-bottom: 14px; border-bottom: 2px solid var(--navy);
}
.service-count {
    display: inline-grid; place-items: center; vertical-align: .15em; margin-left: 8px;
    min-width: 26px; height: 26px; padding: 0 6px;
    border-radius: 13px; background: var(--white); color: var(--navy);
    font: 600 .8125rem/1 var(--sans);
}
.service-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 88px);
}
.service-list li {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px;
    padding: 24px 0;
}
.service-list li:first-child::before, .service-list li:nth-child(2)::before { display: none; }
.service-list li::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: var(--line); transform-origin: left center;
}
.service-list h4 { font-size: 1.1875rem; min-width: 0; overflow-wrap: anywhere; }
/* The heading is a button so phones can expand it; on desktop it reads as plain text */
.service-toggle {
    all: unset; display: block; font: inherit; color: inherit; line-height: inherit;
    cursor: default; -webkit-tap-highlight-color: transparent;
    /* `all: unset` also resets wrapping; long single words (e.g. at 200% text) must still wrap */
    overflow-wrap: anywhere; min-width: 0;
}
.service-body { display: grid; grid-template-rows: 1fr; }
.service-body > p { min-height: 0; overflow: hidden; margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--muted); }

/* Doctors: navy section, same-scale round headshots, rows centred so the
   last row (7 = 4 + 3) sits balanced under the first. Cards are not links,
   so no borders, lifts or hover effects. */
.doctors { background: var(--navy); color: var(--white); }
.doctors h2 { color: var(--white); }
.doctors .section-head { grid-template-columns: 1fr; text-align: center; }
.doctor-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 48px 32px;
}
.doctor {
    flex: 0 1 clamp(170px, 20%, 236px); min-width: 0;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.doctor-photo {
    display: block; width: min(168px, 100%); height: auto; aspect-ratio: 1; margin-bottom: 20px;
    border-radius: 50%; object-fit: cover; background: #E9DFDC;
    box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 0 7px rgba(255,255,255,.05);
}
.doctor-title { margin: 0 0 4px; font-size: .8125rem; font-weight: 600; color: var(--on-navy-muted); }
.doctor h3 { color: var(--white); font-size: 1.25rem; margin-bottom: 8px; }
.doctor-spec { margin: 0; max-width: 22em; font-size: .9375rem; line-height: 1.5; color: #D6DBEF; }
.carousel-nav { display: none; }

/* Contact */
.contact { background: var(--navy); color: var(--white); }
.contact h2 { color: var(--white); margin-bottom: 36px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); }
.contact-phone {
    display: inline-block; font-family: var(--serif); font-size: clamp(1.75rem, 3vw, 2.375rem);
    text-decoration: none; margin-bottom: 24px; font-variant-numeric: lining-nums;
}
.contact-phone:hover { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }
.contact-details { margin: 0; display: grid; gap: 24px; }
.contact-details div { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); }
.contact-details dt { font-size: .8125rem; font-weight: 600; color: var(--on-navy-muted); margin-bottom: 6px; }
.contact-details dd { margin: 0; }
.contact-details a { text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 24px; }
.hours span:nth-child(odd) { color: var(--on-navy-muted); }
.map { display: flex; flex-direction: column; gap: 14px; min-height: 420px; }
.map-frame { flex: 1; min-height: 360px; background: var(--navy-deep); }
.map-frame iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; filter: grayscale(.25) contrast(1.05); }
.map-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.map-actions .btn { min-height: 44px; padding: 0 18px; font-size: .875rem; }
.map-actions .btn[hidden] { display: none; }
.carousel-progress { display: none; }

/* Footer */
.site-footer { background: var(--navy-deep); color: var(--on-navy-muted); padding: 40px 0; font-size: .875rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.footer-row img { height: 34px; width: auto; }
.footer-row nav { display: flex; gap: 24px; margin-left: auto; }
.footer-row a { text-decoration: none; color: var(--white); }
.footer-row a:hover { text-decoration: underline; }
/* Copyright and maker credit share the last line */
.footer-bottom {
    flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12);
}
.footer-bottom p { margin: 0; }
.credit { font-size: .8125rem; }
.credit a { color: var(--on-navy-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(185,192,220,.4); }
.credit a:hover { color: var(--white); text-decoration-color: currentColor; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 6vw, 88px); align-items: start; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    min-height: 44px; padding: 22px 0; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { font-size: 1.1875rem; }
.faq-item summary::after {
    content: ""; flex: none; width: 14px; height: 14px;
    background:
        linear-gradient(var(--navy), var(--navy)) center / 14px 1.5px no-repeat,
        linear-gradient(var(--navy), var(--navy)) center / 1.5px 14px no-repeat;
    transition: transform .35s var(--ease-out, ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.faq-item p { margin: 0 0 24px; max-width: 40em; color: var(--muted); }
@supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    .faq-item::details-content {
        block-size: 0; overflow: hidden;
        transition: block-size .4s cubic-bezier(.16, 1, .3, 1), content-visibility .4s allow-discrete;
    }
    .faq-item[open]::details-content { block-size: auto; }
}

/* Mobile quick-contact bar (replaces the floating bubbles on small screens) */
.mobile-bar { display: none; }

/* 404 */
.notfound { min-height: 100vh; display: grid; align-items: center; padding: 48px 0; }
.notfound .brand img { height: 44px; width: auto; }
.notfound h1 { margin: 48px 0 16px; }
.notfound p { margin: 0 0 4px; color: var(--muted); }
.notfound-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Floating chat */
.chat-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column; gap: 10px; }
.chat-float a {
    width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
    color: var(--white); box-shadow: 0 6px 18px rgba(24,33,76,.25);
}
.chat-float a svg { width: 26px; height: 26px; }
.chat-float .wa { background: #1FA855; }
.chat-float .tg { background: #229ED9; }

/* ---------- Motion ----------
   One easing for everything; on-load hero sequence in CSS, scroll reveals
   toggled by site.js (.js on <html> + .is-visible on the element). */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
@keyframes rise-in-place {
    from { transform: translateY(14px); }
    to   { transform: none; }
}
.hero-copy > * { animation: rise .6s var(--ease-out) both; }
/* The headline and lead are LCP candidates: slide only, never start invisible */
.hero-copy > h1, .hero-copy > .hero-lead { animation-name: rise-in-place; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(n+4) { animation-delay: .18s; }
.page-intro h1, .page-intro p { animation: rise .6s var(--ease-out) both; }
.page-intro p { animation-delay: .06s; }

@keyframes float-in {
    from { opacity: 0; transform: translateY(12px) scale(.9); }
    to   { opacity: 1; transform: none; }
}
.chat-float a { animation: float-in .5s var(--ease-out) both; animation-delay: .8s; }
.chat-float a + a { animation-delay: .88s; }
.chat-float a:hover { transform: translateY(-2px); transition: transform .2s ease; }

@keyframes blink {
    0%, 86%, 100% { transform: scaleY(1); }
    92% { transform: scaleY(.08); }
}

/* Generic reveal */
.js [data-reveal] {
    opacity: 0; transform: translateY(14px);
    transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* About photo opens like an eyelid. The clip sits on the image, not the
   observed box: IntersectionObserver treats a fully clipped target as unseen. */
.js [data-reveal="eyelid"] { opacity: 1; transform: none; }
.js [data-reveal="eyelid"] img {
    clip-path: inset(50% 0 50% 0); transform: scale(1.12);
    transition: clip-path .8s var(--ease-out), transform 1s var(--ease-out);
}
.js [data-reveal="eyelid"].is-visible img { clip-path: inset(0 0 0 0); transform: none; }

/* Service rows: the hairline draws, then the text settles */
.js [data-reveal="line"] { transform: translateY(10px); }
.js [data-reveal="line"]::before { transform: scaleX(0); transition: transform .6s var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
.js [data-reveal="line"].is-visible::before { transform: scaleX(1); }

/* Blog empty state: the mark blinks once when it appears */
.js .empty-state-inner.is-visible img { animation: blink 1.2s ease-in-out .3s 1 both; }

/* ---------- Page transitions ----------
   Cross-document View Transitions (Chrome/Edge 126+, Safari 18.2+; others
   simply navigate). The header is its own group so it stays put while the
   page beneath it fades out upward and the next one rises in. */
@view-transition { navigation: auto; }

.site-header { view-transition-name: site-header; }
.chat-float { view-transition-name: chat-float; }
.mobile-bar { view-transition-name: mobile-bar; }

@keyframes page-out {
    to { opacity: 0; transform: translateY(-12px); }
}
@keyframes page-in {
    from { opacity: 0; transform: translateY(18px); }
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* Sequential, not a cross-fade: the old page is gone before the new one
   arrives, so two layouts never overlap. */
::view-transition-old(root) { animation: page-out .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: page-in .6s var(--ease-out) .2s both; }
:root:active-view-transition-type(lang)::view-transition-old(site-header) { animation: fade-out .16s ease-in both; }
:root:active-view-transition-type(lang)::view-transition-new(site-header) { animation: fade-in .3s ease-out .14s both; }
.vt-arrive .hero-copy > *,
.vt-arrive .page-intro h1,
.vt-arrive .page-intro p,
.vt-arrive .chat-float a { animation: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .nav { gap: 20px; }
    .header-cta { display: none; }
    .service-list li { grid-template-columns: 1fr; gap: 8px; }
    .doctor-list { gap: 40px 24px; }
}

/* =====================================================================
   Phones & small tablets
   A calmer, thumb-first layout: the header gets out of the way while reading,
   the menu is a full-screen sheet, long lists collapse or swipe, and the
   call/WhatsApp/Telegram bar appears once the hero buttons are gone.
   ===================================================================== */
@media (max-width: 880px) {
    :root { --header-h: 64px; --section: 64px; }
    /* Keep focused elements clear of the bottom bar */
    html { -webkit-tap-highlight-color: transparent; scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    h2 { font-size: 1.875rem; }

    /* Header: solid (a backdrop-filter would trap the fixed menu inside it) */
    .site-header {
        background: var(--white); backdrop-filter: none;
        transition: transform .4s var(--ease-out), border-color .2s ease;
    }
    .site-header.is-hidden { transform: translateY(-100%); }
    .header-row { gap: 8px; }
    .brand { flex-shrink: 1; min-width: 0; }
    .brand img { height: 34px; max-width: 100%; }

    /* Language: always visible next to the menu button (code + globe, not a flag) */
    .lang-switch { display: block; position: relative; margin-left: auto; }
    .lang-switch-btn {
        display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
        border: 1px solid var(--line); border-radius: 22px; background: var(--white); color: var(--navy);
        font: 600 .875rem/1 var(--sans); cursor: pointer;
    }
    .lang-switch-btn svg { width: 18px; height: 18px; }
    .lang-menu {
        position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 184px;
        margin: 0; padding: 6px; list-style: none; background: var(--white);
        border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(24,33,76,.14);
    }
    .lang-menu[hidden] { display: none; }
    .lang-menu a {
        display: flex; align-items: center; min-height: 44px; padding: 0 12px;
        color: var(--ink); text-decoration: none; font-weight: 500;
    }
    .lang-menu a[aria-current="page"] { color: var(--navy); font-weight: 700; background: var(--porcelain); }

    /* Menu button: two lines that fold into an X */
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        margin-left: 4px; margin-right: -10px; width: 44px; height: 44px; padding: 0;
        background: none; border: 0; color: var(--navy); cursor: pointer;
    }
    .nav-toggle-bars { position: relative; width: 22px; height: 9px; }
    .nav-toggle-bars::before, .nav-toggle-bars::after {
        content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
        transition: transform .4s var(--ease-out);
    }
    .nav-toggle-bars::before { top: 0; }
    .nav-toggle-bars::after { bottom: 0; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(3.75px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-3.75px) rotate(-45deg); }

    /* Full-screen menu sheet */
    .nav {
        position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 60;
        display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
        padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom));
        background: var(--white); overflow-y: auto; overscroll-behavior: contain;
        visibility: hidden; opacity: 0; transform: translateY(-8px);
        transition: opacity .25s ease, transform .4s var(--ease-out), visibility 0s linear .4s;
    }
    .nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s ease, transform .4s var(--ease-out); }
    .nav > a:not(.btn) {
        font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; color: var(--navy);
        padding: 16px 0; border-bottom: 1px solid var(--line);
    }
    .nav > a:not(.btn):hover { text-decoration: none; }
    .nav > a[aria-current="page"] { text-decoration: none; }
    .nav.is-open > * { animation: rise .55s var(--ease-out) both; }
    .nav.is-open > :nth-child(2) { animation-delay: .04s; }
    .nav.is-open > :nth-child(3) { animation-delay: .08s; }
    .nav.is-open > :nth-child(4) { animation-delay: .12s; }
    .nav.is-open > :nth-child(5) { animation-delay: .16s; }
    .nav.is-open > :nth-child(n+6) { animation-delay: .2s; }
    .lang { gap: 8px; padding: 24px 0 4px; }
    .lang a {
        min-width: 56px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
        border: 1px solid var(--line); font-size: .875rem;
    }
    .lang a[aria-current="page"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
    .header-cta { display: flex; justify-content: center; margin-top: 20px; min-height: 52px; font-size: 1rem; }
    .nav-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
    .nav-contact .btn { justify-content: center; min-height: 52px; }
    .nav-contact .btn:first-child svg { color: #1FA855; }
    .nav-contact .btn:last-child svg { color: #229ED9; }
    html.menu-open { overflow: hidden; }

    /* Layout goes single column */
    /* minmax(0, …): a long word must never widen the column past the screen */
    .hero-grid, .about-grid, .contact-grid, .section-head, .faq-grid { grid-template-columns: minmax(0, 1fr); }
    .section-head { margin-bottom: 28px; }

    /* Hero: one navy panel. The eye chart is its opening image (it sharpens
       as the page loads), the headline and actions sit right beneath it. */
    .hero { background: var(--navy); color: var(--white); padding: 32px 0 32px; }
    .hero-grid { gap: 0; }
    .chart { display: none; }
    .lead-more { display: none; }
    .hero-copy { padding: 0; }
    /* Scales down on narrow phones so the longest word (e.g. «Профессиональное») fits whole */
    .hero-copy h1 { font-size: min(2.125rem, 9vw); }
    .hero-copy h1 { color: var(--white); }
    .hero-lead { font-size: 1.0625rem; margin: 16px 0 26px; color: var(--on-navy-muted); }
    .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .hero-actions .btn { justify-content: center; min-height: 52px; font-size: 1rem; }
    .hero .btn-solid { background: var(--white); color: var(--navy); border-color: var(--white); }
    .hero .btn-line { color: var(--white); border-color: rgba(255,255,255,.45); }
    .hero .open-status { color: var(--white); margin-top: 20px; }
    .hero-where {
        display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px;
        margin: 6px 0 0; font-size: .9375rem; color: var(--on-navy-muted);
    }
    .hero-where svg { width: 18px; height: 18px; flex: none; color: var(--white); }
    .hero-where a { color: var(--white); font-weight: 600; text-underline-offset: 3px; padding: 10px 0; }
    .hero :focus-visible { outline-color: var(--white); }
    .hero-facts { display: none; }

    /* About: heading and lead first, then the photo in the logo's almond eye
       shape (the eyelid reveal opens inside it), then the paragraph. */
    .about-grid { gap: 0; }
    .about-text { display: contents; }
    .about-text h2 { order: 1; margin-bottom: 16px; }
    .about-text .lead { order: 2; font-size: 1.1875rem; margin-bottom: 8px; }
    .about-photo {
        order: 3; aspect-ratio: 2 / 1; margin: 20px 0 28px; background: none;
        width: 100%; max-width: 520px; justify-self: center;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none'%3E%3Cpath d='M1 50C48-10 152-10 199 50C152 110 48 110 1 50Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none'%3E%3Cpath d='M1 50C48-10 152-10 199 50C152 110 48 110 1 50Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    }
    .about-photo img { object-position: 50% 46%; }
    .about-text p:not(.lead) { order: 4; }

    /* Services: an accordion of names; tap one to read it */
    .service-groups { gap: 32px; }
    .service-group-title { font-size: 1.25rem; padding-bottom: 10px; }
    .service-list { grid-template-columns: minmax(0, 1fr); }
    .service-list li { display: block; padding: 0; }
    .service-list li:nth-child(2)::before { display: block; }
    .service-list h4 { font-size: 1.0625rem; }
    .services-collapsible .service-toggle {
        display: flex; align-items: center; justify-content: space-between; gap: 16px;
        min-height: 56px; padding: 6px 0; cursor: pointer; box-sizing: border-box; width: 100%;
    }
    .services-collapsible .service-toggle::after {
        content: ""; flex: none; width: 12px; height: 12px;
        background:
            linear-gradient(var(--navy), var(--navy)) center / 12px 1.5px no-repeat,
            linear-gradient(var(--navy), var(--navy)) center / 1.5px 12px no-repeat;
        transition: transform .35s var(--ease-out);
    }
    .services-collapsible .is-open .service-toggle::after { transform: rotate(45deg); }
    .services-collapsible .service-toggle:focus-visible { outline-offset: -2px; }
    .services-collapsible .service-body { grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease-out); }
    .services-collapsible .is-open .service-body { grid-template-rows: 1fr; }
    .services-collapsible .service-body > p { padding-bottom: 0; transition: padding-bottom .4s var(--ease-out); }
    .services-collapsible .is-open .service-body > p { padding-bottom: 18px; }
    .services-collapsible li:not(.is-open) .service-body > p { visibility: hidden; transition: padding-bottom .4s var(--ease-out), visibility 0s .4s; }

    /* Doctors: a swipeable row of portraits with previous/next buttons */
    .doctors .section-head { text-align: left; }
    .doctor-list[data-carousel] {
        display: grid; grid-auto-flow: column; grid-auto-columns: min(72%, 280px); justify-content: start;
        gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
        margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px;
        scrollbar-width: none;
    }
    .doctor-list[data-carousel]::-webkit-scrollbar { display: none; }
    .doctor { scroll-snap-align: start; align-items: flex-start; text-align: left; }
    .doctor-photo { width: 100%; border-radius: 4px; box-shadow: none; margin-bottom: 16px; }
    .doctor h3 { font-size: 1.1875rem; margin-bottom: 6px; }
    .doctor-spec { max-width: none; }
    .carousel-nav { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
    .carousel-btn {
        flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
        border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: none; color: var(--white); cursor: pointer;
    }
    .carousel-btn svg { width: 20px; height: 20px; }
    .carousel-prev svg { transform: rotate(180deg); }
    .carousel-btn:disabled { opacity: .35; cursor: default; }
    .carousel-progress { display: block; flex: 1; position: relative; height: 2px; background: rgba(255,255,255,.22); overflow: hidden; }
    .carousel-progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: var(--white); }
    .carousel-count { margin: 0; min-width: 3.2em; text-align: center; font-size: .875rem; color: var(--on-navy-muted); font-variant-numeric: tabular-nums; }

    /* FAQ */
    .faq-item summary { padding: 18px 0; }
    .faq-item summary h3 { font-size: 1.0625rem; }

    /* Contact: the bottom bar already offers WhatsApp/Telegram; the map opens in the app */
    .contact h2 { margin-bottom: 24px; }
    .contact-actions { display: none; }
    .map { min-height: 0; }
    .map-frame { display: none; min-height: 300px; }
    .map.is-loaded .map-frame { display: block; }
    .map-frame iframe { min-height: 300px; }
    .map-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .map-actions .btn { justify-content: center; min-height: 48px; }
    .map-actions .map-show { grid-column: 1 / -1; }

    /* Footer */
    .footer-row nav a { display: inline-block; padding: 12px 0; }
    .credit a { display: inline-block; padding: 10px 0; }

    /* Bottom action bar (replaces the floating bubbles) */
    .chat-float { display: none; }
    .mobile-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1px;
        background: var(--line); border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgba(24,33,76,.08);
        transition: transform .45s var(--ease-out);
    }
    .bar-hidden .mobile-bar, .menu-open .mobile-bar { transform: translateY(calc(100% + 8px)); }
    .mobile-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: env(safe-area-inset-bottom); background: var(--white); z-index: -1; }
    .mobile-bar a {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        min-height: 56px; background: var(--white); color: var(--navy);
        font-weight: 600; font-size: .9375rem; text-decoration: none;
    }
    .mobile-bar a:active { background: var(--porcelain); }
    .mobile-bar svg { width: 20px; height: 20px; flex: none; }
    .mobile-bar .mb-call { background: var(--navy); color: var(--white); }
    .mobile-bar .mb-call:active { background: var(--navy-deep); }
    .mobile-bar .mb-wa svg { color: #1FA855; }
    .mobile-bar .mb-tg svg { color: #229ED9; }
    body { padding-bottom: calc(57px + env(safe-area-inset-bottom)); }

    /* Touch feedback */
    .btn:active { transform: scale(.98); }
}

@media (max-width: 520px) {
    .chart-row span:first-child { letter-spacing: .22em; }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Blog ---------- */
.page-intro { padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.page-intro h1 { margin-bottom: 20px; }
.page-intro p { margin: 0; max-width: 34em; font-size: 1.1875rem; color: var(--muted); }
.empty-state { background: var(--porcelain); }
.empty-state-inner { display: flex; flex-direction: column; align-items: flex-start; }
.empty-state-inner img { width: 88px; margin-bottom: 32px; }
.empty-state-inner h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 16px; }
.empty-state-inner p { color: var(--muted); margin-bottom: 28px; max-width: 36em; }
