/* =================================================================
   ACADEMIA DENTA — Components
   ================================================================= */

/* ===================== HEADER / NAV ===================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-header.scrolled {
  background: rgba(247,245,238,0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 76px;
}
.nav__logo { display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.nav__logo svg { height: 38px; width: auto; }
.nav__logo .logo-word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--graphite);
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.15rem, 0.6vw, 0.5rem);
  min-width: 0;
  flex-wrap: nowrap;
}
.nav__link {
  position: relative;
  padding: 0.5em 0.6em;
  font-size: clamp(0.82rem, 0.95vw, 0.9rem);
  font-weight: 500;
  color: var(--text);
  border-radius: 8px;
  transition: color 0.3s, background 0.3s;
  white-space: nowrap;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.6em; right: 0.6em; bottom: 0.32em;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover { color: var(--accent-deep); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.active { color: var(--accent-deep); font-weight: 600; }
.nav__link.active::after { transform: scaleX(1); }

.nav__right { display: flex; align-items: center; gap: 0.8rem; }

/* — Language switch — */
.langs { display: flex; align-items: center; gap: 2px; background: var(--olive-wash); border-radius: 100px; padding: 3px; }
.lang-btn {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  padding: 0.42em 0.7em;
  border-radius: 100px;
  transition: background 0.3s, color 0.3s;
  text-transform: uppercase;
}
.lang-btn.active { background: var(--accent); color: var(--paper); }
.lang-btn:not(.active):hover { background: rgba(167,167,81,0.18); }

.nav__cta { display: inline-flex; }

/* — Burger — */
.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  position: relative;
  background: var(--olive-wash);
}
.burger span {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--graphite);
  border-radius: 2px;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 26px; }
.burger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* — Mobile menu — */
.mobile-menu {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--cream);
  z-index: 99;
  padding: 2rem var(--gutter) 3rem;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  overflow-y: auto;
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--graphite);
  transition: color 0.3s, padding-left 0.3s;
}
.mobile-menu a:hover { color: var(--accent-deep); padding-left: 0.5rem; }
.mobile-menu .mm-cta { margin-top: 2rem; }

/* large desktop: everything fits */
/* tablet/medium/laptop: collapse nav links into burger so langs+CTA never overflow
   (Kazakh labels are long, so we collapse generously) */
@media (max-width: 1600px) {
  .nav__links { display: none; }
  .burger { display: block; }
}
/* small: also hide the desktop CTA (it lives in the mobile menu) */
@media (max-width: 560px) {
  .nav__cta { display: none; }
  .nav__logo .logo-word { font-size: 1rem; }
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--graphite);
  color: var(--cream);
  padding-block: clamp(3.5rem, 6vw, 5.5rem) 2rem;
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 3rem;
}
.footer-brand .logo-word { font-family: var(--font-display); font-size: 1.5rem; color: var(--cream); }
.footer-brand svg { height: 44px; margin-bottom: 1rem; }
.footer-brand p { color: rgba(247,245,238,0.6); max-width: 34ch; font-size: 0.95rem; }
.footer-col h4 {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive-soft);
  margin-bottom: 1.1rem;
}
.footer-col a, .footer-col p {
  display: block;
  color: rgba(247,245,238,0.7);
  font-size: 0.95rem;
  padding: 0.28rem 0;
  transition: color 0.3s, transform 0.3s;
  margin: 0;
}
.footer-col a:hover { color: var(--olive-soft); transform: translateX(3px); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.8rem;
  border-top: 1px solid rgba(247,245,238,0.12);
  font-size: var(--fs-small);
  color: rgba(247,245,238,0.5);
}
.footer-bottom a { color: rgba(247,245,238,0.65); }
.footer-bottom a:hover { color: var(--olive-soft); }
.footer-watermark {
  position: absolute;
  right: -2%;
  bottom: -38%;
  width: 340px;
  opacity: 0.05;
  pointer-events: none;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===================== TOOTH LINE (signature) ===================== */
/* The single-line tooth contour from the logo, drawn on scroll */
.tooth-line-svg { display: block; }
.tooth-line-svg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.tooth-line-svg .tl-gum { stroke-width: 2; opacity: 0.85; }

/* draw-on-view: stroke draws itself while gently fading in */
.draw-on-view path {
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  opacity: 0;
  transition: stroke-dashoffset 2s var(--ease), opacity 0.8s ease;
}
.draw-on-view.drawn path { stroke-dashoffset: 0; opacity: 1; }
.draw-on-view.drawn .tl-gum { transition-delay: 0.5s; }

/* divider with centered tooth */
.tooth-divider {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-block: clamp(2rem, 5vw, 4rem);
}
.tooth-divider::before, .tooth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.tooth-divider svg { height: 40px; width: auto; flex-shrink: 0; }

/* ===================== CARDS ===================== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s;
  will-change: transform;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }

/* service card */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.svc-card { padding: clamp(1.6rem, 3vw, 2.2rem); position: relative; }
.svc-card__num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--olive-soft);
  letter-spacing: 0.05em;
}
.svc-card__icon {
  width: 56px; height: 56px;
  margin: 1.2rem 0 1.4rem;
  color: var(--accent-deep);
}
.svc-card__icon svg { width: 100%; height: 100%; }
.svc-card h3 { font-size: var(--fs-h3); margin-bottom: 0.6rem; overflow-wrap: break-word; hyphens: auto; }
.svc-card p { color: var(--text-muted); font-size: 0.96rem; margin: 0; }
.svc-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 1.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-deep);
}
.svc-card__link .arw { transition: transform 0.35s var(--ease); }
.svc-card:hover .svc-card__link .arw { transform: translateX(4px); }

