/* ---------- Токени: міняємо тут під клієнта ---------- */
:root {
  --night: #0E1826;
  --dusk: #263F72;
  --frost: #B9C7D6;
  --snow: #F0F4F7;
  --surface: #FFFFFF;
  --text: #15202D;
  --muted: #53616F;
  --line: #D3DCE4;
  --wood: #7A4E33;
  --cta: #C2410F;
  --cta-hover: #A8360B;
  --glow: #FFB36B;

  --display: "Geologica", "Arial", sans-serif;
  --body: "Golos Text", "Arial", sans-serif;

  --h1: clamp(1.75rem, 1.3rem + 1.55vw, 2.75rem);
  --h2: clamp(2rem, 1.5rem + 2.2vw, 3.75rem);
  --h3: clamp(1.375rem, 1.2rem + .7vw, 1.875rem);
  --pad: clamp(20px, 3.4vw, 64px);
  --radius: 14px;                       /* поля, малі елементи */
  --round: clamp(20px, 2vw, 28px);      /* фото й панелі */
  --sheet: clamp(28px, 3.4vw, 48px);    /* великі темні блоки */
  --gap: clamp(8px, .9vw, 14px);
  --ease: cubic-bezier(.22, .7, .25, 1);
  --header: 64px;
  --section: clamp(64px, 7vw, 112px);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; scroll-padding-top: var(--header); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--snow); color: var(--text); font: 400 1.0625rem/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; line-height: 1.12; text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: var(--radius); }
.skip { position: fixed; z-index: 100; left: 12px; top: -80px; padding: 12px 16px; background: var(--surface); color: var(--text); }
.skip:focus { top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 14px 30px; border-radius: 99px;
  background: var(--cta); color: #fff; font: 600 1.0625rem/1.2 var(--body); text-align: center; text-decoration: none;
  transition: background-color .25s;
}
.btn:hover { background: var(--cta-hover); }

/* ---------- Скло ---------- */
.glass {
  border: 1px solid rgb(255 255 255 / .22); background: rgb(22 35 56 / .62); color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 10px 30px rgb(8 16 28 / .12);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  transition: background-color .35s, color .35s, border-color .35s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--night); }
}

/* ---------- Шапка ----------
   Прозора над першим екраном, далі темна або світла залежно від блоку під нею (main.js). */
