/*
Theme Name:  KeyArtHouse
Description: Преміальний односторінковий сайт-візитка для майстерні автомобільних ключів. Контент редагується через ACF PRO (Налаштування сайту).
Author:      KeyArtHouse
Version:     1.0.0
Text Domain: keyarthouse
*/

:root{
  --cream:      #faf8f3;
  --cream-2:    #f2ede2;
  --white:      #ffffff;
  --navy:       #10192c;
  --navy-2:     #1c2c48;
  --gold:       #a9812f;
  --gold-light: #d9b97a;
  --blue:       #3d76b3;
  --text:       #1c2333;
  --text-muted: #6a7180;
  --text-on-navy: #eef1f6;
  --text-on-navy-muted: #aab4c8;
  --ink:        rgb(13,18,22);
  --border:     rgba(16,25,44,0.09);
  --shadow-sm:  0 2px 10px rgba(16,25,44,0.06);
  --shadow-md:  0 12px 32px rgba(16,25,44,0.10);
  --shadow-lg:  0 20px 50px rgba(16,25,44,0.14);
  --radius:     16px;
  --ff-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--ff-body);
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img{ max-width: 100%; display:block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin:0; padding:0; }
.icon{ width: 20px; height: 20px; flex-shrink:0; }

/* ---------- Top bar ---------- */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,18,22,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.topbar.scrolled{
  border-bottom-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.topbar__inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
  color: var(--text-on-navy);
}
.topbar__logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
}
.topbar__right{
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar__socials{
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__social{
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-on-navy);
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.topbar__social svg{ width: 15px; height: 15px; }
.topbar__social:hover{
  transform: translateY(-2px);
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.topbar__phone{
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-navy);
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.topbar__phone:hover{
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

/* ---------- Shared ---------- */
.eyebrow{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}
.eyebrow--light{ color: var(--gold-light); }
.eyebrow__line{
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .6;
  flex-shrink: 0;
}
.eyebrow__num{
  font-family: var(--ff-head);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: .75;
}

.section-title{
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--navy);
  margin: 0 0 18px;
}
.section-title--light{ color: var(--text-on-navy); }

.lead{
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 460px;
  margin: 0 0 40px;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap;
}
.btn--primary{
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: var(--text-on-navy);
  box-shadow: var(--shadow-md);
}
.btn--primary::after{
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .65s ease;
}
.btn--primary:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn--primary:hover::after{ left: 130%; }

/* ---------- Scroll reveal ---------- */
.reveal{
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s cubic-bezier(.16,.8,.24,1), transform .8s cubic-bezier(.16,.8,.24,1);
}
.reveal.in-view{
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero (screen 1) ---------- */
.hero{
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 82% 8%, rgba(217,185,122,0.16), transparent 60%),
    radial-gradient(55% 50% at 12% 92%, rgba(61,118,179,0.10), transparent 60%),
    var(--cream);
}
.hero__bg{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hero__photo{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__photo.loaded{ opacity: 1; }
.hero__overlay{
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(60% 60% at 50% 36%, rgba(250,248,243,.32) 0%, rgba(250,248,243,.9) 66%, var(--cream) 100%),
    linear-gradient(180deg, rgba(250,248,243,.35), rgba(250,248,243,.55) 55%, var(--cream) 100%);
  transition: opacity 1s ease;
}
.hero__bg.has-photo .hero__overlay{ opacity: 1; }
.hero__key{
  position: absolute;
  top: 8%;
  right: -60px;
  width: 340px;
  height: 340px;
  color: var(--navy);
  opacity: .05;
  transform: rotate(8deg);
}
.hero__bg.has-photo .hero__key{ opacity: .07; color: var(--white); mix-blend-mode: overlay; }
.hero__content{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
}
.hero__logo{
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 22px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 10px;
}
.hero__title{
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--navy);
  margin: 0 0 16px;
  letter-spacing: .01em;
}
.hero__title span{ color: var(--gold); }
.hero__subtitle{
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.6;
  letter-spacing: .003em;
  margin: 0 0 40px;
  max-width: 480px;
}
.hero__cta{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.messengers{
  display: flex;
  align-items: center;
  gap: 14px;
}
.messenger{
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--navy-2);
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease, background .25s ease;
}
.messenger svg{ width: 22px; height: 22px; }
.messenger:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.messenger--tg:hover{ background: #29a9eb; color: #fff; }
.messenger--wa:hover{ background: #29a71a; color: #fff; }
.messenger--vb:hover{ background: #7360f2; color: #fff; }

.hero__meta{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hero__meta-item{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .2s ease;
}
.hero__meta-item svg{ width: 17px; height: 17px; flex-shrink: 0; color: var(--gold); }
.hero__meta-item em{ font-style: normal; color: var(--text-muted); opacity: .75; font-weight: 500; }
a.hero__meta-item:hover{ color: var(--navy); }
.hero__meta-divider{
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .5;
  flex-shrink: 0;
}

.scroll-hint{
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  opacity: .5;
  animation: bounce 2.4s ease-in-out infinite;
}
.scroll-hint svg{ width: 22px; height: 22px; }
@keyframes bounce{
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- About / advantages (screen 2) ---------- */
.about{
  background: var(--white);
  padding: 100px 24px;
}
.about__inner{
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.features{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
}
.feature{
  display: flex;
  flex-direction: column;
}
.feature__row{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.feature__photo{
  display: none;
}
.feature--wide{ grid-column: 1 / -1; }
.about__text.reveal .feature{
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.16,.8,.24,1), transform .6s cubic-bezier(.16,.8,.24,1);
}
.about__text.in-view .feature{ opacity: 1; transform: translateY(0); }
.feature:nth-child(1){ transition-delay: .12s; }
.feature:nth-child(2){ transition-delay: .19s; }
.feature:nth-child(3){ transition-delay: .26s; }
.feature:nth-child(4){ transition-delay: .33s; }
.feature:nth-child(5){ transition-delay: .4s; }
.feature__icon{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-2);
  color: var(--gold);
}
.feature__icon svg{ width: 21px; height: 21px; }
.feature h3{
  font-family: var(--ff-head);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  margin: 0;
}
.feature__note{
  display: block;
  font-family: var(--ff-body);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
}

.photo-frame{
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
  background: linear-gradient(150deg, var(--cream-2), #e8e0d0);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.placeholder-content{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}
.placeholder-content svg{
  width: 44px;
  height: 44px;
  color: var(--gold);
  opacity: .8;
}
.placeholder-content span{
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.photo-frame img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}
.photo-frame img.loaded{ opacity: 1; }
.photo-frame img.loaded ~ .placeholder-content{ display: none; }

/* ---------- Gallery ---------- */
.gallery{
  background: var(--cream-2);
  padding: 100px 24px;
}
.gallery__head{
  max-width: 1180px;
  margin: 0 auto 48px;
}
.gallery__head .lead{ margin-bottom: 0; }
.gallery__grid{
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery__item{
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(150deg, #e8e0d0, var(--cream-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: default;
  transition: box-shadow .35s ease, transform .35s ease;
}
.gallery__item--wide{
  grid-column: span 2;
  aspect-ratio: 2.08 / 1;
}
.gallery__item img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .5s ease, transform .6s cubic-bezier(.16,.8,.24,1);
}
.gallery__item img.loaded{ opacity: 1; transform: scale(1); }
.gallery__item:has(img.loaded){ cursor: zoom-in; }
.gallery__item:has(img.loaded):hover{
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.gallery__item:has(img.loaded):hover img{ transform: scale(1.08); }
.gallery__caption{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 18px 14px;
  background: linear-gradient(0deg, rgba(16,25,44,.78), transparent);
  color: #fff;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.gallery__item:hover .gallery__caption{ opacity: 1; transform: translateY(0); }

.gallery__item.reveal{
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.16,.8,.24,1), transform .6s cubic-bezier(.16,.8,.24,1), box-shadow .35s ease;
}
.gallery__item.reveal.in-view{ transform: translateY(0); }
.gallery__item:nth-child(1){ transition-delay: .05s; }
.gallery__item:nth-child(2){ transition-delay: .12s; }
.gallery__item:nth-child(3){ transition-delay: .19s; }
.gallery__item:nth-child(4){ transition-delay: .26s; }
.gallery__item:nth-child(5){ transition-delay: .33s; }
.gallery__item:nth-child(6){ transition-delay: .4s; }
.gallery__item:nth-child(7){ transition-delay: .47s; }
.gallery__item:nth-child(8){ transition-delay: .54s; }

/* ---------- Lightbox ---------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(10,15,26,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.is-open{ opacity: 1; visibility: visible; }
.lightbox__figure{
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(920px, 92vw);
  transform: scale(.96);
  transition: transform .3s ease;
}
.lightbox.is-open .lightbox__figure{ transform: scale(1); }
.lightbox__figure img{
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.lightbox__figure figcaption{
  margin-top: 16px;
  color: #fff;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.lightbox__close{
  position: absolute;
  top: 26px;
  right: 26px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.lightbox__close svg{ width: 20px; height: 20px; }
.lightbox__close:hover{ background: var(--gold); color: var(--navy); transform: rotate(90deg); }

/* ---------- Contacts (screen 3) ---------- */
.contacts{
  position: relative;
  background: var(--ink);
  padding: 100px 24px 40px;
  color: var(--text-on-navy);
}
.contacts__inner{
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.contact-row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-on-navy);
  transition: color .2s ease;
}
.contact-row em{
  font-style: normal;
  color: var(--text-on-navy-muted);
  font-weight: 500;
}
a.contact-row:hover{ color: var(--gold-light); }
.contact-row__icon{
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  color: var(--gold-light);
}
.contact-row__icon svg{ width: 19px; height: 19px; }
.contact-row--phone{ font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.messengers--contacts{ margin: 20px 0 6px; }
.messengers--contacts .messenger{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--text-on-navy);
  box-shadow: none;
}

.socials{
  display: flex;
  gap: 14px;
  margin-top: 28px;
}
.social{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-on-navy);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.social svg{ width: 20px; height: 20px; }
.social:hover{
  transform: translateY(-3px);
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.contacts__map{
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.12);
  aspect-ratio: 4 / 5;
}
.contacts__map iframe{
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(.15) contrast(1.02);
}

.footer{
  max-width: 1180px;
  margin: 70px auto 0;
  padding: 26px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--text-on-navy-muted);
}
.footer__brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-head);
  font-weight: 700;
  color: var(--text-on-navy);
}
.footer__logo{
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .about__inner{
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about__media{ order: -1; }
  .photo-frame{ aspect-ratio: 16 / 10; }
  .features{ grid-template-columns: 1fr; }
  .feature__photo{
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 14px;
    box-shadow: var(--shadow-sm);
  }

  .contacts__inner{
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contacts__map{ aspect-ratio: 16 / 10; }

  .gallery__grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px){
  .topbar__inner{ padding: 10px 14px; }
  .topbar__brand span{ display: none; }
  .topbar__phone span{ display: none; }
  .topbar__phone{ padding: 10px; }
  .topbar__right{ gap: 8px; }
  .topbar__socials{ gap: 6px; }
  .topbar__social{ width: 30px; height: 30px; }
  .topbar__social svg{ width: 13px; height: 13px; }

  .hero{ padding: 100px 20px 70px; }
  .hero__logo{ width: 80px; height: 80px; }
  .hero__meta{ flex-direction: column; gap: 12px; }
  .hero__meta-divider{ display: none; }

  .about, .contacts, .gallery{ padding-left: 20px; padding-right: 20px; }
  .about{ padding-top: 72px; padding-bottom: 72px; }
  .gallery{ padding-top: 72px; padding-bottom: 72px; }
  .contacts{ padding-top: 72px; }

  .gallery__grid{ grid-template-columns: 1fr; gap: 16px; }
  .gallery__item, .gallery__item--wide{ grid-column: span 1; aspect-ratio: 4 / 3; }

  .footer{ justify-content: center; text-align: center; }
}
