/* =========================================================
   Церква Всіх Святих — landing
   ========================================================= */

:root {
  /* Brand */
  --blue: #005487;          /* основний колір лого */
  --blue-deep: #003a5e;
  --ink: #0c1f2e;           /* нічна синява — основний текст */
  --ink-soft: #3c5061;      /* вторинний текст на світлому */
  --ground: #f8f8f5;        /* вапнована стіна */
  --ground-2: #efefeb;      /* світла площина */
  --rule: #d5dbe0;
  --gold: #e0ab45;          /* свічка: лише Donate і фокус */
  --gold-hover: #eebd5c;
  --on-blue: #ffffff;
  --on-blue-soft: #c9dcea;
  --rule-on-blue: rgba(201, 220, 234, 0.28);

  /* Type */
  --serif: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif; /* заголовки */
  --sans: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;  /* текст */

  /* Space */
  --gutter: clamp(1rem, 4vw, 3rem);
  --section: clamp(5rem, 11vw, 9.5rem);
  --maxw: 1240px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--blue) var(--ground-2);
  accent-color: var(--blue);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Language switching: show only the active language */
html[data-lang="uk"] body [lang="en"],
html[data-lang="en"] body [lang="uk"] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--gold); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 4px; font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Placeholders to replace with real facts */
.ph {
  background: rgba(0, 84, 135, 0.08);
  color: inherit;
  border-bottom: 1px dashed currentColor;
  padding: 0.05em 0.3em;
  border-radius: 2px;
}
.ph--dark, .hero .ph { background: rgba(255, 255, 255, 0.12); }

/* ---------- Type ---------- */
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: clamp(1.25rem, 2vw, 1.75rem);
}

.lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.btn--gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(12, 31, 46, 0.18);
}
.btn--gold:hover {
  background: var(--gold-hover);
  box-shadow: 0 6px 18px -6px rgba(224, 171, 69, 0.7);
  transform: translateY(-1px);
}
.btn--gold:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(12, 31, 46, 0.18); }
.btn--gold:focus-visible { outline-color: #fff; }
.btn--lg { min-height: 52px; padding: 0.8rem 1.9rem; font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  color: #fff;
  transition: background-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.site-header.is-solid {
  background: var(--blue-deep);
  box-shadow: 0 8px 24px -16px rgba(0, 20, 35, 0.6);
}
.site-header__inner {
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  height: var(--header-h);
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 2rem;
}

.brand {
  display: block;
  margin-right: auto;
}

.brand__logo { height: 46px; width: auto; }

.nav__list { display: flex; gap: 2rem; }
.nav a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.2s;
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0.25rem;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav a:hover { color: #fff; }
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }
.nav a[aria-current="true"] { color: #fff; }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-actions .btn { min-height: 38px; padding-block: 0; }

.lang {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 2px;
}
.lang__btn {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: rgba(255, 255, 255, 0.78);
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.06em;
  padding: 0.5rem 0.65rem;
  min-height: 32px;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.lang__btn:hover { color: #fff; }
.lang__btn[aria-pressed="true"] { background: #fff; color: var(--blue-deep); }

.menu-toggle {
  display: none;
  appearance: none; border: 0; background: transparent; color: inherit;
  width: 44px; height: 44px; margin-right: -10px;
  align-items: center; justify-content: center; cursor: pointer;
}
.menu-toggle__close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__close { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100vh, 60rem);
  min-height: min(100svh, 60rem);
  display: flex; align-items: flex-end;
  color: #fff;
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
.hero__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 50%;
  animation: hero-settle 2.4s var(--ease-out) both;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 30, 50, 0.55) 0%, rgba(0, 30, 50, 0) 22%),
    linear-gradient(20deg, rgba(0, 38, 64, 0.94) 0%, rgba(0, 58, 94, 0.72) 38%, rgba(0, 84, 135, 0.12) 72%, rgba(0, 84, 135, 0) 100%);
}

.hero__content {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: calc(var(--header-h) + 3rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas:
    "title   ."
    "sub     welcome"
    "more    welcome";
  column-gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.hero__title {
  grid-area: title;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 1.4rem + 6.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.hero__sub {
  grid-area: sub;
  align-self: start;
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "slnt" -8;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--on-blue-soft);
}
.hero__welcome {
  grid-area: welcome;
  max-width: 34rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}
.hero__more {
  grid-area: more;
  align-self: end;
  justify-self: start;
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2rem;
  padding: 0.5rem 0;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: border-color 0.25s, gap 0.35s var(--ease-out);
}
.hero__more:hover { border-color: #fff; gap: 0.85rem; }

/* The one authored moment: the photo settles, the words come into focus */
.hero__title, .hero__sub, .hero__welcome, .hero__more {
  animation: hero-focus 1.3s var(--ease-out) both;
}
.hero__title   { animation-delay: 0.15s; }
.hero__sub     { animation-delay: 0.35s; }
.hero__welcome { animation-delay: 0.5s; }
.hero__more    { animation-delay: 0.7s; }

@keyframes hero-settle {
  from { transform: scale(1.08); filter: brightness(0.6); }
  to   { transform: scale(1);    filter: brightness(1); }
}
@keyframes hero-focus {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none;             filter: blur(0); }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }

/* About */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}
.about__text { max-width: 36rem; }
.about__text .lead { margin-bottom: 1.5rem; color: var(--blue); }
.about__text p + p { margin-top: 1rem; }
.about__text p:not(.lead) { color: var(--ink-soft); }

.about__figure {
  position: relative;
}
.about__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 4px 4px; /* арка */
  box-shadow: 0 30px 60px -30px rgba(0, 40, 70, 0.45);
}

/* Vision — blue field */
.vision {
  background: var(--blue-deep);
  color: var(--on-blue);
}
.vision__head {
  max-width: 44rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.vision__head .lead { color: var(--on-blue-soft); }

.values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-on-blue);
}
.value {
  padding: 2rem clamp(1rem, 2.5vw, 2rem) 0.5rem 0;
}
.value + .value {
  padding-left: clamp(1rem, 2.5vw, 2rem);
  border-left: 1px solid var(--rule-on-blue);
}
.value__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.value p {
  color: var(--on-blue-soft);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 22rem;
}

/* History */
.history { background: var(--ground-2); }
.history__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.history__head {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}
.history__head .lead { color: var(--ink-soft); max-width: 26rem; }

.timeline { border-top: 1px solid var(--rule); }
.timeline__item {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 2rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--rule);
}
.timeline__year {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.375rem;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--blue);
  font-variant-numeric: lining-nums tabular-nums;
}
.timeline__body p { color: var(--ink); max-width: 34rem; padding-top: 0.1rem; }
.timeline__item--now .timeline__year { font-variation-settings: "slnt" -8; }