.header { position: fixed; z-index: 20; inset: 0 0 auto; pointer-events: none; }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px clamp(12px, 3.4vw, 64px) 0; }
.header__in > *, .nav > * { pointer-events: auto; }
.header .glass { border-radius: 99px; }
.header:not(.is-solid, .is-open) .glass {
  border-color: rgb(255 255 255 / .28); background: linear-gradient(rgb(255 255 255 / .2), rgb(255 255 255 / .05));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.header.is-light:not(.is-open) .glass { border-color: rgb(255 255 255 / .9); background: rgb(255 255 255 / .72); color: var(--text); }
.brand { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; font: 600 1.25rem/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.badge { font-size: .8125rem; line-height: 1.1; white-space: nowrap; }
.brand .badge { padding-left: 12px; border-left: 1px solid rgb(127 140 156 / .6); }

.burger { position: relative; flex: none; width: 52px; height: 52px; padding: 0; cursor: pointer; }
.burger span { position: absolute; left: 14px; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease); }
.burger span:first-child { top: 20px; }
.burger span:last-child { top: 28px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.nav a { text-decoration: none; }
@media (max-width: 1023px) {
  .nav { position: absolute; inset: 72px 12px auto; display: none; gap: 8px; max-height: calc(100svh - 84px); overflow: auto; border-radius: var(--round); }
  .header.is-open .nav { display: grid; }
  .header.is-open .nav__links { padding: 8px 22px; border-radius: var(--round); background: rgb(14 24 38 / .9); }
  .nav__links a { display: block; padding: 17px 0; font: 500 1.25rem/1.3 var(--display); }
  .nav__links a + a { border-top: 1px solid rgb(255 255 255 / .16); }
  .header.is-open .nav__cta { padding: 18px; border-color: transparent; background: var(--cta); font-weight: 600; text-align: center; }
  html:not(.js) .burger { display: none; }
}
@media (min-width: 1024px) {
  :root { --header: 84px; }
  .header__in { padding-top: 16px; }
  .burger { display: none; }
  .nav { display: contents; }
  .brand, .nav__links, .nav__cta { height: 56px; }
  .nav__links { display: flex; align-items: center; padding: 0 6px; }
  .nav__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 clamp(12px, 1.3vw, 20px); border-radius: 99px; font-size: 1rem; transition: background-color .25s; }
  .nav__links a:hover { background: rgb(127 145 170 / .24); }
  .nav__cta { display: inline-flex; align-items: center; padding: 0 24px; font-weight: 500; }
  .header .nav__cta:hover, .header.is-light:not(.is-open) .nav__cta:hover { border-color: transparent; background: var(--cta); color: #fff; }
}

/* ---------- Перший екран ----------
   .stage завжди має пропорції фото, тому назва, дах і вікна не роз'їжджаються.
   Нове фото: оновити --photo, --roof, --word-y, --word-x і вирізи вікон .light--1…4. */
.hero {
  --height: max(100svh, 560px);
  --photo: 1672 / 941;
  --ratio: 1.7768;
  --word-x: 49.7%;
  --word-y: 50%;       /* низ літер, від верху фото */
  --word-size: min(17cqw, 20vw);
  --windows: url("../img/hero/wide-windows.webp");
  --glow-img: url("../img/hero/wide-glow.webp");
  --roof: polygon(0.00% 0.00%, 100.00% 0.00%, 100.00% 66.10%, 69.86% 66.10%, 63.10% 57.33%, 63.10% 46.76%, 62.68% 45.27%, 62.20% 44.63%, 61.12% 44.63%, 60.65% 45.16%, 60.53% 46.33%, 60.23% 46.76%, 60.23% 53.61%, 50.36% 40.81%, 49.70% 40.38%, 49.04% 40.81%, 31.22% 63.34%, 0.00% 63.34%);
  --zone: clamp(0px, calc(100svh - 41.9vw - 84px), 22svh); /* місце під фото */
  position: relative; isolation: isolate; overflow: hidden;
  min-height: var(--height); background: var(--night); color: #fff;
}
.stage {
  position: absolute; z-index: -1; left: 50%; bottom: var(--zone);
  width: max(100%, calc((var(--height) - var(--zone)) * var(--ratio)));
  aspect-ratio: var(--photo); transform: translateX(-50%); container-type: size;
}
/* Фото м'яко переходить у нічний фон під ним */
.stage::after { content: ""; position: absolute; inset: 60% 0 -1px; background: linear-gradient(rgb(14 24 38 / 0), rgb(14 24 38 / .5) 55%, var(--night)); }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
/* Назва «за дахом»: літери вирізано по контуру --roof, а дах видно з головного фото.
   Окремого зображення даху немає, тому ефект не зламається, якщо файл не завантажиться. */
.sky { position: absolute; inset: 0; -webkit-clip-path: var(--roof); clip-path: var(--roof); }
.word {
  position: absolute; left: var(--word-x); top: var(--word-y);
  font: 700 var(--word-size)/1 var(--display); letter-spacing: -.035em; white-space: nowrap;
  color: #EDF2F6; transform: translate(-50%, -86%);
}

.light--glow { background: var(--glow-img) 0 0 / 100% 100% no-repeat; }
.light--w { background: var(--windows) 0 0 / 100% 100% no-repeat; }
.light--1 { clip-path: inset(68% 50% 14% 39%); }
.light--2 { clip-path: inset(48% 50% 34% 40%); }
.light--3 { clip-path: inset(68% 39% 14% 50%); }
.light--4 { clip-path: inset(48% 39% 34% 50%); }

/* Вікна запалюються одне за одним. Без JS або з reduced motion одразу світяться. */
@media (prefers-reduced-motion: no-preference) {
  .js .light { opacity: 0; transition: opacity 1.3s var(--ease); }
  .js .is-lit .light { opacity: 1; }
  .is-lit .light--1 { transition-delay: .5s; }
  .is-lit .light--2 { transition-delay: 1.1s; }
  .is-lit .light--3 { transition-delay: 1.6s; }
  .is-lit .light--4 { transition-delay: 2.1s; }
  .js .light--glow { transition-duration: 2.6s; }
  .is-lit .light--glow { transition-delay: .9s; }
}

.hero__text {
  display: grid; grid-template-columns: minmax(0, 34fr) 34fr minmax(0, 32fr); align-items: end;
  min-height: var(--height); padding: calc(var(--header) + 16px) var(--pad) clamp(28px, 4.2svh, 52px);
}
.hero h1 { font-size: var(--h1); }
.hero__offer { grid-column: 3; justify-self: end; max-width: 350px; }
.hero__offer p { font-size: 1.125rem; line-height: 1.45; }
.hero__offer .btn { margin: 18px 0 12px; }
.hero__offer small { display: block; color: var(--frost); font-size: .8125rem; line-height: 1.4; }

/* Горизонтальний телефон і невеликі квадратні екрани: текст під будинком */
@media (max-width: 1023px) and (min-aspect-ratio: 4/5) {
  .hero { --height: max(100svh, calc(56.3vw + 110px)); --zone: 180px; }
  .hero__text { grid-template-columns: 1fr 1fr; column-gap: 24px; padding-bottom: 20px; }
  .hero__offer { grid-column: 2; }
}

/* Телефон і вертикальний планшет: окремий кадр, заголовок у небі, кнопка під будинком */
@media (max-aspect-ratio: 4/5) {
  .hero {
    --height: max(100svh, 620px);
    --photo: 1122 / 1402;
    --word-x: 50%;
    --word-y: 49.2%;
    --word-size: min(20cqw, 20.2vw);
    --windows: url("../img/hero/tall-windows.webp");
    --glow-img: url("../img/hero/tall-glow.webp");
    --roof: polygon(0.00% 0.00%, 100.00% 0.00%, 100.00% 67.05%, 90.20% 67.05%, 77.36% 59.20%, 77.36% 49.22%, 76.83% 47.65%, 75.76% 46.93%, 73.08% 46.93%, 72.01% 47.36%, 71.84% 48.79%, 71.30% 49.22%, 71.30% 55.56%, 51.34% 43.37%, 50.09% 43.01%, 48.84% 43.37%, 13.37% 64.19%, 0.00% 64.19%);
    --zone: 156px;
    background: linear-gradient(#263F72 0 45%, var(--night) 75%);
  }
  .stage { width: clamp(100%, 58svh, 116%); }
  .stage::before { content: ""; position: absolute; z-index: 1; inset: -1px 0 72%; background: linear-gradient(#263F72, rgb(38 63 114 / 0)); }
  .stage::after { inset: 76% 0 -1px; }
  .light--1 { clip-path: inset(70% 51% 15% 32%); }
  .light--2 { clip-path: inset(52% 51% 33% 33%); }
  .light--3 { clip-path: inset(70% 31% 15% 51%); }
  .light--4 { clip-path: inset(52% 32% 33% 51%); }

  .hero__text { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; row-gap: 24px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .hero h1 { align-self: start; max-width: 16em; }
  .hero__offer { grid-column: 1; justify-self: stretch; max-width: 520px; }
  .hero__offer p { font-size: 1.0625rem; }
  .hero__offer .btn { width: 100%; margin: 14px 0 10px; }
}
/* ---------- Спільне для блоків ---------- */
.wrap { max-width: 1440px; margin-inline: auto; padding-inline: var(--pad); }
.intro { display: grid; gap: 18px; }
.intro h2 { font-size: var(--h2); line-height: 1.06; }
.intro p { max-width: 34em; font-size: 1.125rem; }
.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; }
figure { margin: 0; }
.settle { overflow: hidden; border-radius: var(--round); background: var(--line); }
.settle img { width: 100%; height: 100%; object-fit: cover; }
/* Фото ледь помітно «осідає», коли з'являється на екрані. Воно завжди видиме. */
@media (prefers-reduced-motion: no-preference) {
  .js .settle img { transform: scale(1.07); transition: transform 1.6s var(--ease); }
  .js .settle.is-in img { transform: none; }
}
.note { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.btn--line { border: 1.5px solid var(--text); background: none; color: var(--text); transition: background-color .25s, color .25s; }
.btn--line:hover { background: var(--text); color: #fff; }
@media (min-width: 900px) {
  .intro { grid-template-columns: 7fr 5fr; gap: 48px; align-items: end; }
}

/* ---------- Будинки ---------- */
.houses { padding-block: var(--section); }
.houses :focus-visible { outline-color: var(--cta); }
.house { display: grid; gap: 20px; margin: 14px -8px 0; padding: 26px 20px 20px; border-radius: var(--round); background: var(--surface); }
.intro + .house { margin-top: clamp(32px, 4vw, 56px); }
.house h3 { font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.5rem); line-height: 1; }
.house__head > p { margin-top: 10px; }
.house .house__key { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 16px; color: var(--muted); }
.house__key b { color: var(--text); font: 600 1.25rem/1.3 var(--display); letter-spacing: -.02em; }
.house__photos { display: flex; gap: 8px; min-width: 0; margin-inline: -20px; padding-inline: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
.house__photos::-webkit-scrollbar { display: none; }
.house__photos figure { position: relative; flex: 0 0 86%; aspect-ratio: 4 / 5; scroll-snap-align: start; border-radius: var(--radius); }
.house figcaption { display: none; }
.house__info .btn { width: 100%; margin-top: 16px; padding-inline: 12px; }
.houses .note { margin-top: 24px; }
@media (min-width: 900px) {
  .house { position: relative; grid-template: "head photos" auto "info photos" 1fr / minmax(330px, 4fr) 8fr; gap: 0 var(--gap); margin: var(--gap) 0 0; padding: 0; background: none; }
  .house::before { content: ""; grid-area: 1 / 1 / 3 / 2; border-radius: var(--round); background: var(--surface); }
  .house__head { grid-area: head; padding: 32px 32px 24px; }
  .house__info { grid-area: info; align-self: end; padding: 0 32px 32px; }
  .house .house__key { display: grid; gap: 2px; margin-top: 24px; }
  .house__key span:last-child b { font-size: clamp(1.625rem, 1rem + 1.35vw, 2.5rem); line-height: 1.15; white-space: nowrap; }
  .specs__feat { display: none !important; }
  .house__photos { grid-area: photos; display: grid; grid-template-columns: 12fr 8fr; gap: var(--gap); height: clamp(540px, 38vw, 620px); margin: 0; padding: 0; overflow: visible; }
  .house:nth-of-type(even) .house__photos { grid-template-columns: 8fr 12fr; }
  .house:nth-of-type(even) figure:first-child { order: 2; }
  .house__photos figure { aspect-ratio: auto; min-height: 0; border-radius: var(--round); }
  .house figcaption { position: absolute; left: 14px; bottom: 14px; display: block; max-width: calc(100% - 28px); padding: 11px 18px; border-radius: 22px; font-weight: 500; line-height: 1.25; }
}

/* ---------- Сауна і чан ---------- */
.heat { padding-block: var(--section); border-radius: var(--sheet); background: var(--night); color: #fff; overflow: hidden; }
.heat .intro p { color: var(--frost); }
.heat__photo { position: relative; }
.heat__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.heat__photo::after { content: ""; position: absolute; inset: -1px 0; background: linear-gradient(var(--night), rgb(14 24 38 / 0) 24% 78%, var(--night)); }
.steam { position: absolute; left: 14%; right: 14%; top: 4%; height: 50%; mix-blend-mode: screen; }
.steam i { position: absolute; bottom: 0; width: 42%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgb(205 219 235 / .34), rgb(205 219 235 / 0)); opacity: 0; }
.steam i:nth-child(1) { left: 2%; }
.steam i:nth-child(2) { left: 24%; }
.steam i:nth-child(3) { left: 42%; }
.steam i:nth-child(4) { left: 58%; }
@media (prefers-reduced-motion: no-preference) {
  .steam i { animation: steam 10s linear infinite paused; }
  .steam i:nth-child(2) { animation-delay: -6.5s; }
  .steam i:nth-child(3) { animation-delay: -3s; }
  .steam i:nth-child(4) { animation-delay: -8.2s; }
  .steam.is-on i { animation-play-state: running; }
}
@keyframes steam {
  0% { opacity: 0; transform: translateY(18%) scale(.75); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(9%, -62%) scale(1.5); }
}
.bath h3 { font-size: var(--h3); }
.bath__temp { margin: 4px 0 20px; font: 600 clamp(5rem, 2.6rem + 8vw, 10rem)/1 var(--display); letter-spacing: -.05em; white-space: nowrap; }
.bath__temp small { font-size: .28em; letter-spacing: -.02em; }
.bath--sauna .bath__temp { color: var(--glow); }
.bath--chan .bath__temp { color: #E3ECF5; }
.heat .specs div { border-color: rgb(255 255 255 / .18); }
.heat .specs dt, .heat .note { color: var(--frost); }
.bath--sauna { display: grid; gap: var(--gap); margin: clamp(32px, 4vw, 56px) -8px 0; }
.bath--sauna figure { aspect-ratio: 4 / 5; }
/* Панель сауни світиться, як відкрита піч */
.bath__info { padding: 26px 22px 14px; border-radius: var(--round); background: radial-gradient(90% 75% at 92% 4%, #8E3A17, rgb(94 41 24 / .7) 45%, rgb(35 33 41 / 0)), #1D2533; }
.heat__photo { margin-top: clamp(16px, 2.4vw, 36px); }
.bath--chan { position: relative; z-index: 1; margin: -48px -8px 0; padding: 26px 22px 14px; border-radius: var(--round); }
.heat__add { margin: 28px 0 8px; font-size: 1.125rem; }
@media (min-width: 768px) {
  .bath--sauna { grid-template-columns: 1fr 1fr; margin-inline: 0; }
  .bath--sauna figure { aspect-ratio: auto; height: clamp(560px, 46vw, 720px); }
  .bath__info { display: flex; flex-direction: column; padding: clamp(28px, 3vw, 44px); padding-bottom: clamp(16px, 2vw, 28px); }
  .bath__info .specs { margin-top: auto; }
  .heat__photo img { aspect-ratio: auto; height: min(56vw, 900px); object-position: 50% 80%; }
  .steam { left: 30%; right: 26%; top: 2%; height: 52%; }
  .bath--chan { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(28px, 4vw, 64px); margin: -52px 0 0; padding: 26px clamp(24px, 2.6vw, 40px); }
  .bath--chan .bath__temp { margin: 2px 0 0; font-size: clamp(4.5rem, 6.4vw, 6.5rem); }
  .bath--chan .specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
  .bath--chan .specs div { display: block; padding: 0; border: 0; }
  .bath--chan dd { margin-top: 2px; line-height: 1.35; }
}
@media (min-width: 1200px) {
  .bath--chan .specs { grid-template-columns: .7fr .9fr 1fr 1.7fr 1.1fr; }
}

/* ---------- Територія і поруч ---------- */
.yard { padding-top: var(--section); }
.yard h2, .gallery h2 { font-size: var(--h2); line-height: 1.06; }
.yard .wrap { position: relative; z-index: 1; }
/* Небо й сніг на фото переходять у фон сторінки */
.yard__hill {
  width: 100%; margin-top: 8px;
  -webkit-mask-image: linear-gradient(transparent, #000 22% 84%, transparent); mask-image: linear-gradient(transparent, #000 22% 84%, transparent);
}
.yard__grid { display: grid; gap: var(--gap); }
.yard__grid > * { margin-inline: -8px; }
.yard__grid figure { aspect-ratio: 4 / 5; }
.yard__text { display: grid; gap: var(--gap); }
.yard ul { margin: 0; padding: 8px 20px; border-radius: var(--round); background: var(--surface); list-style: none; }
.yard li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: center; padding: 18px 0; font: 500 clamp(1.125rem, 1rem + .5vw, 1.5rem)/1.25 var(--display); letter-spacing: -.015em; text-wrap: pretty; }
.yard li + li { border-top: 1px solid var(--line); }
.yard li svg { width: 48px; padding: 11px; border-radius: 50%; background: #F8E7DE; fill: none; stroke: var(--cta); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.peaks { position: relative; overflow: hidden; padding: 26px 22px 118px; border-radius: var(--round); background: linear-gradient(#132441, #4A6186); color: #fff; }
.peaks h3 { font-size: var(--h3); }
.peaks p { max-width: 34em; margin-top: 10px; }
.peaks img {
  position: absolute; inset: auto 0 0; width: 100%; height: 120px; object-fit: cover; object-position: 30% 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 60%); mask-image: linear-gradient(transparent, #000 60%);
}
.yard .note { margin-top: 20px; }
@media (min-width: 768px) {
  .yard__hill { height: min(56vw, 960px); margin-top: -3vw; object-fit: cover; object-position: 50% 60%; }
}
@media (min-width: 900px) {
  .yard__grid { grid-template-columns: 5fr 7fr; }
  .yard__grid > * { margin-inline: 0; }
  .yard__grid figure { aspect-ratio: auto; height: clamp(600px, 48vw, 700px); }
  .yard__text { grid-template-rows: auto 1fr; }
  .yard ul { padding: 10px 32px; }
  .peaks { padding: 32px 32px 130px; }
  .peaks img { height: 58%; }
}

/* ---------- Галерея ---------- */
.gallery { padding-block: var(--section); }
.gallery :focus-visible, .yard :focus-visible { outline-color: var(--cta); }
.gallery__head { display: grid; gap: 24px; margin-bottom: 28px; }
.tabs { display: flex; justify-self: start; gap: 2px; padding: 5px; border-radius: 99px; background: var(--surface); }
.tabs button { min-width: 44px; min-height: 44px; padding: 0 clamp(14px, 1.5vw, 22px); border: 0; border-radius: 99px; background: none; color: var(--muted); font: 500 1rem/1.2 var(--body); cursor: pointer; transition: background-color .25s, color .25s; }
.tabs button:hover { color: var(--text); }
.tabs [aria-pressed="true"], .tabs [aria-pressed="true"]:hover { background: var(--text); color: #fff; }
html:not(.js) .tabs { display: none; }
.shots { display: grid; grid-template: "a a" auto "b b" auto "c d" auto / 1fr 1fr; gap: var(--gap); margin: 0 -8px 20px; }
.shots[hidden] { display: none; }
.shot { position: relative; overflow: hidden; border-radius: var(--round); background: var(--line); cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.shot--a { grid-area: a; aspect-ratio: 4 / 5; }
.shot--b { grid-area: b; aspect-ratio: 2.2; }
.shot--c { grid-area: c; aspect-ratio: 1; }
.shot--d { grid-area: d; aspect-ratio: 1; }
@media (hover: hover) { .shot:hover img { transform: scale(1.03); } }
@media (min-width: 768px) {
  .gallery__head { grid-template-columns: 1fr auto; align-items: end; margin-bottom: 40px; }
  .shots { grid-template: "a b b" 1fr "a c d" 1fr / 5fr 4fr 3fr; margin-inline: 0; aspect-ratio: 1.92; }
  .shot { aspect-ratio: auto; min-height: 0; }
}

.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--night); color: #fff; }
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: var(--night); }
.viewer img { width: 100%; height: 100dvh; padding: 68px 0; object-fit: contain; touch-action: pan-y pinch-zoom; }
.viewer__count { position: absolute; left: var(--pad); top: 22px; font-size: 1rem; }
.viewer__btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; }
.viewer__btn svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.viewer__close { right: 8px; top: 8px; }
.viewer__prev { left: 8px; bottom: 8px; }
.viewer__next { right: 8px; bottom: 8px; }
body:has(.viewer[open]) { overflow: hidden; }
@media (min-width: 768px) {
  .viewer img { padding-inline: 84px; }
  .viewer__prev, .viewer__next { bottom: 50%; transform: translateY(50%); }
  .viewer__prev { left: 16px; }
  .viewer__next { right: 16px; }
}

/* ---------- Умови, дорога, питання ---------- */
.rules h2, .road h2, .faq h2 { max-width: 17em; font-size: var(--h2); line-height: 1.06; }
.rules .note, .faq .note { margin-top: 20px; }
.rows { margin: 0; }
.rows dt { font: 600 var(--h3)/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.rows dd { max-width: 34em; margin: 8px 0 0; }

.rules { padding-bottom: var(--section); scroll-margin-top: 36px; }
.rules__time { display: grid; gap: var(--gap); margin: clamp(28px, 4vw, 56px) -8px 0; }
/* Приїжджають увечері, їдуть зранку */
.time { display: flex; flex-direction: column; min-height: 220px; padding: 24px 22px; border-radius: var(--round); }
.time > p:first-child { font: 600 var(--h3)/1.2 var(--display); }
.time__big { margin: auto 0 6px; font: 600 clamp(4.25rem, 2.4rem + 6.4vw, 8.5rem)/1 var(--display); letter-spacing: -.05em; white-space: nowrap; }
.time__big small { font-size: .28em; letter-spacing: -.02em; }
.time--in { background: radial-gradient(70% 90% at 88% 108%, rgb(255 160 90 / .85), rgb(194 65 15 / .4) 45%, rgb(38 63 114 / 0)), linear-gradient(160deg, var(--night), var(--dusk)); color: #fff; }
.time--out { background: radial-gradient(80% 100% at 92% 0%, #FFE2BD, rgb(255 236 214 / 0) 70%), linear-gradient(200deg, #F5F9FC, #BDD2E6); }
.rows--rules { display: grid; margin-top: 12px; }
.rows--rules div { padding: 20px 0; }
.rows--rules div + div { border-top: 1px solid var(--line); }

.road { padding-top: var(--section); border-radius: var(--sheet) var(--sheet) 0 0; background: linear-gradient(var(--night), var(--dusk) 85%); color: #fff; overflow: hidden; }
.road .wrap { position: relative; z-index: 1; }
.road .note { color: var(--frost); }
.road__grid { display: grid; gap: 28px; margin: clamp(28px, 3vw, 44px) 0 24px; }
.road h3 { margin-bottom: 8px; font-size: var(--h3); }
.road__grid p { max-width: 32em; color: #DCE5EE; }
.road__scene { display: block; width: 100%; height: clamp(280px, 36vw, 620px); margin: 0 0 -1px; }
.road__line { fill: none; stroke: var(--cta); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
/* Дорога доходить до котеджу, потім у ньому загоряються вікна */
@media (prefers-reduced-motion: no-preference) {
  .js .road__line { stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s cubic-bezier(.5, .1, .3, 1); }
  .js .road__windows use { opacity: 0; transition: opacity .9s var(--ease) 2.1s; }
  .js .road__windows use:nth-child(2) { transition-delay: 2.4s; }
  .js .road__windows use:nth-child(3) { transition-delay: 2.7s; }
  .js .road__windows use:nth-child(4) { transition-delay: 3s; }
  .js .road__glow { opacity: 0; transition: opacity 1.8s var(--ease) 2.2s; }
  .js .road.is-on .road__line { stroke-dashoffset: 0; }
  .js .road.is-on .road__windows use, .js .road.is-on .road__glow { opacity: 1; }
}

.faq { position: relative; margin-top: -2px; padding-block: clamp(40px, 4vw, 64px) var(--section); background: var(--snow); }
.rows--faq { display: grid; gap: var(--gap); margin: clamp(28px, 3.4vw, 48px) -8px 0; }
.rows--faq div { padding: 22px; border-radius: var(--round); background: var(--surface); }

@media (min-width: 768px) {
  .rules__time, .rows--faq { margin-inline: 0; }
  .rules__time { grid-template-columns: 7fr 5fr; }
  .time { min-height: clamp(300px, 27vw, 400px); padding: clamp(24px, 2.4vw, 36px); }
  .time--out .time__big { margin-bottom: 0; }
  .rows--rules { grid-template-columns: 1fr 1fr; gap: 32px clamp(24px, 3vw, 48px); margin-top: 32px; }
  .rows--rules div, .rows--rules div + div { padding: 0; border: 0; }
  .road__grid { grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 112px); }
  .rows--faq { grid-template-columns: repeat(6, 1fr); }
  .rows--faq div { grid-column: span 2; padding: clamp(22px, 2.2vw, 32px); }
  .rows--faq div:nth-child(-n+2) { grid-column: span 3; }
}
@media (min-width: 1100px) {
  .rows--rules { grid-template-columns: repeat(4, 1fr); }
  .road__scene { margin-top: -5vw; }
}

/* ---------- Запит і футер ---------- */
.request { padding-block: var(--section); border-radius: var(--sheet) var(--sheet) 0 0; background: var(--night); color: #fff; }
.request__grid { display: grid; gap: 36px; }
.request h2 { font-size: var(--h2); line-height: 1.06; }
.request__intro p { max-width: 30em; margin-top: 18px; color: var(--frost); font-size: 1.125rem; }
.request__intro img { display: none; }
.request__panel { min-width: 0; }
.request .note { margin-top: 12px; color: var(--frost); }
.form { display: grid; gap: 22px 16px; }
.form[hidden] { display: none; }
.form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.form label, .form legend { padding: 0; font-weight: 500; }
.form .field > label, .form legend { display: block; margin-bottom: 8px; }
.form .field { min-width: 0; }
.form input:not([type="radio"], [type="checkbox"]) {
  display: block; width: 100%; min-width: 0; height: 56px; margin: 0; padding: 0 16px; border: 2px solid transparent; border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; -webkit-appearance: none; appearance: none;
}
.form input::placeholder { color: #66737F; opacity: 1; }
.form input::-webkit-date-and-time-value { text-align: left; }
.form input[aria-invalid="true"] { border-color: var(--glow); }
.field__err { color: var(--glow); font-size: .9375rem; line-height: 1.4; }
.field__err:not(:empty) { margin-top: 8px; }
.stepper { display: grid; grid-template-columns: 56px 88px 56px; gap: 6px; }
.form .stepper input { padding: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { border: 1.5px solid rgb(255 255 255 / .5); border-radius: var(--radius); background: none; color: #fff; font: 500 1.5rem/1 var(--body); cursor: pointer; touch-action: manipulation; }
.stepper button:hover { background: rgb(255 255 255 / .1); }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picks .pick:nth-child(5) { grid-column: 1 / -1; }
.pick { position: relative; display: grid; cursor: pointer; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick span { display: grid; align-content: center; min-height: 64px; padding: 10px 14px; border: 1.5px solid rgb(255 255 255 / .42); border-radius: var(--radius); line-height: 1.25; transition: background-color .2s, color .2s; }
.pick small { margin-top: 3px; color: var(--frost); font-size: .875rem; font-weight: 400; }
.pick input:checked + span { border-color: #fff; background: #fff; color: var(--text); }
.pick input:checked + span small { color: var(--muted); }
.pick input:focus-visible + span { outline: 3px solid var(--glow); outline-offset: 3px; }
.form__send { width: 100%; border: 0; cursor: pointer; }
.form__send:disabled { opacity: .6; cursor: default; }
.done { max-width: 36em; padding-top: 28px; border-top: 1px solid rgb(255 255 255 / .3); outline: none; }
.done[hidden] { display: none; }
.done h3 { font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.75rem); }
.done p { margin: 16px 0 24px; color: var(--frost); }
.btn--light { border: 1.5px solid #fff; background: none; cursor: pointer; }
.btn--light:hover { background: #fff; color: var(--text); }
.footer { background: var(--night); color: #fff; }
.footer__in { display: grid; gap: 8px; padding-block: 28px 36px; }
.footer__in::before { content: ""; height: 1px; margin-bottom: 20px; background: rgb(255 255 255 / .18); }
.footer p { max-width: 44em; text-wrap: balance; color: var(--frost); font-size: .9375rem; }
@media (min-width: 600px) {
  .form { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
  .form__send { width: auto; }
}
@media (min-width: 900px) {
  .request { padding-block: var(--gap) 0; }
  .request > .wrap { max-width: none; padding-inline: var(--gap); }
  .request__grid { grid-template-columns: 5fr 7fr; gap: 0; }
  .request__intro { position: relative; isolation: isolate; overflow: hidden; min-height: 780px; padding: clamp(32px, 3.4vw, 56px); border-radius: calc(var(--sheet) - var(--gap)); }
  .request__intro img { position: absolute; z-index: -2; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
  .request__intro::after { content: ""; position: absolute; z-index: -1; inset: 0 0 45%; background: linear-gradient(rgb(14 24 38 / .72), rgb(14 24 38 / .45) 55%, rgb(14 24 38 / 0)); }
  .request__intro p { color: #fff; }
  .request__panel { align-self: center; width: 100%; max-width: 860px; padding: 40px clamp(32px, 4.4vw, 80px); }
  .picks:not(.picks--two) { grid-template-columns: repeat(3, 1fr); }
  .picks .pick:nth-child(5) { grid-column: span 2; }
  .footer__in { grid-template-columns: auto 1fr; align-items: center; gap: 8px 48px; }
  .footer__in::before { grid-column: 1 / -1; }
  .footer p { justify-self: end; text-align: right; }
}
body:has(.header.is-open) { overflow: hidden; }

/* ---------- 404 ---------- */
.lost { display: grid; place-content: center; justify-items: start; gap: 20px; min-height: 100svh; padding: 32px var(--pad); background: linear-gradient(var(--night), var(--dusk)); color: #fff; }
.lost h1 { font-size: var(--h2); }

/* ---------- Кнопка запиту внизу (телефон і планшет) ---------- */
.ask {
  position: fixed; z-index: 15; inset: auto 12px max(12px, env(safe-area-inset-bottom)); max-width: 520px; margin-inline: auto; padding: 5px; border-radius: 99px;
  border-color: rgb(255 255 255 / .5); background: rgb(255 255 255 / .34);
  visibility: hidden; transform: translateY(calc(100% + 32px)); transition: transform .4s var(--ease), visibility .4s;
}
.ask .btn { width: 100%; min-height: 52px; padding-block: 10px; }
.ask.is-on { visibility: visible; transform: none; }
@media (min-width: 1024px) { .ask { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
