/* Визитка врача Рашида Гасанова. Цвета — из логотипа Ortodont Rashid: синий круг, серо-голубое кольцо,
   белый зуб, почти чёрный фон. Порядок разделов: знакомство → о враче → работы → случаи → методы →
   путь пациента → образование → адрес → отзывы. Страница рассчитана на телефон (QR-код, NFC-метка). */
:root {
  --bg: #080c15;
  --bg-2: #0f1626;
  --navy: #1f3a6b;
  --navy-deep: #142849;
  --ring: #8b9bb2;
  --mist: #b9c5d5;
  --enamel: #f3f5f8;
  --line: rgba(139, 155, 178, 0.18);
  --serif: "Forum", "Times New Roman", serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(120% 50% at 50% 0%, #0f1a30 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--enamel); font: 400 16px/1.55 var(--sans);
}
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.05; }
h3 { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--mist); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.skip { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--enamel); color: var(--bg); z-index: 30; }
.skip:focus { top: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

#tooth-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.no-3d #tooth-canvas { display: none; }

.card { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }


/* ---------- 1. знакомство ---------- */
.hero { text-align: center; }
.hero-photo { position: relative; margin: 0 auto; width: min(80%, 330px); }
.hero-photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%;
  border-radius: 50% 50% 24px 24px / 36% 36% 24px 24px;
  border: 1px solid var(--line); background: var(--bg-2);
}
.no-photo img { visibility: hidden; }
/* круглый знак Ortodont Rashid у нижнего края фото: синий круг в кольце, внутри живой 3D-зуб */
.badge {
  position: absolute; right: -34px; bottom: -24px; width: 112px; aspect-ratio: 1; border-radius: 50%;
  border: 6px solid rgba(139, 155, 178, 0.75);
  background: radial-gradient(circle at 50% 36%, #2a4a84 0%, var(--navy) 50%, var(--navy-deep) 100%);
  box-shadow: 0 0 0 4px var(--bg), 0 18px 40px -16px rgba(0, 0, 0, 0.8);
}
.spot { position: absolute; left: 20%; top: 4%; width: 60%; aspect-ratio: 1; }
.spot-fallback { position: absolute; inset: 10%; width: 80%; height: 80%; transition: opacity .4s; }
.has-3d .spot-fallback { opacity: 0; }
.badge-word {
  position: absolute; left: 8%; right: 8%; top: 64%; margin: 0;
  font: 400 10.5px/1.05 var(--serif); letter-spacing: .08em; text-transform: uppercase; color: var(--enamel);
}

.name { margin-top: 34px; font-size: clamp(2.2rem, 10vw, 2.9rem); text-wrap: balance; }
.role { margin: 8px 0 0; color: var(--ring); font-size: 15px; }

.hero-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.btn {
  display: grid; place-items: center; min-height: 54px; padding: 0 14px;
  border-radius: 27px; border: 1px solid var(--ring); background: transparent;
  color: var(--enamel); font: 500 16px/1.2 var(--sans); text-decoration: none; text-align: center; cursor: pointer;
}
.btn-main { background: var(--enamel); border-color: var(--enamel); color: var(--bg); }
.btn-main:hover { background: #fff; }
.btn-wide { grid-column: 1 / -1; }
.act {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 76px; padding: 10px 4px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--enamel); font: 500 13.5px/1.2 var(--sans); text-decoration: none;
}
.act:hover { border-color: var(--ring); }
.act-ico { width: 24px; height: 24px; color: var(--mist); }
.payment { margin: 14px 0 0; color: var(--mist); font-size: 14px; }

/* ---------- разделы ---------- */
.sec { margin-top: 48px; scroll-margin-top: 16px; }
.sec h2 { font-size: clamp(1.9rem, 8.4vw, 2.3rem); }
.note { margin: 8px 0 14px; color: var(--ring); font-size: 14px; }
.lead { margin: 12px 0 0; color: var(--mist); }
.sub-h { margin: 22px 0 0; font: 500 15px/1.3 var(--sans); color: var(--ring); }

/* о враче */
.focus { display: grid; gap: 10px; margin-top: 18px; }
.focus-item { padding: 16px 18px; border-left: 2px solid var(--ring); background: linear-gradient(90deg, rgba(31, 58, 107, .35), transparent); border-radius: 0 16px 16px 0; }
.focus-item h3 { font: 400 1.35rem/1.15 var(--serif); }
.focus-item p { margin: 6px 0 0; color: var(--mist); font-size: 15px; }
.approach { margin: 22px 0 0; padding: 20px 18px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); }
.approach h3 { font: 500 15px/1.3 var(--sans); color: var(--ring); }
.approach blockquote { margin: 10px 0 0; font: 400 1.18rem/1.45 var(--serif); }
.approach blockquote p { margin: 0; }
.approach blockquote p + p { margin-top: 10px; }
.approach figcaption { margin-top: 12px; color: var(--ring); font-size: 14px; }