/* ---------- Footer ---------- */
.footer {
  background: var(--blue-deep);
  color: #fff;
  padding-top: var(--section);
  padding-bottom: 2rem;
}
.support {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
  padding-bottom: clamp(4rem, 8vw, 6rem);
}
.support__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.support .support__pending { margin: 1rem 0 0; font-size: 0.9375rem; color: var(--on-blue-soft); }
.support .support__pending:empty { margin: 0; }

.support p {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  color: var(--on-blue-soft);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.footer__logo {
  height: 72px;
  width: auto;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding-block: 2.5rem;
  border-top: 1px solid rgba(201, 220, 234, 0.18);
  color: var(--on-blue-soft);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.footer__label {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.footer__links { display: grid; gap: 0.6rem; }
.contact-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--on-blue-soft);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s;
}
.contact-link__icon { flex: none; margin-top: 0.2em; }
.contact-link span { text-decoration: underline; text-decoration-color: rgba(201, 220, 234, 0.35); text-underline-offset: 0.25em; transition: text-decoration-color 0.2s; }
.contact-link:hover { color: #fff; }
.contact-link:hover span { text-decoration-color: currentColor; }

.footer__bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201, 220, 234, 0.18);
  font-size: 0.875rem;
  color: rgba(201, 220, 234, 0.75);
}
.footer__bottom a { text-decoration: none; }
.footer__bottom a:hover { color: #fff; text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .value:nth-child(3) { border-left: 0; padding-left: 0; }
  .value:nth-child(n + 3) { border-top: 1px solid var(--rule-on-blue); margin-top: 1.5rem; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--blue-deep);
    padding: 0.5rem var(--gutter) 1.5rem;
    box-shadow: 0 16px 32px -16px rgba(0, 20, 35, 0.6);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  }
  .nav.is-open {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  }
  .nav__list { flex-direction: column; gap: 0; }
  .nav a {
    display: block;
    padding: 1rem 0;
    font-family: var(--serif);
    font-size: 1.375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }
  .nav a::after { display: none; }
  .site-header:has(.nav.is-open) { background: var(--blue-deep); }

  .hero__content {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "sub" "welcome" "more";
  }
  .hero__sub { margin-bottom: 1.75rem; }

  .about__grid, .history__grid { grid-template-columns: 1fr; }
  .about__figure { max-width: 26rem; }
  .history__head { position: static; }
}

@media (max-width: 560px) {
  .site-header__inner { gap: 0.75rem; }
  .brand__logo { height: 38px; }
  .lang--bar .lang__btn[aria-pressed="true"] { display: none; }
  .lang--bar .lang__btn { padding-inline: 0.6rem; }
  .header-actions { gap: 0.5rem; }
  .header-actions .btn { padding-inline: 0.9rem; font-size: 0.875rem; }
  .lang__btn { padding-inline: 0.5rem; }

  .values { grid-template-columns: 1fr; }
  .value, .value + .value { padding-left: 0; border-left: 0; }
  .value + .value { border-top: 1px solid var(--rule-on-blue); margin-top: 0; }
  .value:nth-child(n + 3) { margin-top: 0; }
  .value { padding-bottom: 2rem; }

  .timeline__item { grid-template-columns: 1fr; gap: 0.25rem; }
  .footer__cols { grid-template-columns: 1fr; }
}

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