/* dawah-alaridh.org — статическая заглушка, только HTML + CSS.
   Мотив: треугольный зубчатый пояс наждийской архитектуры (العارض — историческая область Неджда).
   Все анимации на CSS; при prefers-reduced-motion отключаются. */

:root {
  --palm: #1f4d3a;       /* основной зелёный */
  --palm-deep: #163828;  /* подвал, тёмные плашки */
  --sand: #f1e9d6;       /* фон страницы */
  --sand-light: #f8f3e6; /* карточки */
  --clay: #dccba6;       /* линии, рамки */
  --ochre: #a07a25;      /* малый акцент */
  --ink: #23281f;        /* текст */
  --ink-soft: #55594c;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(4rem, 9vw, 7.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.125rem;
  line-height: 1.9;
}

img { display: block; max-width: 100%; height: auto; }

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

h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--palm);
}

/* зубчик под заголовком раздела — тот же мотив, что в шапке */
h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 14px;
  margin-top: 0.6rem;
  background: url("assets/najdi-band.svg") repeat-x right center / 20px 14px;
  filter: brightness(0) saturate(100%) invert(47%) sepia(52%) saturate(560%) hue-rotate(3deg) brightness(92%);
}

a { color: var(--palm); }
a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--sand);
  color: var(--palm);
  border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.5;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--light { background: var(--sand); color: var(--palm-deep); }
.btn--light:hover { background: #fff; }

.btn--ghost { border-color: rgba(241, 233, 214, 0.6); color: var(--sand); }
.btn--ghost:hover { border-color: var(--sand); background: rgba(241, 233, 214, 0.12); }

.btn--solid { background: var(--palm); color: var(--sand); }
.btn--solid:hover { background: var(--palm-deep); }

/* ---------- Шапка с фото ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(92vh, 52rem);
  background: var(--palm-deep);
  color: var(--sand);
}

.hero__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  animation: hero-drift 24s ease-out both;
}

/* зелёная вуаль: плотная у текста (справа в RTL), прозрачнее к дальнему краю */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to left, rgba(22, 56, 40, 0.94) 0%, rgba(22, 56, 40, 0.82) 42%, rgba(22, 56, 40, 0.35) 100%),
    linear-gradient(to bottom, rgba(22, 56, 40, 0.7), transparent 28%),
    linear-gradient(to top, rgba(22, 56, 40, 0.55), transparent 45%);
}

/* зубчатый пояс по нижнему краю */
.hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 28px;
  background: url("assets/najdi-band.svg") repeat-x center bottom / 40px 28px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  animation: rise 0.9s var(--ease) both;
}

.nav__mark img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(241, 233, 214, 0.35);
}

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  position: relative;
  padding-block: 0.4rem;
  color: var(--sand);
  font-weight: 500;
  text-decoration: none;
}
.nav__links a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

.hero__body {
  margin-block: auto;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(5rem, 11vw, 8rem);
}

.hero__name {
  margin: 0;
  max-width: 15em;
  font-size: clamp(2rem, 5.6vw, 4rem);
  font-weight: 800;
  line-height: 1.45;
  text-wrap: balance;
  animation: rise 1s var(--ease) 0.15s both;
}

.hero__name-en {
  margin: 1.2rem 0 0;
  max-width: 34rem;
  text-align: right;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--clay);
  animation: rise 1s var(--ease) 0.3s both;
}

.hero__place {
  margin: 1.5rem 0 0;
  font-size: 1rem;
  opacity: 0.9;
  animation: rise 1s var(--ease) 0.42s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
  animation: rise 1s var(--ease) 0.55s both;
}

/* ---------- О нас ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
  padding-block: var(--section);
}

.about__text p {
  margin: 0 0 1.2em;
  max-width: 34em;
}
.about__text p:last-child { margin-bottom: 0; }

/* фото со смещённой глиняной рамкой */
.about__figure {
  position: relative;
  margin: 0;
  margin-inline-end: 1.25rem;
}
.about__figure::before {
  content: "";
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 3px solid var(--clay);
  border-radius: 10rem 10rem 12px 12px;
}
.about__figure img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10rem 10rem 12px 12px; /* арка */
  box-shadow: 0 24px 48px -24px rgba(22, 56, 40, 0.55);
}

