/* Студия современного дизайна — основные стили */
:root {
  color-scheme: light;
  --paper: #f2efe8;
  --paper-2: #e8e3d8;
  --ink: #1a1c17;
  --muted: #6b6e62;
  --line: rgba(26, 28, 23, .14);
  --accent: #a4552e;
  --accent-dark: #7e3f20;
  --night: #14170f;
  --radius: 14px;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.08; }
h2 { font-size: clamp(30px, 4.2vw, 52px); margin: 0 0 28px; }
h3 { font-size: 24px; margin: 0 0 10px; }
.wrap { width: min(1180px, 92%); margin: 0 auto; }
.muted { color: var(--muted); font-weight: 400; font-style: normal; }
.center { text-align: center; margin-top: 40px; }
.skip { position: fixed; z-index: 100; left: 16px; top: -70px; padding: 10px 16px; background: var(--ink); color: var(--paper); transition: top .2s; }
.skip:focus { top: 14px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Кнопки */
.btn {
  display: inline-block; padding: 14px 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px; text-decoration: none; text-align: center;
  transition: background .2s, color .2s, transform .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* Шапка */
.site-header {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 10px clamp(16px, 3vw, 40px); background: rgba(242, 239, 232, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { width: 52px; height: 52px; object-fit: contain; }
.logo-text { font-family: var(--font-serif); font-size: 17px; line-height: 1.1; max-width: 200px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { padding: 10px 14px; text-decoration: none; border-radius: 8px; font-size: 15px; }
.main-nav a:hover { background: var(--paper-2); }
.header-contacts { display: flex; align-items: center; gap: 16px; }
.header-phone { font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); }

/* Scroll-sequence hero: полноэкранное видео, текст поверх (референс pear.no) */
.sequence { position: relative; height: 320vh; background: var(--night); }
.sequence .stage { position: sticky; top: 0; height: 100vh; min-height: 560px; overflow: hidden; }
.sequence-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.sequence-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 19, 14, .42) 0%, rgba(16, 19, 14, .12) 38%, rgba(16, 19, 14, .82) 100%);
}
.sequence-copy {
  position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column;
  padding: clamp(84px, 10vh, 130px) clamp(24px, 4.5vw, 64px) clamp(30px, 5vh, 54px);
  color: #f4f2e8;
}
.eyebrow { display: flex; justify-content: space-between; gap: 20px; color: rgba(244, 242, 232, .72); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.sequence-bottom { margin-top: auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: end; }
.sequence h1 { margin: 0; font-size: clamp(38px, 5.6vw, 88px); color: #fff; }
.sequence h1 span { color: #e07b45; }
.sequence-side { display: grid; gap: 18px; }
.state-copy { position: relative; min-height: 108px; border-top: 1px solid rgba(244, 242, 232, .35); padding-top: 16px; }
.state { position: absolute; inset: 16px 0 auto; opacity: 0; transform: translateY(12px); transition: opacity .25s linear, transform .25s ease; }
.state.active { opacity: 1; transform: translateY(0); }
.state b { display: block; margin-bottom: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.state p { margin: 0; color: rgba(244, 242, 232, .8); font-size: clamp(14px, 1.2vw, 16px); line-height: 1.55; }
.readout { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.track { height: 2px; background: rgba(244, 242, 232, .3); overflow: hidden; }
.track i { display: block; width: 100%; height: 100%; background: #e07b45; transform: scaleX(0); transform-origin: left; }
.percent { font: 400 28px/1 var(--font-serif); font-variant-numeric: tabular-nums; color: #fff; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-light { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85); }
.btn-light:hover { background: #fff; color: var(--ink); }
.scroll-cue {
  position: absolute; z-index: 2; right: 22px; bottom: 22px; writing-mode: vertical-rl;
  color: rgba(244, 242, 232, .75); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
}
/* Индикатор загрузки hero-видео */
.video-loading {
  position: absolute; z-index: 3; left: 50%; bottom: 30px; transform: translateX(-50%);
  width: min(220px, 60vw); display: grid; gap: 8px; justify-items: center;
  color: rgba(244, 242, 232, .85); font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  transition: opacity .45s ease;
}
.video-loading i {
  display: block; width: 100%; height: 2px; background: rgba(244, 242, 232, .25);
  position: relative; overflow: hidden;
}
.video-loading i::after {
  content: ""; position: absolute; inset: 0; background: #e07b45;
  transform: scaleX(var(--load, 0)); transform-origin: left;
}
.video-loading.done { opacity: 0; pointer-events: none; }
@media (max-width: 820px) {
  .video-loading { bottom: auto; top: 92px; }
}

/* Секции */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--night); color: #f4f2e8; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-more { text-decoration: none; font-weight: 700; white-space: nowrap; }
.section-more:hover { color: var(--accent); }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.65; color: var(--muted); }

.about-strip-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 28px 0; }
.stats li { border-top: 2px solid var(--ink); padding-top: 12px; }
.stats b { display: block; font: 400 clamp(28px, 3vw, 42px)/1 var(--font-serif); }
.stats span { color: var(--muted); font-size: 14px; }

.promo { padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 6px;
}
.section-alt .card { background: rgba(255, 255, 255, .55); }
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); flex: 1; }
.card .price { font: 400 26px/1.2 var(--font-serif); color: var(--ink); margin: 10px 0; flex: 0; }
.price-na { font-size: 17px !important; color: var(--muted) !important; }

/* Портфолио */
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.portfolio-item { position: relative; border-radius: var(--radius); overflow: hidden; text-decoration: none; aspect-ratio: 4/3; background: var(--paper-2); }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.portfolio-item:hover img { transform: scale(1.045); }
.portfolio-item-info {
  position: absolute; inset: auto 0 0; padding: 40px 18px 16px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72)); display: grid;
}
.portfolio-item-info b { font-size: 16px; }
.portfolio-item-info span { font-size: 13px; opacity: .85; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span { padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Страница проекта */
.project-head { padding: clamp(48px, 7vw, 90px) 0 30px; }
.project-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin-top: 12px; }
.project-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 34px 0; }
.project-gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.project-gallery img { width: 100%; height: 100%; object-fit: cover; }
.project-body { max-width: 780px; }

/* Команда */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.team-card { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.team-card img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.team-role { color: #c9c4b4; margin: 0 0 14px; font-size: 14px; }
.section-dark .team-role { color: rgba(244, 242, 232, .7); }
.team-bio { font-size: 15px; line-height: 1.65; }
.team-bio p { margin: 0 0 12px; }

/* Шаги */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { border-top: 2px solid var(--accent); padding-top: 14px; }
.steps li::before { counter-increment: step; content: '0' counter(step); font: 400 26px/1 var(--font-serif); color: var(--accent); display: block; margin-bottom: 8px; }
.steps b { display: block; margin-bottom: 6px; }
.steps span { font-size: 14px; color: var(--muted); }

/* Отзывы */
.reviews-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.review-card { margin: 0; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.section-alt .review-card { background: rgba(255, 255, 255, .55); }
.review-card p { margin: 0 0 16px; line-height: 1.65; }
.review-card footer { color: var(--muted); font-size: 14px; }

/* CTA */
.cta-band { background: var(--accent); color: #fff; }
.cta-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { margin: 0; opacity: .92; }
.cta-contacts { display: grid; gap: 10px; justify-items: start; }
.cta-contacts .btn { background: #fff; color: var(--accent); margin-bottom: 8px; }
.cta-contacts .btn:hover { background: var(--paper-2); }
.cta-contacts a { color: #fff; font-size: 18px; text-decoration: none; }
.cta-contacts a:hover { text-decoration: underline; }

/* Подвал */
.site-footer { background: var(--night); color: #d8d4c6; padding: 56px clamp(16px, 4vw, 48px) 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; width: min(1180px, 100%); margin: 0 auto 40px; }
.footer-brand img { margin-bottom: 14px; }
.footer-slogan { font-family: var(--font-serif); font-size: 19px; margin: 0 0 6px; }
.footer-region { color: rgba(216, 212, 198, .65); margin: 0; font-size: 14px; }
.footer-nav, .footer-contacts { display: grid; gap: 8px; align-content: start; }
.footer-nav b, .footer-contacts b { color: #fff; margin-bottom: 6px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-social { display: flex; gap: 14px; margin-top: 8px; }
.footer-bottom {
  width: min(1180px, 100%); margin: 0 auto; padding-top: 22px; border-top: 1px solid rgba(244, 242, 232, .15);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: rgba(216, 212, 198, .6);
}

/* Хлебные крошки */
.crumbs { font-size: 13px; color: var(--muted); padding: 20px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* Простые страницы */
.page-head { padding: clamp(48px, 7vw, 90px) 0 10px; }
.page-body { max-width: 820px; padding-bottom: 60px; }
.page-body p { line-height: 1.7; }

/* Услуга */
.service-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 44px; align-items: start; }
.service-price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--paper-2); position: sticky; top: 90px; }
.service-price-card .price { font: 400 36px/1.1 var(--font-serif); margin: 0 0 18px; }
.features-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 8px; }
.features-list li { padding-left: 26px; position: relative; }
.features-list li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }

/* Контакты */
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.contact-list { display: grid; gap: 14px; align-content: start; font-size: 18px; }
.contact-list b { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--accent); }

/* Модалки и формы */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 15, .6); backdrop-filter: blur(3px); }
.modal-box { position: relative; width: min(440px, 100%); background: var(--paper); border-radius: var(--radius); padding: 32px; max-height: 90vh; overflow: auto; }
.modal-title { margin-bottom: 8px; }
.modal-hint { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 30px; cursor: pointer; line-height: 1; color: var(--muted); }
.lead-form { display: grid; gap: 16px; }
.lead-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.lead-form input, .lead-form textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.lead-form input:focus, .lead-form textarea:focus { border-color: var(--accent); outline: none; }
.form-note { font-size: 12px; color: var(--muted); margin: 0; }
.form-error { color: #a3271b; margin: 0; font-size: 14px; }
.form-success { text-align: center; padding: 24px 0; }
.form-success b { font-size: 20px; font-family: var(--font-serif); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* 404 */
.not-found { min-height: 52vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.not-found h1 { font-size: clamp(60px, 10vw, 120px); margin: 0 0 10px; }

/* Reveal-анимации при скролле (включаются только если JS активен и нет reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on [data-reveal] {
    opacity: 0; transform: translateY(28px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
  }
  .reveal-on [data-reveal].revealed { opacity: 1; transform: none; }
}

/* Адаптив */
@media (max-width: 1020px) {
  .portfolio-grid, .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .team-grid { grid-template-columns: 1fr; }
  .service-hero, .contacts-grid, .cta-grid, .about-strip-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .main-nav, .header-contacts { display: none; }
  .site-header.nav-open { flex-wrap: wrap; }
  .site-header.nav-open .main-nav { display: grid; order: 3; width: 100%; gap: 2px; }
  .nav-toggle { display: flex; margin-left: auto; }
  /* Scroll-сцена на мобильных: тоже полноэкранная, текст компактнее */
  .sequence .stage { min-height: 480px; }
  .sequence-copy { padding: 80px 20px 26px; }
  .sequence-bottom { grid-template-columns: 1fr; gap: 18px; }
  .sequence h1 { font-size: clamp(30px, 8.5vw, 46px); }
  .scroll-cue { display: none; }
  .state-copy { min-height: 118px; padding-top: 12px; }
  .state { inset: 12px 0 auto; }
  .state p { font-size: 13px; }
  .readout { gap: 12px; }
  .percent { font-size: 22px; }
  .hero-actions .btn { padding: 12px 20px; font-size: 14px; }
  .portfolio-grid, .reviews-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .team-card { grid-template-columns: 1fr; }
  .project-gallery { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Reduced motion: статичный финальный кадр, обычный поток документа */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sequence { height: auto !important; }
  .sequence .stage { position: relative; height: auto; min-height: 0; }
  .sequence-video { position: relative; height: 52vh; }
  .sequence-copy { position: relative; inset: auto; background: var(--night); min-height: 0; }
  .sequence-bottom { grid-template-columns: 1fr; }
  .sequence-overlay { display: none; }
  .scroll-cue { display: none; }
  .state { position: static; opacity: 1; transform: none; margin-bottom: 16px; }
  .state-copy { min-height: 0; border-top-color: rgba(244, 242, 232, .35); }
  .portfolio-item img, .btn { transition: none; }
}
