/* ============================================================
   byplan — polish.css (v2)
   Purpose: depth, micro-interactions, reveal, skeletons, modal, sticky header
   Drop-in: include AFTER styles.css and hero.css
   ============================================================ */

:root{
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --dur-fast: 160ms;
  --dur: 240ms;

  --elev-1: 0 10px 24px rgba(0,0,0,.10);
  --elev-2: 0 18px 40px rgba(0,0,0,.14);
  --elev-3: 0 34px 95px rgba(0,0,0,.28);

  --glass-bg: rgba(255,255,255,.40);
  --glass-border: rgba(0,0,0,.08);
  --glass-blur: 10px;
}

/* ---- Sticky header state (JS adds .is-scrolled) ---- */
.site-header{
  transition:
    background var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}
.site-header.is-scrolled{
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  border-bottom-color: rgba(0,0,0,.08);
}

/* ---- Active nav item (scroll-spy) ---- */
.nav__menu a.is-active{
  background: rgba(0,0,0,.06);
  border-radius: 999px;
}

/* ---- Anchor offset for fixed header ---- */
section[id]{
  scroll-margin-top: 84px;
}

/* ---- Depth / hover polish (desktop only) ---- */
@media (hover:hover) and (pointer:fine){
  .card,
  .price-card,
  .case-card,
  .review,
  .faq-item,
  .contact-card,
  .contact-form-card,
  .doc-sample,
  .about-card,
  .form-strip{
    transition:
      transform var(--dur) var(--ease-out),
      box-shadow var(--dur) var(--ease-out),
      border-color var(--dur) var(--ease-out),
      background var(--dur) var(--ease-out);
  }

  .card:hover,
  .price-card:hover,
  .case-card:hover,
  .review:hover,
  .faq-item:hover,
  .contact-card:hover,
  .contact-form-card:hover,
  .doc-sample:hover,
  .about-card:hover,
  .form-strip:hover{
    transform: translateY(-3px);
    box-shadow: var(--elev-2);
    border-color: rgba(0,0,0,.12);
  }

  .btn{
    transition:
      transform var(--dur-fast) var(--ease-out),
      box-shadow var(--dur-fast) var(--ease-out),
      filter var(--dur-fast) var(--ease-out);
  }
  .btn:hover{
    transform: translateY(-1px);
    box-shadow: var(--elev-2);
    filter: saturate(1.02);
  }
  .btn:active{
    transform: translateY(0);
    box-shadow: var(--elev-1);
  }
}

/* ---- Scroll reveal (JS adds .reveal + .is-visible) ---- */
html.js .reveal{
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out);
  will-change: transform, opacity;
}
html.js .reveal.is-visible{
  opacity: 1;
  transform: none;
}

/* ---- Skeletons ---- */
.skeleton{
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
}
.skeleton::after{
  content:"";
  position:absolute;
  inset:-40% -60%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,.55),
    transparent);
  transform: translateX(-60%);
  animation: byplan-shimmer 1.25s infinite;
}

@keyframes byplan-shimmer{
  0%{ transform: translateX(-60%); }
  100%{ transform: translateX(60%); }
}

.skeleton-card{ height: 112px; }
.skeleton-price{ height: 260px; }
.skeleton-case{ height: 210px; }
.skeleton-review{ height: 180px; }
.skeleton-faq{ height: 74px; }

.grid.is-loading{
  pointer-events: none;
}

/* ---- Lightbox (cases) ---- */
.lb-backdrop{
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
}

.lb-backdrop.is-open{ display: grid; }

.lb-dialog{
  width: min(1120px, 100%);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: var(--elev-3);
}