/* ===================== STORY CARDS (cases / reviews — IG-style vertical) ===================== */
.story-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 250px);
  gap: 1.1rem;
  overflow-x: auto;
  padding-bottom: 1.2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--olive-soft) transparent;
}
.story-rail::-webkit-scrollbar { height: 7px; }
.story-rail::-webkit-scrollbar-track { background: var(--sand); border-radius: 100px; }
.story-rail::-webkit-scrollbar-thumb { background: var(--olive-soft); border-radius: 100px; }

.story {
  scroll-snap-align: start;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--sand);
  cursor: pointer;
  border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.story:hover { transform: translateY(-5px) scale(1.012); box-shadow: var(--shadow); }
.story img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.story:hover img { transform: scale(1.06); }
.story__ring {
  position: absolute;
  inset: 9px;
  border-radius: calc(var(--radius) - 7px);
  border: 2px solid rgba(255,255,255,0.55);
  pointer-events: none;
  z-index: 2;
}
.story__cap {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 1.5rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(42,42,36,0.78));
  color: #fff;
}
.story__cap .t { font-weight: 700; font-size: 0.98rem; line-height: 1.2; }
.story__cap .s { font-size: 0.78rem; opacity: 0.85; margin-top: 0.2rem; }
.story__badge {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(252,251,247,0.92);
  color: var(--accent-deep);
  padding: 0.35em 0.7em;
  border-radius: 100px;
}

/* placeholder shimmer for empty stories */
.story.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sand), var(--olive-wash));
}
.story.placeholder::after {
  content: attr(data-label);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.85rem;
  opacity: 0.55;
  text-align: center;
  padding: 1rem;
}

/* ===================== GALLERY ===================== */
.gallery-grid {
  columns: 3;
  column-gap: 1rem;
}
.gallery-grid .g-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--sand);
  cursor: pointer;
}
.gallery-grid .g-item img { width: 100%; transition: transform 0.8s var(--ease); }
.gallery-grid .g-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(transparent 55%, rgba(111,111,53,0.35));
  opacity: 0;
  transition: opacity 0.4s;
}
.gallery-grid .g-item:hover img { transform: scale(1.05); }
.gallery-grid .g-item:hover::after { opacity: 1; }
@media (max-width: 860px) { .gallery-grid { columns: 2; } }
@media (max-width: 520px) { .gallery-grid { columns: 1; } }

/* ===================== PRICE TABLE ===================== */
.price-cat { margin-bottom: 2.5rem; }
.price-cat__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--olive-wash);
}
.price-cat__head h3 { font-size: var(--fs-h3); }
.price-cat__head .cnt { font-size: var(--fs-small); color: var(--text-muted); margin-left: auto; }
.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, padding-left 0.3s;
}
.price-row:hover { background: var(--olive-wash); padding-left: 0.8rem; border-radius: 8px; }
.price-row__name { font-weight: 500; }
.price-row__name .desc { display: block; font-size: var(--fs-small); color: var(--text-muted); font-weight: 400; margin-top: 0.15rem; }
.price-row__val {
  font-family: var(--font-display);
  font-size: 1.05rem;
  white-space: nowrap;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.price-row__val .from { font-family: var(--font-body); font-size: 0.74rem; font-weight: 500; color: var(--text-muted); margin-right: 0.3em; text-transform: lowercase; }
.price-cat__note {
  margin: 1rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--olive-wash);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--accent-deep);
  line-height: 1.5;
}

/* ===================== DOCTORS ===================== */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.6rem;
}
.doc-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.doc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.doc-card__photo { aspect-ratio: 3/4; background: linear-gradient(160deg, var(--olive-wash), var(--sand)); position: relative; overflow: hidden; }
.doc-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.doc-card__photo .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--olive-soft);
}
.doc-card__photo .ph svg { width: 80px; height: 80px; opacity: 0.5; }
.doc-card__body { padding: 1.3rem 1.4rem 1.6rem; }
.doc-card__body .role { font-size: var(--fs-eyebrow); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-deep); font-weight: 600; }
.doc-card__body h3 { font-size: 1.25rem; margin: 0.4rem 0 0.5rem; }
.doc-card__body .exp { font-size: var(--fs-small); color: var(--text-muted); }
.doc-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.doc-card__tags .pill { font-size: 0.74rem; padding: 0.3em 0.7em; }
.doc-card__desc { margin: 0.9rem 0 0; font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }

/* — Instagram "more" link — */
.insta-link {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.85em 1.5em;
  border-radius: 100px;
  background: var(--olive-wash);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s;
}
.insta-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--olive-soft); color: var(--graphite); }
.insta-link svg { flex-shrink: 0; }

/* ===================== FORM ===================== */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-size: var(--fs-small); font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.field label .req { color: var(--accent-deep); }
.input, .textarea, .select {
  width: 100%;
  padding: 0.9em 1.1em;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(167,167,81,0.14);
}
.textarea { resize: vertical; min-height: 120px; }
.field-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.field-error { font-size: 0.8rem; color: #b4452f; margin-top: 0.4rem; display: none; }
.field.invalid .input, .field.invalid .textarea { border-color: #c9694f; }
.field.invalid .field-error { display: block; }

.form-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.55em 1em;
  border-radius: 100px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.25s var(--ease);
}
.chip:hover { border-color: var(--olive-soft); }
.chip.sel { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.form-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin: 0.9rem 0 0; line-height: 1.5; }

/* ===================== STATS ===================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--accent-deep); line-height: 1; }
.stat .lab { font-size: var(--fs-small); color: var(--text-muted); margin-top: 0.5rem; }

/* ===================== LIGHTBOX ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26,26,22,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; animation: lbIn 0.35s var(--ease); }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.lightbox__close {
  position: absolute; top: 24px; right: 28px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(252,251,247,0.12);
  color: #fff;
  font-size: 1.6rem;
  display: grid; place-items: center;
  transition: background 0.3s, transform 0.3s;
}
.lightbox__close:hover { background: rgba(252,251,247,0.25); transform: rotate(90deg); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(252,251,247,0.12);
  color: #fff;
  font-size: 1.5rem;
  display: grid; place-items: center;
  transition: background 0.3s;
}
.lightbox__nav:hover { background: rgba(252,251,247,0.28); }
.lightbox__nav.prev { left: 20px; }
.lightbox__nav.next { right: 20px; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

/* ===================== REVEAL ANIMATION ===================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-stagger.in > * { opacity: 1; transform: none; }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.40s; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 0.47s; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 0.54s; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--graphite);
  color: var(--cream);
  padding: 1em 1.6em;
  border-radius: 100px;
  box-shadow: var(--shadow);
  z-index: 1100;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.6em;
  transition: transform 0.5s var(--ease);
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { color: var(--olive-soft); flex-shrink: 0; }
