/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/inter-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/lora-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/lora-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/lora-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/lora-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/lora-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/lora-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  /* Colors */
  --color-bg:       #0f4d3a;
  --color-text:     #ffffff;
  --color-name:     #082f24;
  --color-dim:      rgba(255, 255, 255, 0.8);

  /* Fonts */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  /* Layout */
  --pad-x:      clamp(20px, 6.25vw, 80px);
  --hero-indent: clamp(27px, 5.1vw, 67px);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

img, svg {
  display: block;
}

/* Line-break helpers */
.br-mobile { display: none; }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* main забирает всё свободное место — футер и decorative-name всегда прижаты к низу */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  width: 100%;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  flex-shrink: 0;
  padding-top: clamp(24px, 4.35vh, 47px);
  padding-bottom: clamp(16px, 2.2vh, 24px);
}

.header .container {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

/* Logo */
.logo {
  display: block;
  width: clamp(114px, 21.6vw, 283px);
  /* SVG has 3.4% internal left padding before the "Z" symbol.
     Shift left to align "Z" with footer icons on the same grid line. */
  transform: translateX(-3.4%);
}

.logo img {
  width: 100%;
  height: auto;
}

/* Language switcher */
.language-switcher {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  align-self: start;
  margin-top: clamp(4px, 0.71vw, 9.5px);
  gap: 7px;
}

.lang-btn {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(5px, 1.25vw, 16px);
  letter-spacing: 0.1em;
  color: var(--color-text);
  line-height: 1;
  opacity: 0.65;
  transition: opacity 0.2s ease;
  display: block;
  padding: 0 6px;
  position: relative;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  opacity: 1;
}

/* Tap-zone extension via ::before — keeps 24px minimum without visual dead space.
   First button (UA) extends upward, last (EN) extends downward; no overlap between zones. */
.language-switcher .lang-btn:first-child::before,
.language-switcher .lang-btn:last-child::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
}
.language-switcher .lang-btn:first-child::before {
  top: calc(1em - 24px);
  bottom: 0;
}
.language-switcher .lang-btn:last-child::before {
  top: 0;
  bottom: calc(1em - 24px);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero .container {
  padding-left: calc(var(--pad-x) + var(--hero-indent));
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Hero label (ПРЕВЕНЦІЯ / PREVENTION) */
.hero-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(5px, 1.25vw, 16px);
  letter-spacing: 0.1em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: clamp(10px, 1.8vh, 24px);
}

/* Hero title — H1 */
.hero-title {
  font-family: var(--font-serif);
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: clamp(12px, 2vh, 28px);
  text-wrap: balance;
}

html[lang="uk"] .hero-title {
  --h1-size: clamp(15px, calc(4.53vw - 2px), 35px);
  font-size: var(--h1-size);
}

html[lang="en"] .hero-title {
  --h1-size: clamp(14px, 3.72vw, 35px);
  font-size: var(--h1-size);
}

.hero-title-regular {
  font-weight: 400;
}

.hero-title-bold {
  font-weight: 700;
}

.hero-title-line3 {
  display: block;
  position: relative;
  width: fit-content;
}

/* Hero description */
.hero-description {
  font-family: var(--font-sans);
  font-size: clamp(6px, 1.5625vw, 16px);
  line-height: 1.5;
  color: var(--color-text);
}

.hero-desc-regular {
  font-weight: 400;
}

.hero-desc-medium {
  font-weight: 500;
}

/* ============================================================
   STATUS ("САЙТ НЕЗАБАРОМ" / "COMING SOON") — in header
   ============================================================ */
.status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;

  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(5px, 1.25vw, 16px);
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6); /* intentionally more subdued than --color-dim (0.8) */
  white-space: nowrap;
  line-height: 1;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  flex-shrink: 0;
  padding-top: clamp(10px, 1.8vh, 20px);
  padding-bottom: clamp(10px, 1.8vh, 20px);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(10px, 1.5vh, 16px) clamp(12px, 2vw, 24px);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 40px);
}

.footer-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
}

/* Footer link — base */
.footer-link {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(6px, 1.5625vw, 20px);
  color: var(--color-text);
  line-height: 1;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.7;
}

/* Icon + text links (WhatsApp, Telegram) */
.footer-icon-link {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.5vw, 8px);
}

/* Icon circle only (viewBox cropped to circle bounds) */
.footer-logo {
  display: block;
  flex-shrink: 0;
  height: clamp(10px, 1.72vw, 22px);
  width: auto;
}