.lb-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.lb-title{
  font-weight: 700;
  color: rgba(0,0,0,.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-close{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  height: 38px;
  width: 44px;
  cursor: pointer;
}

.lb-img{
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

/* ---- Floating CTA ---- */
.floating-cta{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2500;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;

  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.floating-cta.is-visible{
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (max-width: 420px){
  .floating-cta{ right: 12px; bottom: 12px; }
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  html.js .reveal{
    opacity: 1;
    transform: none;
    transition: none;
  }
  .skeleton::after{ animation: none; }
}
/* === SLIDE: #for ("Для кого") — light complementary, volumetric === */
#for{
  position: relative;
  background:
    radial-gradient(1100px 520px at 18% -10%, rgba(255,255,255,.92), rgba(255,255,255,0) 62%),
    radial-gradient(900px 520px at 80% 10%, rgba(255,255,255,.55), rgba(255,255,255,0) 64%),
    linear-gradient(180deg, #F4F0F3 0%, #EAE4EA 100%);
}

/* subtle grain (reuse your hero grain layer if it exists) */
#for::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.12;
  background-image: url("../img/hero/layers/03_grain.png");
  background-size: cover;
  mix-blend-mode: overlay;
}

#for .container{ position: relative; z-index: 1; }

#for .grid.cards{ gap: 18px; }

/* cards as “glass on paper” */
#for .card{
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62));
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 26px 80px rgba(0,0,0,.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: relative;
}

/* top highlight for “volume” */
#for .card::after{
  content:"";
  position:absolute;
  left:12px; right:12px; top:10px;
  height:1px;
  background: rgba(255,255,255,.65);
  opacity:.9;
  border-radius:999px;
}

/* Q/A typography */
#for .card__title{
  font-weight: 850;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
  padding-bottom: 10px;
  position: relative;
}

/* “question separator” — makes it instantly look structured */
#for .card__title::after{
  content:"";
  position:absolute;
  left:0;
  bottom:0;
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: rgba(0,0,0,.16);
}

#for .card__text{
  margin: 0;
  color: rgba(0,0,0,.62);
  line-height: 1.45;
}

/* nice stagger when reveal anim is enabled (up to 6 cards) */
html.js #for .card.reveal{ transition-delay: 0ms; }
html.js #for .card.reveal:nth-child(2){ transition-delay: 60ms; }
html.js #for .card.reveal:nth-child(3){ transition-delay: 120ms; }
/* === SLIDE: #process — make lists product-like (no wall of text) === */
#process{
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(255,255,255,.9), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #F4F0F3 0%, #EFE9EF 100%);
}

#process .container{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: start;
}

/* Stack on mobile */
@media (max-width: 980px){
  #process .container{ grid-template-columns: 1fr; }
}

/* Make the two blocks look like cards */
#process .deliverables,
#process .process{
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.58));
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0,0,0,.12);
  padding: 18px 18px 16px;
}

/* Titles spacing */
#process h2{ margin-top: 0; }
#process .muted{ margin-bottom: 14px; }

/* --- Deliverables checklist --- */
#deliverablesList{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

@media (max-width: 980px){
  #deliverablesList{ grid-template-columns: 1fr; }
}

#deliverablesList li{
  position: relative;
  padding-left: 30px;
  margin: 0;
  color: rgba(0,0,0,.72);
  line-height: 1.35;
}

#deliverablesList li::before{
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.08);
  color: rgba(0,0,0,.75);
  font-weight: 900;
  font-size: 0.85rem;
}

/* Make the "DWG note" line look like a pill (if it is a separate <p> under deliverables) */
#process .deliverables p:last-of-type{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.08);
  margin-top: 14px;
}

/* --- Steps timeline --- */
#stepsList{
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  position: relative;
}

#stepsList li{
  position: relative;
  padding: 12px 12px 12px 44px;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.06);
}

#stepsList li::before{
  content: attr(data-step);
}

/* If your app.js creates <li><strong>Title</strong><div>text</div>..., we just style inside */
#stepsList li strong{
  display: block;
  font-weight: 850;
  margin-bottom: 6px;
}

#stepsList li p{
  margin: 0;
  color: rgba(0,0,0,.62);
  line-height: 1.4;
}

/* Number bubble + vertical line (JS will add data-step, but we can also fallback to CSS counter) */
#stepsList{
  counter-reset: step;
}
#stepsList li{
  counter-increment: step;
}
#stepsList li::before{
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.85rem;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(0,0,0,.72);
}
#stepsList::after{
  content:"";
  position:absolute;
  left: 25px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: rgba(0,0,0,.08);
  border-radius: 99px;
  pointer-events:none;
}
html.js #for .card.reveal:nth-child(4){ transition-delay: 180ms; }
html.js #for .card.reveal:nth-child(5){ transition-delay: 240ms; }
html.js #for .card.reveal:nth-child(6){ transition-delay: 300ms; }

/* Уменьшаем отступ между заголовком шага и текстом */
#stepsList li strong{
  margin-bottom: 6px !important;   /* было больше */
}

#stepsList li p{
  margin-top: 0 !important;        /* на всякий */
}

