/* ===========================================================
   СПАДЩИНА — спільні стилі
   Чорно-біла база, тонкий спокійний шрифт, без вау-ефектів
   =========================================================== */

/* --- Змінні тем --- */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6f6f6f;
  --line: #e4e4e4;
  --accent: #111111;
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Матеріальні теми (сторінка "Простори") */
[data-material="beton"] {
  --bg: #d9d7d2;   /* бетон */
  --fg: #1c1c1a;
  --muted: #5c5a55;
  --line: #bdbab3;
  --accent: #2b2b28;
}
[data-material="sklo"] {
  --bg: #e7f0f3;   /* скло */
  --fg: #16323b;
  --muted: #5a7b84;
  --line: #cde0e6;
  --accent: #1d4550;
}
[data-material="zalizo"] {
  --bg: #1a1c1e;   /* залізо */
  --fg: #e8e8e6;
  --muted: #9a9c9e;
  --line: #34383c;
  --accent: #cfd2d4;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
}

/* Кастомний курсор — ховаємо системний на пристроях з мишею */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, [role="button"], .clickable,
  textarea, input, select { cursor: none; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Типографіка --- */
h1, h2, h3, h4 {
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: 0.005em;
}
h1 { font-size: clamp(2.6rem, 7vw, 6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 300; color: var(--fg); }
.muted { color: var(--muted); }

/* --- Розкладка --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
section { padding-block: clamp(72px, 12vh, 160px); }
.divider { height: 1px; background: var(--line); border: 0; }

/* --- Хедер / навігація --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; height: 68px;
}
.brand {
  font-weight: 300; font-size: 1.05rem;
  letter-spacing: 0.42em; text-transform: uppercase;
}
.nav-links { display: flex; gap: clamp(18px, 3vw, 40px); list-style: none; }
.nav-links a {
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); position: relative; padding-block: 6px;
  transition: color 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--fg);
}
.nav-toggle { display: none; background: none; border: 0; color: inherit; font-size: 1.4rem; }

@media (max-width: 840px) {
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform 0.4s var(--ease);
    padding: 8px var(--gutter) 24px;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding-block: 14px; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
}

/* --- Hero --- */
.hero { padding-block: clamp(90px, 18vh, 220px); }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 46ch; margin-top: 28px; }

/* --- Кнопки / посилання-стрілки --- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--fg); padding: 14px 26px; border-radius: 0;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn--ghost { border-color: var(--line); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  border-bottom: 1px solid transparent; padding-bottom: 3px;
  transition: border-color 0.3s var(--ease);
}
.arrow-link:hover { border-color: var(--fg); }
.arrow-link::after { content: "→"; transition: transform 0.3s var(--ease); }
.arrow-link:hover::after { transform: translateX(5px); }

/* --- Сітка карток / заглушки фото --- */
.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.ph {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background:
    repeating-linear-gradient(45deg,
      color-mix(in srgb, var(--fg) 5%, transparent) 0 10px,
      transparent 10px 20px),
    color-mix(in srgb, var(--fg) 4%, transparent);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.ph span {
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}
.ph--wide { aspect-ratio: 16 / 9; }

/* --- Новини --- */
.news-item {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 24px;
  align-items: baseline; padding-block: 28px; border-top: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.news-item:hover { padding-left: 10px; }
.news-item time { font-size: 0.8rem; letter-spacing: 0.1em; color: var(--muted); }
.news-item h3 { font-size: clamp(1.2rem, 2.2vw, 1.7rem); }
.news-item p { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }
@media (max-width: 620px) {
  .news-item { grid-template-columns: 1fr; gap: 8px; }
}

/* --- Мапа України --- */
.map-wrap {
  position: relative; width: 100%; max-width: 820px; margin-inline: auto;
}
.map-wrap svg { width: 100%; height: auto; }
.map-country { fill: none; stroke: var(--fg); stroke-width: 1; opacity: 0.5; }
.map-point { outline: none; }
.map-cross line { stroke: var(--fg); stroke-width: 1.5; }
.map-cross {
  transform-box: fill-box; transform-origin: center;
  transition: transform 0.35s var(--ease);
}
.map-point:hover .map-cross, .map-point:focus .map-cross {
  transform: rotate(45deg) scale(1.3);
}
.map-dot-hit { fill: transparent; }
.map-label {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  fill: var(--muted); opacity: 0; transition: opacity 0.3s var(--ease);
}
.map-point:hover .map-label, .map-point:focus .map-label { opacity: 1; fill: var(--fg); }
/* на сенсорних екранах hover нема — підписи видно одразу */
@media (hover: none), (pointer: coarse) {
  .map-label { opacity: 1; }
}

/* --- Перемикач матеріалів --- */
.material-switch {
  position: sticky; top: 68px; z-index: 40;
  display: flex; gap: 4px; justify-content: center;
  padding-block: 18px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.material-switch button {
  background: none; border: 1px solid transparent; color: var(--muted);
  font-family: inherit; font-size: 0.78rem; letter-spacing: 0.22em;
  text-transform: uppercase; padding: 10px 22px; border-radius: 0;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.material-switch button:hover { color: var(--fg); }
.material-switch button[aria-selected="true"] {
  color: var(--fg); border-color: var(--fg);
}

.material-intro { max-width: 52ch; }

/* Перемикач матеріалів на головній: великі спокійні слова */
.material-inline { margin-top: 18px; }
.material-inline button {
  display: block; text-align: left;
  background: none; border: 0; padding: 0;
  font-family: inherit; font-weight: 200;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.25;
  color: var(--muted);
  transition: color 0.4s var(--ease), letter-spacing 0.4s var(--ease);
}
.material-inline button:hover { color: var(--fg); }
.material-inline button[aria-selected="true"] {
  color: var(--fg); letter-spacing: 0.06em;
}

/* --- Футер --- */
.site-footer {
  border-top: 1px solid var(--line); padding-block: 56px;
  color: var(--muted); font-size: 0.85rem;
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-grid a:hover { color: var(--fg); }

/* --- Курсор-хрестик (рівний Х / плюс) --- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 26px; height: 26px; transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease), height 0.2s var(--ease), opacity 0.2s var(--ease);
  mix-blend-mode: difference;
}
.cursor::before, .cursor::after {
  content: ""; position: absolute; background: #fff;
}
/* вертикальна лінія */
.cursor::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
/* горизонтальна лінія */
.cursor::after { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
.cursor.is-active { width: 40px; height: 40px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* --- Дрібне --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.stack > * + * { margin-top: 1.1em; }
.section-head { max-width: 60ch; margin-bottom: clamp(32px, 6vh, 72px); }
.section-head .eyebrow { display: block; margin-bottom: 18px; }

/* ===========================================================
   Сторінка "Зв'язок з нами" — форма крізь туман
   =========================================================== */
.contact-page { min-height: 100vh; display: flex; flex-direction: column; }
.contact-main {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(60px, 12vh, 140px) clamp(28px, 8vw, 140px);
}
.contact-field {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent;
  color: #000; font-family: inherit; font-weight: 200;
  font-size: clamp(1.8rem, 4.4vw, 3.4rem); line-height: 1.25;
  letter-spacing: 0.005em; min-height: 1.4em; overflow: hidden;
}
.contact-field::placeholder { color: #c9c9c9; font-weight: 200; }

/* елементи, що проявляються крізь туман */
.fog {
  opacity: 0; filter: blur(14px); transform: translateY(8px);
  transition: opacity 1.6s var(--ease), filter 1.6s var(--ease), transform 1.6s var(--ease);
  pointer-events: none;
}
.fog.show { opacity: 1; filter: blur(0); transform: none; pointer-events: auto; }

.contact-actions { margin-top: clamp(36px, 7vh, 72px); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.attach {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #111; background: none; border: 0; font-family: inherit;
}
.attach .plus { position: relative; width: 18px; height: 18px; display: inline-block; }
.attach .plus::before, .attach .plus::after { content: ""; position: absolute; background: #111; }
.attach .plus::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.attach .plus::after { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
.attach:hover { opacity: 0.55; }

.attached-list { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.attached-list span { display: inline-block; margin-right: 14px; }

.send {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: #fff; background: #000; border: 0; font-family: inherit;
  padding: 18px 38px;
  transition: opacity 1.6s var(--ease), filter 1.6s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.send:hover { transform: translateX(4px); }
.send::after { content: "→"; }

.contact-mini-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px clamp(28px, 8vw, 140px);
}
.contact-mini-header a { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.contact-mini-header a:hover { color: #000; }
.contact-mini-header .brand { letter-spacing: 0.42em; color: #000; }

.contact-sent { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 200; }
@media (max-width: 620px) {
  .send { margin-left: 0; width: 100%; justify-content: center; }
}
