/* El Salvador Barbershop — стиль у дусі eFolio: гігантський Heebo, рвані рамки фото, смуги з рваним краєм,
   кнопки з нерівним низом, лінії від руки. Палітра — відтінки темного (не чорний), наповнення не змінюється. */
:root {
  --bg: #111214;
  --bg-2: #1a1b1f;       /* чергові секції */
  --bg-3: #26282d;       /* смуга, кнопки, картки */
  --deep: #0b0c0d;       /* футер */
  --text: #ecebe6;
  --muted: #a6a7aa;
  --outline: rgba(236, 235, 230, .8);
  --line: rgba(236, 235, 230, .22);
  --amber: #e0a93f;      /* лише дрібні акценти */
  --radius-sm: 12px;
  --font: "Heebo", "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* «Вирізані від руки» контури: A — зовнішній (малює обводку), B — внутрішній (малює фото/фон) */
  --clipA: polygon(0.5% 1.5%, 12% 0%, 34% 1.2%, 61% 0%, 88% 1%, 100% 0.4%, 99.2% 28%, 100% 56%, 99% 84%, 99.8% 100%, 72% 99%, 46% 100%, 21% 98.8%, 0% 100%, 1% 70%, 0% 41%);
  --clipB: polygon(0% 0.8%, 16% 1.6%, 38% 0%, 66% 1.4%, 90% 0%, 100% 1.2%, 99.5% 33%, 100% 60%, 99.2% 88%, 100% 99.4%, 76% 100%, 49% 98.9%, 24% 100%, 0.4% 99%, 1.2% 66%, 0% 38%);
  /* рваний край смуг і темних секцій */
  --torn: polygon(0 10px, 5% 3px, 11% 11px, 19% 4px, 27% 12px, 36% 5px, 44% 11px, 53% 2px, 61% 10px, 70% 4px, 79% 12px, 88% 5px, 95% 10px, 100% 4px, 100% calc(100% - 9px), 93% calc(100% - 2px), 85% calc(100% - 10px), 76% calc(100% - 4px), 66% calc(100% - 11px), 57% calc(100% - 3px), 47% calc(100% - 9px), 38% calc(100% - 2px), 28% calc(100% - 10px), 18% calc(100% - 4px), 9% calc(100% - 11px), 0 calc(100% - 5px));
  /* кнопка: рівний верх, нерівний низ */
  --btn-clip: polygon(0 0, 100% 3%, 99.4% 76%, 100% 100%, 74% 88%, 49% 97%, 24% 86%, 0 94%);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.65; overflow-x: hidden; }
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
dialog { margin: auto; }
h1, h2, h3 { font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
h3 { font-size: 1.45rem; }
.lead { color: var(--muted); font-size: 1.12rem; }
.t-bold, .title b { font-weight: 900; }
.t-light { font-weight: 300; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--amber); color: #1a1208; padding: 10px 16px; border-radius: 8px; z-index: 100; font-weight: 800; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
dialog:focus, dialog:focus-visible { outline: none; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 32px 22px; border: 0; font-weight: 500; font-size: 1rem; line-height: 1.2; clip-path: var(--btn-clip); transition: transform .3s ease-in-out, background-color .3s ease-in-out, color .3s ease-in-out; }
.btn:hover { transform: translateY(-3px) rotate(-1.2deg); }
.btn-light { background: var(--text); color: #15161a; }
.btn-light:hover { background: var(--amber); }
.btn-dark { background: var(--bg-3); color: var(--text); }
.btn-dark:hover { background: var(--text); color: #15161a; }

/* Рамка фото: тонка обводка від руки (зовнішній контур A + внутрішній B) */
.frame { position: relative; display: block; padding: 2.5px; background: var(--outline); clip-path: var(--clipA); }
.frame > img, .frame > video, .frame > iframe { display: block; width: 100%; clip-path: var(--clipB); background: var(--bg-3); }
.frame-b { --clipA: polygon(0% 1%, 18% 0.4%, 47% 1.4%, 73% 0%, 100% 1.6%, 99.4% 22%, 100% 52%, 98.8% 79%, 100% 99%, 79% 100%, 52% 98.6%, 27% 100%, 1% 99.2%, 0.8% 74%, 0% 47%, 1.2% 21%); --clipB: polygon(1% 0%, 22% 1.2%, 44% 0%, 78% 1.2%, 99% 0%, 100% 26%, 99% 50%, 100% 82%, 99.2% 100%, 84% 98.6%, 57% 100%, 30% 98.8%, 0% 100%, 0% 72%, 1.2% 44%, 0% 18%); }
.frame-c { --clipA: polygon(1.2% 0%, 28% 1.6%, 55% 0.2%, 83% 1.4%, 99.4% 0%, 100% 30%, 99% 61%, 100% 88%, 98.6% 100%, 68% 98.8%, 41% 100%, 14% 99%, 0% 100%, 0.6% 66%, 0% 36%, 1% 12%); --clipB: polygon(0% 1.2%, 11% 0%, 40% 1%, 69% 0%, 94% 1.6%, 100% 0.6%, 99% 36%, 100% 64%, 99.6% 91%, 100% 100%, 63% 99.4%, 34% 98.6%, 9% 100%, 1% 99%, 0% 63%, 1.4% 32%); }
a.frame { transition: transform .35s ease; }

/* Рамка-контур для блоків (прайс, факти) */
.rough { position: relative; isolation: isolate; background: var(--outline); clip-path: var(--clipA); }
.rough::before { content: ""; position: absolute; inset: 2px; background: var(--bg-3); clip-path: var(--clipB); z-index: -1; }
.section-alt .rough::before { background: var(--bg-2); }
.facts .rough:nth-child(2), .price-group:nth-child(2) { --clipA: polygon(0% 1%, 18% 0.4%, 47% 1.4%, 73% 0%, 100% 1.6%, 99.4% 22%, 100% 52%, 98.8% 79%, 100% 99%, 79% 100%, 52% 98.6%, 27% 100%, 1% 99.2%, 0.8% 74%, 0% 47%, 1.2% 21%); --clipB: polygon(1% 0%, 22% 1.2%, 44% 0%, 78% 1.2%, 99% 0%, 100% 26%, 99% 50%, 100% 82%, 99.2% 100%, 84% 98.6%, 57% 100%, 30% 98.8%, 0% 100%, 0% 72%, 1.2% 44%, 0% 18%); }
.facts .rough:nth-child(3), .price-group:nth-child(3) { --clipA: polygon(1.2% 0%, 28% 1.6%, 55% 0.2%, 83% 1.4%, 99.4% 0%, 100% 30%, 99% 61%, 100% 88%, 98.6% 100%, 68% 98.8%, 41% 100%, 14% 99%, 0% 100%, 0.6% 66%, 0% 36%, 1% 12%); --clipB: polygon(0% 1.2%, 11% 0%, 40% 1%, 69% 0%, 94% 1.6%, 100% 0.6%, 99% 36%, 100% 64%, 99.6% 91%, 100% 100%, 63% 99.4%, 34% 98.6%, 9% 100%, 1% 99%, 0% 63%, 1.4% 32%); }

/* Хедер */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(17, 18, 20, .9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 80px; }
.brand img { width: 56px; height: 56px; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; align-items: center; gap: 34px; }
.main-nav a { font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color .3s ease-in-out, color .3s ease-in-out; }
.main-nav a:hover { border-bottom-color: var(--text); }
.nav-toggle { display: none; width: 52px; height: 52px; border: 0; background: var(--text); padding: 15px 13px; flex-direction: column; justify-content: space-between; clip-path: polygon(0 0, 100% 4%, 98% 100%, 3% 96%); }
.nav-toggle span { display: block; height: 3px; background: #15161a; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: 56px 70px; }
.hero::before { /* міліметрівка, що тане донизу */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(236, 235, 230, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 235, 230, .07) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent);
}
.hero .container { position: relative; }
.eyebrow { display: inline-block; color: var(--amber); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .82rem; margin-bottom: 20px; }
.hero-title { font-size: clamp(2.9rem, 14.5vw, 9.5rem); line-height: .98; letter-spacing: -.035em; margin-bottom: 28px; }
@media (min-width: 861px) { .hero-title { font-size: clamp(3.2rem, 7.2vw, 6.6rem); } }  /* на вебі заголовок менший */
.hero-title span { display: block; }
.hero-row { display: grid; grid-template-columns: auto 340px; justify-content: center; gap: clamp(48px, 8vw, 128px); align-items: center; }
.hero-copy .lead { max-width: 33em; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.header-book { gap: 13px; padding: 10px 24px 18px; font-size: 1.0625rem; } /* текст на 1px більший за пункти меню (16px), іконка +30%, габарити кнопки (≈184×57) ті самі */
.book-ico { width: 29px; height: 29px; flex: none; background: currentColor;
  -webkit-mask: url("images/icons/calendar-clock.svg") center / contain no-repeat;
  mask: url("images/icons/calendar-clock.svg") center / contain no-repeat; }
.hero-media { position: relative; width: 100%; }
.hero-video { aspect-ratio: 9 / 16; object-fit: cover; }
.hero-spiral { position: absolute; right: -64px; top: -36px; width: 190px; opacity: .55; pointer-events: none; }
.spin-badge { position: absolute; left: -52px; bottom: -34px; width: 124px; height: 124px; border-radius: 50%; background: var(--bg); transition: transform .35s ease; }
.spin-badge:hover { transform: scale(1.08) rotate(-8deg); }
.spin-badge svg { width: 100%; height: 100%; overflow: visible; }
.spin-text { transform-origin: 60px 60px; animation: spin 18s linear infinite reverse; }
.spin-badge text { fill: var(--text); font-size: 10.8px; font-weight: 700; letter-spacing: .09em; }
.spin-disc { fill: var(--text); }
.spin-arrow { fill: none; stroke: #15161a; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Смуга з біжучим рядком і рваним краєм */
.band { background: var(--bg-3); clip-path: var(--torn); padding-block: 26px 28px; overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee-track span { font-size: clamp(2rem, 5.4vw, 3.8rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; padding-inline: 28px; white-space: nowrap; }
.marquee-track span::after { content: "✕"; color: var(--amber); font-weight: 400; font-size: .5em; margin-left: 56px; vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Секції */
.section { padding-block: 100px; }
.section-alt { background: var(--bg-2); }
.torn { position: relative; z-index: 1; clip-path: var(--torn); padding-block: 116px; }
.section-head { max-width: 760px; margin-bottom: 52px; }
.section-head .lead { margin-top: 4px; }
.title { font-size: clamp(2.4rem, 6.4vw, 4.8rem); font-weight: 300; letter-spacing: -.03em; line-height: 1.04; margin-bottom: 20px; }

/* Про нас */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.facts li { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 2px; }
.facts strong { font-weight: 800; }
.facts span { color: var(--muted); font-size: .92rem; line-height: 1.4; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.about-photos img { aspect-ratio: 3 / 4; object-fit: cover; }
.about-photos .frame:nth-child(2) { margin-top: 48px; }

/* Прайс */
.price-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: start; }
.price-group { padding: 32px 30px 34px; }
.price-group h3 { margin-bottom: 8px; }
.price-list li { display: flex; align-items: baseline; gap: 10px; padding: 12px 0 15px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='8' viewBox='0 0 320 8'%3E%3Cpath d='M0 4 L58 4.3 L121 3.6 L127 5.8 L133 3.6 L219 4.2 L291 3.7 L320 4' fill='none' stroke='%23ecebe6' stroke-opacity='.3' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x left bottom / 320px 8px; }
.price-list li:last-child { background: none; padding-bottom: 6px; }
.price-list .name { font-weight: 500; }
.price-list .dots { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.price-list .price { font-weight: 800; white-space: nowrap; }

/* Галерея */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: start; }
.gallery-grid img { aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-grid .frame:nth-child(4n + 2) { margin-top: 30px; }
.gallery-grid .frame:nth-child(4n + 4) { margin-top: 14px; }

/* Контакти */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: center; }
.contact-list { display: grid; gap: 20px; margin-bottom: 32px; }
.contact-list li { display: flex; flex-direction: column; gap: 2px; }
.contact-list .label { color: var(--amber); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.contact-list .big { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.contact-list a:not(.big) { border-bottom: 1px solid var(--line); transition: border-color .3s, color .3s; }
.contact-list a:not(.big):hover { color: var(--amber); border-color: var(--amber); }
.contact-map iframe { height: 380px; border: 0; filter: invert(.92) hue-rotate(180deg) grayscale(.45) contrast(.95); }

/* Футер */
.site-footer { background: var(--deep); padding-block: 56px 40px; margin-top: -9px; color: var(--muted); position: relative; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.footer-inner .brand img { width: 175px; height: 175px; } /* емблема: вдвічі більша за шапкову, ще +30% і +20% */
.footer-text { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.footer-inner p span { display: block; text-wrap: balance; }
.footer-inner .copy { font-size: .9rem; }
/* Веб: емблема зліва, а напис разом із копірайтом справа від неї (мобільна версія лишається колонкою) */
@media (min-width: 861px) {
  .footer-inner { flex-direction: row; justify-content: center; gap: 36px; }
  .footer-text { align-items: flex-start; gap: 10px; text-align: left; }
  .footer-text p { text-align: left; }
}

/* Лайтбокс */
.lightbox { border: 0; background: transparent; max-width: 96vw; max-height: 96vh; padding: 0; overflow: visible; }
.lightbox::backdrop { background: rgba(8, 9, 10, .92); }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: var(--radius-sm); margin: auto; }
.lightbox button { position: absolute; z-index: 2; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--text); color: #15161a; font-size: 1.6rem; font-weight: 900; line-height: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }

/* Поява блоків */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .frame.reveal { transform: translateY(32px) rotate(1.6deg); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .frame.reveal.is-visible:hover { transform: rotate(-.8deg) scale(1.02); transition: transform .35s ease; }

/* Фон: намальовані від руки доодли, що плавають і зрушуються при прокрутці, косі штрихи, світіння, зерно */
.section { position: relative; }
.section > .container { position: relative; z-index: 1; }
.decos { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background: var(--glow, none); }
.deco { position: absolute; width: var(--w, 140px); max-width: none; height: auto; opacity: calc(var(--o, .3) * 1.35); rotate: var(--r, 0deg); translate: 0 var(--py, 0px); animation: bob var(--d, 10s) ease-in-out infinite; will-change: translate; }
.d-hm { }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
.xfield { position: absolute; width: 360px; height: 240px; opacity: .9; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M10 10 L20 20 M20 10 L10 20' stroke='%23ecebe6' stroke-opacity='.2' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 30px 30px;
  -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent); mask-image: radial-gradient(closest-side, #000 25%, transparent); }
.hero .decos { --glow: radial-gradient(620px 420px at 88% 8%, rgba(224, 169, 63, .1), transparent 70%), radial-gradient(520px 380px at 4% 92%, rgba(181, 69, 45, .1), transparent 70%); }
#about .decos { --glow: radial-gradient(560px 400px at 6% 14%, rgba(181, 69, 45, .13), transparent 70%); }
#prices .decos { --glow: radial-gradient(640px 420px at 92% 90%, rgba(224, 169, 63, .08), transparent 70%); }
#gallery .decos { --glow: radial-gradient(620px 420px at 94% 8%, rgba(181, 69, 45, .11), transparent 70%); }
#contacts .decos { --glow: radial-gradient(600px 400px at 6% 86%, rgba(224, 169, 63, .09), transparent 70%); }
.section-alt { background-image: repeating-linear-gradient(135deg, rgba(236, 235, 230, .035) 0 1px, transparent 1px 13px); }
body::after { /* зерно поверх усього, ледь помітне */
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (max-width: 860px) {
  .deco { width: calc(var(--w, 140px) * .6); }
  .d-hm { display: none; }
  .xfield { width: 240px; height: 160px; }
}

/* Адаптив */
@media (max-width: 1080px) {
  .nav-toggle { display: flex; }
  .header-book { margin-left: auto; } /* «Записатись» притиснута праворуч, впритул до бургера (він крайній): інтерфейс під правий палець */
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 16px 24px rgba(0, 0, 0, .4); display: none; margin-left: 0; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 20px; }
  .main-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 920px) {
  .price-groups { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid .frame:nth-child(n) { margin-top: 0; }
  .gallery-grid .frame:nth-child(3n + 2) { margin-top: 22px; }
}
@media (max-width: 860px) {
  .section { padding-block: 64px; }
  .torn { padding-block: 78px; }
  .hero { padding-block: 36px 52px; }
  .hero-row { grid-template-columns: 1fr; gap: 56px; }
  .hero-media { width: min(100%, 300px); margin-inline: auto; }
  .hero-actions { justify-content: center; } /* кнопки по центру, як і відео */
  .hero-spiral { right: -40px; top: -60px; width: 150px; }
  .spin-badge { left: -26px; bottom: -28px; width: 104px; height: 104px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-photos .frame:nth-child(2) { margin-top: 26px; }
  .contact-map iframe { height: 300px; }
  .band { padding-block: 20px 22px; }
}
@media (max-width: 560px) {
  .header-book.btn { gap: 10px; padding: 9px 18px 19px; font-size: 1.0625rem; }
  .header-book .book-ico { width: 26px; height: 26px; }
  .spin-badge { left: -4px; width: 96px; height: 96px; }
  .hero-spiral { right: -16px; width: 130px; }
  .brand img { width: 48px; height: 48px; }
  .footer-inner .brand img { width: 150px; height: 150px; }
  .facts { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .gallery-grid .frame:nth-child(n) { margin-top: 0; }
  .gallery-grid .frame:nth-child(even) { margin-top: 18px; }
  .price-group { padding: 26px 20px 28px; }
  .btn { padding: 12px 26px 20px; }
  .marquee-track span::after { margin-left: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .deco { translate: none; }
}