/* до / после */
.cases-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.case-tab {
  min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--mist);
  font: 500 14px/1 var(--sans); cursor: pointer;
}
.case-tab[aria-selected="true"] { background: var(--enamel); border-color: var(--enamel); color: var(--bg); }
.ba { margin: 0; }
.ba-frame { position: relative; aspect-ratio: 640 / 420; border-radius: 20px; overflow: hidden; background: var(--bg-2); --pos: 50%; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--enamel); pointer-events: none; }
.ba-line::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%; background: var(--enamel); box-shadow: 0 0 0 4px rgba(8, 12, 21, 0.35);
  background-image: linear-gradient(90deg, transparent 13px, var(--navy) 13px 15px, transparent 15px 23px, var(--navy) 23px 25px, transparent 25px);
}
.ba-tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 13px; background: rgba(8, 12, 21, 0.7); color: var(--enamel); pointer-events: none; }
.ba-tag-before { left: 12px; }
.ba-tag-after { right: 12px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba-range:focus-visible + .ba-line, .ba-frame:focus-within .ba-line::after { box-shadow: 0 0 0 4px var(--mist); }
.ba-cap { display: grid; gap: 2px; margin-top: 10px; }
.ba-cap strong { font-weight: 500; }
.ba-cap span { color: var(--ring); font-size: 15px; }


/* методы лечения: строки с тонкими разделителями */
.methods { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.methods li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.methods h3 { font: 500 16px/1.3 var(--sans); }
.methods p { margin: 4px 0 0; color: var(--mist); font-size: 15px; }

/* путь пациента: шаги по порядку, слева номер и линия */
.path { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; }
.path li { counter-increment: step; position: relative; padding: 0 0 20px 54px; }
.path li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); border: 2px solid rgba(139, 155, 178, .6);
  font: 400 1.2rem/1 var(--serif); color: var(--enamel);
}
.path li::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--line); }
.path li:last-child { padding-bottom: 0; }
.path li:last-child::after { display: none; }
.path h3 { font: 500 16px/1.3 var(--sans); padding-top: 5px; }
.path p { margin: 4px 0 0; color: var(--mist); font-size: 15px; }

/* образование */
.experience { margin: 14px 0 0; font: 400 1.6rem/1.2 var(--serif); }
.facts { margin: 10px 0 0; padding: 0 0 0 18px; color: var(--mist); }
.facts li + li { margin-top: 6px; }
.courses { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.courses li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 10px; color: var(--mist); }
.c-year { color: var(--ring); font-variant-numeric: tabular-nums; }
.certs { list-style: none; margin: 12px -16px 0; padding: 0 16px 6px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.certs li { flex: 0 0 78%; scroll-snap-align: start; }
.certs a { display: grid; gap: 8px; text-decoration: none; color: var(--mist); font-size: 14px; }
.certs img { display: block; width: 100%; height: auto; aspect-ratio: 754 / 530; object-fit: cover; object-position: top; border-radius: 14px; background: #fff; }

/* адрес и запись */
.links { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a, .links button {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  width: 100%; padding: 14px 4px; min-height: 68px;
  background: none; border: 0; color: var(--enamel); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.links a:hover, .links button:hover { background: rgba(139, 155, 178, 0.06); }
.ico { grid-row: 1 / 3; width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: var(--navy); color: var(--enamel); }
.l-title { font-weight: 500; line-height: 1.25; }
.l-sub { color: var(--ring); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.share-status { min-height: 1.2em; margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--mist); }
.clinic {
  display: grid; gap: 2px; margin-top: 12px; padding: 18px 20px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2); text-decoration: none;
}
.clinic:hover { border-color: var(--ring); }
.clinic-sub { color: var(--ring); font-size: 14px; }
.clinic-name { font: 400 1.6rem/1.1 var(--serif); }

/* отзывы */
.review-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.review { padding: 16px 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2); }
.review h3 { margin: 0 0 8px; font: 500 15px/1.3 var(--sans); color: var(--ring); }
.review-text { margin: 0; color: var(--mist); }
.review.is-long:not(.is-open) .review-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.review-more { margin-top: 8px; padding: 6px 0; border: 0; background: none; color: var(--enamel); font: 500 14px/1.2 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.foot { margin-top: 40px; text-align: center; font-size: 12.5px; color: var(--ring); }
.foot p { margin: 0 0 4px; }

/* закреплённая панель внизу */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 480px; margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 12, 21, 0), rgba(8, 12, 21, .92) 30%);
}
.bar a {
  display: grid; place-items: center; min-height: 50px; border-radius: 25px;
  border: 1px solid var(--ring); background: var(--bg); color: var(--enamel); text-decoration: none; font-weight: 500; font-size: 15px;
}
.bar .bar-main { background: var(--enamel); border-color: var(--enamel); color: var(--bg); }

/* QR на экране */
.qr-dialog {
  width: min(340px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 24px;
  background: var(--bg-2); color: var(--enamel); text-align: center;
}
.qr-dialog::backdrop { background: rgba(5, 8, 14, 0.82); }
.qr-dialog h2 { font-size: 1.7rem; margin-bottom: 14px; }
.qr-dialog img { display: block; width: 100%; height: auto; border-radius: 14px; background: #fff; }
.qr-dialog p { margin: 12px 0 16px; color: var(--mist); font-size: 15px; }
.qr-dialog .btn { width: 100%; }

@media (prefers-reduced-motion: reduce) { .spot-fallback { transition: none; } }

/* нижняя панель появляется, когда кнопки первого экрана ушли из виду */
.bar { transform: translateY(110%); transition: transform .25s ease; }
.bar-on .bar { transform: none; }
@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }
