/* ==========================================================================
   Khatuna Mindeli — psychologist website
   Shared styles for /ka/ and /ru/
   ========================================================================== */

:root {
  --bg: #f6f2ea;
  --bg-alt: #efe9dd;
  --surface: #fffdf8;
  --ink: #1d2823;
  --muted: #56635b;
  --sage: #7a9a86;
  --sage-deep: #3d5b49;
  --sage-deeper: #2f4939;
  --sage-pale: #dfe9e1;
  --clay: #b9795a;
  --line: #e2dccf;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --shadow-sm: 0 1px 2px rgba(29, 40, 35, 0.05), 0 4px 14px rgba(29, 40, 35, 0.05);
  --shadow: 0 2px 4px rgba(29, 40, 35, 0.04), 0 18px 44px rgba(29, 40, 35, 0.09);

  --font-body: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Lora Variable', Georgia, 'Times New Roman', serif;

  --container: 1120px;
  --gutter: 24px;
  --header-h: 68px;
}

html:lang(ka) {
  --font-body: 'Noto Sans Georgian Variable', 'Inter Variable', system-ui, sans-serif;
  --font-head: 'Noto Serif Georgian Variable', 'Lora Variable', Georgia, serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--sage-deep);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(246, 242, 234, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 6px 24px rgba(29, 40, 35, 0.05);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  min-width: 0;
}
.brand-mark {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sage-deep);
  color: #fff;
  font-size: 1rem;
}
.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}
.lang-switch [lang='ka'] {
  font-family: 'Noto Sans Georgian Variable', system-ui, sans-serif;
}
.lang-switch a,
.lang-switch span {
  padding: 5px 13px;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.4;
}
.lang-switch a {
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lang-switch a:hover {
  color: var(--ink);
  background: var(--bg-alt);
}
.lang-switch [aria-current='true'] {
  background: var(--sage-deep);
  color: #fff;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--sage-deep);
  color: #fff;
  box-shadow: 0 8px 22px rgba(61, 91, 73, 0.28);
}
.btn-primary:hover {
  background: var(--sage-deeper);
}
.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border-color: var(--sage);
}
.btn-ghost:hover {
  background: var(--sage-pale);
}
.btn-light {
  background: #fff;
  color: var(--sage-deeper);
}
.btn-light:hover {
  background: var(--bg);
}
.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}
.btn-sm {
  padding: 9px 18px;
  font-size: 0.9rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--clay);
  border-radius: 2px;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
  margin-bottom: 14px;
}
.hero-role {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--sage-deep);
  margin-bottom: 22px;
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 30px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.facts svg {
  width: 17px;
  height: 17px;
  color: var(--sage-deep);
  flex: none;
}

.portrait-wrap {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
}
.portrait-wrap::before {
  content: '';
  position: absolute;
  inset: 8% -8% -6% 10%;
  background: var(--sage-pale);
  border-radius: 220px 220px var(--radius-lg) var(--radius-lg);
  transform: rotate(3deg);
  z-index: 0;
}
.portrait-wrap::after {
  content: '';
  position: absolute;
  width: 112px;
  height: 112px;
  right: -26px;
  bottom: 38px;
  border-radius: 50%;
  background: var(--clay);
  opacity: 0.18;
  z-index: 0;
}
.portrait {
  position: relative;
  z-index: 1;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 220px 220px var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #cfdcd2, #b7cbbc);
  box-shadow: var(--shadow);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: var(--font-head);
  font-size: clamp(5rem, 14vw, 8rem);
  color: rgba(61, 91, 73, 0.55);
}
.portrait.is-empty img {
  display: none;
}
.portrait.is-empty .portrait-fallback {
  display: grid;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(56px, 8vw, 104px) 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section-head {
  max-width: 40rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}
.section-head p {
  margin-top: 14px;
  color: var(--muted);
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about-text p {
  color: var(--muted);
}
.about-text p:first-of-type {
  font-size: 1.2rem;
  color: var(--ink);
}
.stat-row {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--sage-deep);
}
.stat span {
  font-size: 0.9rem;
  color: var(--muted);
}

.cred-stack {
  display: grid;
  gap: 16px;
}
.cred {
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.cred h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cred h3::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--clay);
  flex: none;
}
.cred ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.cred li {
  position: relative;
  padding-left: 18px;
  font-size: 0.975rem;
  line-height: 1.6;
}
.cred li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 1.5px;
  background: var(--sage);
}
.cred .by {
  display: block;
  margin-top: 3px;
  font-size: 0.85rem;
  color: var(--muted);
}
.cred .by em {
  font-style: normal;
  font-weight: 600;
  color: var(--sage-deep);
}

/* Topics */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.topic {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.topic:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--sage-pale);
}
.topic-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--sage-pale);
  color: var(--sage-deep);
  margin-bottom: 20px;
}
.topic-icon svg {
  width: 26px;
  height: 26px;
}
.topic h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Process */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
  padding: 0;
  margin: 0;
  list-style: none;
}
.step {
  position: relative;
  padding: 34px 28px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  counter-increment: step;
}
.step::before {
  content: counter(step);
  display: block;
  font-family: var(--font-head);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--clay);
  opacity: 0.75;
  margin-bottom: 14px;
}
.step h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.975rem;
}
.hint {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 22px 26px;
  background: var(--sage-pale);
  border-radius: var(--radius);
  color: var(--sage-deeper);
}
.hint svg {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
}
.hint p {
  margin: 0;
}

/* Certificates */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 20px;
}
.cert {
  margin: 0;
  display: flex;
}
.cert-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cert-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.cert-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}
.cert-frame img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
}
.cert-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--sage);
}
.cert-placeholder svg {
  width: 44px;
  height: 44px;
}
.cert.is-empty .cert-frame img {
  display: none;
}
.cert.is-empty .cert-placeholder {
  display: grid;
}
.cert.is-empty .cert-btn {
  cursor: default;
}
.cert figcaption {
  padding: 16px 18px 18px;
}
.cert figcaption strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}
.cert figcaption span {
  font-size: 0.85rem;
  color: var(--muted);
}

.lightbox {
  width: min(94vw, 1000px);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(20, 28, 24, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: 92vh;
}
.lightbox img {
  width: 100%;
  max-height: calc(92vh - 76px);
  object-fit: contain;
  background: var(--bg-alt);
}
.lightbox-caption {
  padding: 16px 64px 18px 22px;
  font-size: 0.95rem;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.lightbox-close svg {
  width: 20px;
  height: 20px;
}

/* FAQ */

.faq {
  max-width: 48rem;
  display: grid;
  gap: 12px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.25s;
}
.faq details[open] {
  box-shadow: var(--shadow-sm);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '';
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    linear-gradient(var(--sage-deep), var(--sage-deep)) center / 10px 1.8px no-repeat,
    linear-gradient(var(--sage-deep), var(--sage-deep)) center / 1.8px 10px no-repeat,
    var(--sage-pale);
  transition: transform 0.25s ease;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq .answer {
  padding: 0 24px 22px;
  color: var(--muted);
}
.faq .answer p {
  margin: 0;
}

/* Contact */

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 7vw, 80px) clamp(24px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--sage-deep), var(--sage-deeper));
  color: #fff;
  text-align: center;
}
.contact-card::before,
.contact-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.contact-card::before {
  width: 340px;
  height: 340px;
  left: -120px;
  top: -140px;
}
.contact-card::after {
  width: 260px;
  height: 260px;
  right: -80px;
  bottom: -120px;
}
.contact-card > * {
  position: relative;
  z-index: 1;
}
.contact-card h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.7rem);
  margin-bottom: 14px;
}
.contact-card p {
  max-width: 34rem;
  margin: 0 auto 30px;
  color: rgba(255, 255, 255, 0.82);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.contact-card .handle {
  margin: 26px auto 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Footer */

.site-footer {
  padding: 36px 0 44px;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .topic,
  .cert-btn {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 400px) {
  .brand-mark {
    display: none;
  }
}

@media (max-width: 960px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .portrait-wrap {
    order: -1;
    width: min(78%, 320px);
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 20px;
    --header-h: 62px;
  }
  body {
    font-size: 1rem;
  }
  .header-cta {
    display: none;
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  .brand-name {
    font-size: 0.95rem;
  }
  .lang-switch {
    font-size: 0.8rem;
  }
  .lang-switch a,
  .lang-switch span {
    padding: 4px 10px;
  }
  .topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-cta .btn,
  .contact-actions .btn {
    width: 100%;
  }
  .stat-row {
    gap: 24px;
  }
  .cred {
    padding: 22px 20px;
  }
  .faq summary {
    padding: 18px 18px;
  }
  .faq .answer {
    padding: 0 18px 20px;
  }
}

/* ---------- Language chooser (root index.html) ---------- */

html.pending body {
  visibility: hidden;
}
.choose-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
}
.choose-card {
  width: min(100%, 460px);
  padding: clamp(36px, 8vw, 56px) clamp(24px, 6vw, 48px);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.choose-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--bg);
}
.choose-name {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.25;
}
.choose-role,
.choose-prompt {
  margin: 0;
  color: var(--muted);
}
.choose-prompt {
  margin-top: 30px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.choose-actions {
  display: grid;
  gap: 12px;
}
.choose-actions .btn {
  padding: 15px 24px;
  font-size: 1.05rem;
}
.choose [lang='ka'],
.choose-card [lang='ka'] {
  font-family: 'Noto Sans Georgian Variable', system-ui, sans-serif;
}
.choose-name [lang='ka'] {
  font-family: 'Noto Serif Georgian Variable', Georgia, serif;
}
.choose-name [lang='ru'] {
  font-family: 'Lora Variable', Georgia, serif;
}