/* ---------- Аят ---------- */

.ayah {
  position: relative;
  background: var(--palm);
  color: var(--sand);
  text-align: center;
  padding-block: clamp(4.5rem, 9vw, 7rem);
}

/* зубцы сверху и снизу: полоса «вырезана» песочным фоном */
.ayah::before,
.ayah::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 21px;
  background: url("assets/najdi-band.svg") repeat-x center / 30px 21px;
}
.ayah::before { top: -1px; transform: scaleY(-1); }
.ayah::after { bottom: -1px; }

.ayah blockquote { margin: 0; }
.ayah blockquote p {
  margin: 0;
  font-family: "Amiri", "Traditional Arabic", serif;
  font-size: clamp(1.7rem, 4.6vw, 3.1rem);
  font-weight: 700;
  line-height: 2;
  text-wrap: balance;
}
.ayah blockquote footer {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--clay);
}

/* ---------- Направления ---------- */

.fields { padding-block: var(--section); }

.fields__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--sand-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--clay);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px -22px rgba(22, 56, 40, 0.5);
}

.card__photo { overflow: hidden; }
.card__photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.card:hover .card__photo img { transform: scale(1.06); }

.card h3 {
  margin: 1.4rem 1.5rem 0.4rem;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--palm);
}
.card p {
  margin: 0 1.5rem 1.6rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.8;
}

/* ---------- Контакты ---------- */

.contact {
  background: var(--sand-light);
  border-top: 1px solid var(--clay);
  padding-block: var(--section);
}

.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact__lead p { margin: 0 0 1.75rem; max-width: 26em; }

.contact__list {
  margin: 0;
  border-inline-start: 3px solid var(--clay);
  padding-inline-start: clamp(1.25rem, 3vw, 2rem);
}
.contact__list > div + div { margin-top: 1.4rem; }
.contact__list dt {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.6;
}
.contact__list dd {
  margin: 0;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.contact__list a {
  display: inline-block;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.25s;
}
.contact__list a:hover { text-decoration-color: var(--palm); }

/* ---------- Подвал ---------- */

.footer {
  background: var(--palm-deep);
  color: var(--clay);
  padding-block: 1.75rem;
  font-size: 0.95rem;
  line-height: 1.7;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
}
.footer p { margin: 0; }

/* ---------- Анимации ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@keyframes hero-drift {
  from { transform: scale(1.12); }
  to   { transform: scale(1); }
}

/* появление блоков при прокрутке — чистый CSS; где не поддерживается, блоки просто видны */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  .fields__grid .card:nth-child(2) { animation-range: entry 10% entry 70%; }
  .fields__grid .card:nth-child(3) { animation-range: entry 20% entry 85%; }
}

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

/* ---------- Планшет и телефон ---------- */

@media (max-width: 56rem) {
  .fields__grid { grid-template-columns: 1fr 1fr; }
  .fields__grid .card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 46rem) {
  body { font-size: 1.0625rem; }

  .hero { min-height: 0; }
  .hero::before {
    background: linear-gradient(to top, rgba(22, 56, 40, 0.95) 10%, rgba(22, 56, 40, 0.8) 60%, rgba(22, 56, 40, 0.7) 100%);
  }
  .hero::after { height: 21px; background-size: 30px 21px; }

  .nav__mark img { width: 38px; height: 38px; }
  .nav__links { gap: 1rem; font-size: 0.98rem; }

  .btn { padding: 0.7rem 1.4rem; font-size: 1rem; }

  .about { grid-template-columns: 1fr; }
  .about__figure { max-width: 22rem; margin-inline: auto; padding-inline-end: 1.25rem; }
  .about__figure::before { inset: 1.25rem 0 -1.25rem 1.25rem; }

  .fields__grid { grid-template-columns: 1fr; }
  .fields__grid .card:last-child { grid-column: auto; }

  .contact__inner { grid-template-columns: 1fr; }
  .contact__list {
    border-inline-start: 0;
    padding-inline-start: 0;
    border-top: 3px solid var(--clay);
    padding-top: 2rem;
  }
}