/* Reviews: name / role / text */
.review__head{
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.review__name{
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px 0;
}

.review__role{
  opacity: .75;
  font-size: 0.95em;
  margin: 0 0 12px 0;
}

.review__text{
  margin: 0;
  line-height: 1.6;
}

/* Sheet error banner */
.sheet-error{
  margin: 16px auto 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(255,255,255,.65);
  color: rgba(0,0,0,.72);
  font-size: 0.95rem;
}
.hero-media__picture,
.about-photo picture{
  display: block;
}

/* Case cards */
.case-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius);
  background: rgba(255,255,255,.60);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
}
.case-card__img{
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.04);
}
.case-card__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Review case preview thumbnails */
.review__casePreview{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.review__caseThumb{
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,.04);
}
.review__caseThumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.review__caseLabel{
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.88);
  color: rgba(0,0,0,.78);
  border: 1px solid rgba(0,0,0,.08);
}

body.case-modal-open{
  overflow: hidden;
}

/* ---- WHY US (after story) ---- */
#why{
  position: relative;
  overflow: hidden;
  --why-accent: var(--brand, #6E4C3D);
  --why-accent-strong: #4f352b;
  --why-accent-soft: rgba(110,76,61,.18);
}

#why::before{
  content:"";
  position:absolute;
  inset:-22% -8% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 35% 30%, rgba(235,220,210,.75), rgba(235,220,210,0));
  filter: blur(6px);
  pointer-events: none;
}

#why::after{
  content:"";
  position:absolute;
  inset:auto auto -25% -10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 40% 40%, rgba(110,76,61,.20), rgba(110,76,61,0));
  filter: blur(10px);
  pointer-events: none;
}

#why .container{
  position: relative;
  z-index: 1;
}

#why h2{
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

#why h2::after{
  content:"";
  position:absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--why-accent), rgba(110,76,61,.12));
}

#why .muted{
  max-width: 70ch;
}

#why .why-stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:16px;
  margin-top:24px;
}

#why .why-stats .stat{
  position: relative;
  padding:20px 18px 18px 20px;
  border-radius:24px;
  border:1px solid rgba(0,0,0,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.80));
  box-shadow: var(--elev-1);
  overflow:hidden;
  min-height: 120px;
}

#why .why-stats .stat::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  height:100%;
  width:4px;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0));
  opacity:.35;
}

#why .why-stats .stat__num{
  font-weight:900;
  letter-spacing:-.02em;
  line-height:1.08;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: none;
  white-space: pre-line;
}

#why .why-stats .stat__label{
  margin-top:9px;
  color: var(--muted, rgba(28,27,27,.72));
  font-size:0.98rem;
  line-height:1.35;
  text-wrap: balance;
  white-space: pre-line;
}

/* highlight top 3 metrics */
#why .why-stats .stat:nth-child(-n+3){
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(238,231,226,.92));
  border-color: rgba(110,76,61,.32);
  box-shadow: 0 18px 40px rgba(110,76,61,.18);
}

#why .why-stats .stat:nth-child(-n+3)::after{
  content:"";
  position:absolute;
  top:12px;
  right:12px;
  width:44px;
  height:44px;
  border-radius:16px;
  background: radial-gradient(circle at 30% 30%, rgba(110,76,61,.55), rgba(110,76,61,0));
  opacity:.75;
}

#why .why-stats .stat:nth-child(-n+3)::before{
  width:6px;
  background: linear-gradient(180deg, rgba(110,76,61,.9), rgba(110,76,61,.2));
  opacity:.9;
}

#why .why-stats .stat:nth-child(-n+3) .stat__num{
  color: var(--why-accent-strong);
}

#why .why-stats .stat:nth-child(-n+3) .stat__label{
  color: rgba(60,34,20,.78);
}

#why .why-cards{
  margin-top:18px;
  display:grid;
  gap:14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style:none;
  padding:0;
}

#why .why-cards li,
#why .why-card{
  position: relative;
  padding:16px 16px 16px 20px;
  border-radius:20px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.86);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

#why .why-cards li::before{
  content:"";
  position:absolute;
  left:12px;
  top:14px;
  bottom:14px;
  width:4px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(110,76,61,.85), rgba(110,76,61,.18));
}

@media (max-width: 720px){
  #why .why-stats{
    gap:14px;
  }
  #why .why-stats .stat{
    padding:18px 16px;
  }
  #why .why-cards li,
  #why .why-card{
    padding:14px 14px 14px 18px;
  }
}