/* WhatsApp / Telegram text label next to icon */
.footer-icon-link span {
  color: var(--color-dim);
}

/* Social text links (X.COM, LINKEDIN) */
.footer-social {
  color: var(--color-dim);
  letter-spacing: 0.03em;
}

/* ============================================================
   DECORATIVE NAME
   ============================================================ */
.decorative-name {
  flex-shrink: 0;
  width: 100%;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  /* 0.82em = JS-set font-size × 0.82; clips descenders, keeps cap height visible */
  height: 0.82em;
  overflow: hidden;

  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-name);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;

  text-shadow: 0px 1px 0px rgba(26, 106, 82, 0.2);
}

/* no-JS fallback only; JS overrides font-size on the container dynamically */
html[lang="uk"] .decorative-name {
  margin-top: 9px;
  font-size: max(44px, 11.87vw);
}

html[lang="en"] .decorative-name {
  margin-top: 5px;
  font-size: max(51px, 13.82vw);
}

html[lang="uk"] .decorative-name span {
  display: inline-block;
  position: relative;
  top: 0.065em;
}

/* Shift EN span down so the Z tail disappears under the bottom clip */
html[lang="en"] .decorative-name span {
  display: inline-block;
  position: relative;
  top: 0.067em;
}

/* ============================================================
   MEDIA QUERIES  (mobile-first)
   ============================================================ */

/* --- Mobile <768px --- */
@media (max-width: 767px) {
  :root {
    --hero-indent: clamp(32.8px, calc(5.1vw + 5.9px), 72.8px);
  }

  .br-mobile  { display: inline; }
  .br-desktop { display: none; }

  /* Line3 becomes inline so "ухвалюют рішення" flows on one line */
  .hero-title-line3 {
    display: inline;
  }

  .logo {
    width: clamp(139px, calc(21.6vw + 25px), 308px);
  }

  .hero-label {
    margin-bottom: clamp(20px, 3.6vh, 48px);
  }

  .hero-title {
    margin-bottom: clamp(24px, 4vh, 56px);
  }

  html[lang="uk"] .hero-title {
    font-size: clamp(20px, calc(3.26vw + 7.78px), 35px);
  }

  html[lang="en"] .hero-title {
    font-size: clamp(18px, calc(2.69vw + 7.91px), 35px);
  }

  html[lang="uk"] .hero-label,
  html[lang="uk"] .status {
    font-size: clamp(9px, calc(0.15vw + 8.43px), 16px);
  }

  html[lang="en"] .hero-label,
  html[lang="en"] .status {
    font-size: clamp(8.1px, calc(0.38vw + 6.67px), 16px);
  }

  html[lang="uk"] .hero-description,
  html[lang="uk"] .footer-link {
    font-size: clamp(10.9px, calc(0.28vw + 9.85px), 16px);
  }

  html[lang="en"] .hero-description,
  html[lang="en"] .footer-link {
    font-size: clamp(9.8px, calc(0.56vw + 7.7px), 16px);
  }

  .lang-btn {
    font-size: clamp(9px, calc(0.15vw + 8.43px), 16px);
  }
}

/* --- Narrow/medium phones ≤500px — status moves to its own row below logo+nav --- */
@media (max-width: 500px) {
  .header .container {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 70px;
  }
  .logo              { grid-column: 1; grid-row: 1; }
  .language-switcher { grid-column: 2; grid-row: 1; }
  .status {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    pointer-events: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
  }
}

/* --- Narrow phones ≤430px — footer stacks vertically, centered --- */
@media (max-width: 430px) {
  .footer .container {
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.5vh, 12px);
  }
  .footer-center {
    flex: none;
  }
}

/* --- Tablet 768px --- */
@media (min-width: 768px) {
  .footer .container {
    flex-wrap: nowrap;
  }
}

/* --- Laptop 1024px --- */
@media (min-width: 1024px) {
  .hero-label {
    margin-bottom: clamp(24px, 4vh, 48px);
  }

  .hero-title {
    margin-bottom: clamp(28px, 6.5vh, 68px);
  }
}

/* --- Full HD 1920px --- */
@media (min-width: 1920px) {
  :root {
    --pad-x: 120px;
  }
}

/* --- 2K / 4K 2560px+ --- */
@media (min-width: 2560px) {
  :root {
    --pad-x: 160px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .lang-btn,
  .footer-link {
    transition: none;
  }
}
