:root {
  --ink: #f3ead8;
  --muted: #c9bfae;
  --soft: #efe4cf;
  --night: #071310;
  --night-2: #0d1d18;
  --wood: #241c16;
  --smoke: #7a766d;
  --gold: #b99a58;
  --gold-2: #d7bb78;
  --line: rgba(239, 228, 207, 0.18);
  --surface: rgba(255, 248, 232, 0.08);
  --surface-strong: rgba(255, 248, 232, 0.13);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --max: 1180px;
  --header-height: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--night);
  font-family: Inter, Manrope, "PT Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 20;
  top: 16px;
  left: 16px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  color: #091512;
  background: var(--soft);
  clip: auto;
}

.section-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.section-pad {
  padding: clamp(72px, 9vw, 128px) 0;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 54px);
  transition: background 220ms ease, height 220ms ease, border-color 220ms ease;
}

.site-header.is-scrolled,
body.nav-open .site-header {
  height: 68px;
  background: rgba(7, 19, 16, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark,
.footer-mark {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215, 187, 120, 0.62);
}

.brand-mark::before,
.brand-mark::after,
.footer-mark::before,
.footer-mark::after {
  content: "";
  position: absolute;
  background: var(--gold-2);
}

.brand-mark::before,
.footer-mark::before {
  top: 5px;
  bottom: 5px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
}

.brand-mark::after,
.footer-mark::after {
  top: 11px;
  left: 7px;
  right: 7px;
  height: 2px;
}

.brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-text strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.site-nav a {
  color: rgba(243, 234, 216, 0.86);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--gold-2);
}

.nav-action,
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(215, 187, 120, 0.45);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nav-action {
  background: rgba(215, 187, 120, 0.12);
}

.button:hover,
.nav-action:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 187, 120, 0.76);
}

.button-primary {
  color: #10211b;
  background: var(--gold-2);
  border-color: var(--gold-2);
  font-weight: 700;
}

.button-ghost {
  color: var(--ink);
  background: rgba(7, 19, 16, 0.24);
  backdrop-filter: blur(12px);
}

.text-link {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.08);
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  --light-x: 50%;
  --light-y: 45%;
  --light-r: 205px;
  --light-opacity: 0;
  --hero-poster: url("../assets/image/church-night.png");
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  max-width: 100vw;
  background: #071310 var(--hero-poster) center / cover no-repeat;
}

.hero-media,
.hero-shade,
.hero-transition {
  position: absolute;
  inset: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video-base {
  filter: saturate(0.9) contrast(1.05) brightness(0.72);
}

.hero-video-grace {
  position: absolute;
  inset: 0;
  opacity: var(--light-opacity);
  filter: saturate(0.98) brightness(1.08);
  mask-image: radial-gradient(circle var(--light-r) at var(--light-x) var(--light-y), #000 0 42%, rgba(0, 0, 0, 0.8) 56%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle var(--light-r) at var(--light-x) var(--light-y), #000 0 42%, rgba(0, 0, 0, 0.8) 56%, transparent 78%);
  transition: opacity 300ms ease, mask-size 300ms ease;
}

.hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 19, 16, 0.88) 0%, rgba(7, 19, 16, 0.54) 44%, rgba(7, 19, 16, 0.2) 100%),
    linear-gradient(180deg, rgba(7, 19, 16, 0.54) 0%, rgba(7, 19, 16, 0.1) 46%, rgba(7, 19, 16, 0.94) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  min-width: 0;
  padding-top: var(--header-height);
}

.hero-quote {
  width: min(660px, 100%);
  margin: 0 0 34px;
  color: rgba(243, 234, 216, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.1vw, 27px);
  line-height: 1.5;
}

.hero-kicker,
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.08;
  overflow-wrap: break-word;
  hyphens: manual;
}

h1 {
  max-width: 860px;
  font-size: clamp(42px, 5.4vw, 76px);
}

.mobile-line {
  display: inline;
}

h2 {
  font-size: clamp(34px, 5vw, 64px);
}

h3 {
  font-size: 24px;
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(243, 234, 216, 0.78);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.light-toggle {
  position: absolute;
  z-index: 4;
  right: 20px;
  bottom: 26px;
  display: none;
  min-width: 76px;
  min-height: 48px;
  color: var(--night);
  border: 1px solid var(--gold-2);
  border-radius: var(--radius);
  background: var(--gold-2);
  font-weight: 800;
}

.hero-transition {
  top: auto;
  z-index: 3;
  height: 168px;
  background:
    radial-gradient(110% 82% at 64% 120%, rgba(185, 154, 88, 0.24), transparent 56%),
    linear-gradient(180deg, transparent, #071310 74%);
  clip-path: polygon(0 36%, 12% 42%, 27% 29%, 44% 46%, 62% 31%, 78% 45%, 100% 30%, 100% 100%, 0 100%);
}

.about,
.news,
.contacts {
  background:
    linear-gradient(180deg, #071310 0%, #0d1d18 100%);
}

.about-layout,
.contact-layout,
.donation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
}

.about .section-copy {
  text-align: center;
}

.about .lead {
  margin-left: auto;
  margin-right: auto;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.fact-item,
.rite-card,
.service-card,
.schedule-empty,
.donation-panel,
.contact-form,
.contact-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.fact-item {
  min-height: 138px;
  padding: 18px;
}

.fact-item span,
.donation-panel span,
.service-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.fact-item strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.fact-item small {
  display: block;
  margin-top: 6px;
  color: rgba(243, 234, 216, 0.58);
}

.about-photo {
  margin: 0;
  position: relative;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-photo figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.priest-band {
  position: relative;
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(360px, 1.1fr) minmax(320px, 0.72fr) minmax(220px, 0.55fr);
  align-items: stretch;
  overflow: hidden;
  background: radial-gradient(circle at 48% 36%, rgba(215, 187, 120, 0.18), transparent 38%), #090c0b;
}

.priest-media {
  position: relative;
  min-height: 560px;
  grid-column: 2 / 3;
}

.priest-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 12, 11, 0.8) 0%, transparent 22%, transparent 58%, rgba(9, 12, 11, 0.82) 100%),
    linear-gradient(180deg, rgba(9, 12, 11, 0.12), rgba(9, 12, 11, 0.82));
}

.priest-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.priest-copy {
  align-self: center;
  max-width: 520px;
  padding: clamp(38px, 6vw, 74px);
  grid-column: 3 / 4;
}

.priest-copy p:not(.eyebrow):not(.lead) {
  color: rgba(243, 234, 216, 0.78);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
}

.priest-side {
  align-self: center;
  padding: clamp(28px, 4vw, 62px);
  color: rgba(243, 234, 216, 0.7);
}

.priest-side-left {
  grid-column: 1 / 2;
}

.priest-side-right {
  grid-column: 4 / 5;
}

.priest-side span {
  display: block;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.06;
}

.priest-side p {
  max-width: 270px;
  margin: 18px 0 0;
}

.schedule {
  background:
    linear-gradient(180deg, #0d1d18 0%, #11110f 100%);
}

.section-head {
  max-width: 780px;
  margin-bottom: 32px;
}

.split-head {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.moscow-date {
  color: var(--muted);
  white-space: nowrap;
}

.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.42fr);
  gap: 18px;
}

.calendar-panel,
.calendar-details,
.news-card,
.schedule-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.calendar-panel {
  padding: clamp(18px, 3vw, 30px);
}

.calendar-top {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-top strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 44px);
  text-align: center;
}

.calendar-nav {
  width: 48px;
  height: 48px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.06);
  font-size: 30px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.calendar-day {
  position: relative;
  min-height: 86px;
  color: var(--ink);
  border: 1px solid rgba(239, 228, 207, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.045);
  text-align: left;
  padding: 10px;
}

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
}

.calendar-day span {
  font-weight: 800;
}

.calendar-day i {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #10211b;
  border-radius: 999px;
  background: var(--gold-2);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day.has-events {
  border-color: rgba(215, 187, 120, 0.54);
  background: rgba(215, 187, 120, 0.12);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px rgba(243, 234, 216, 0.3);
}

.calendar-day.selected,
.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: var(--gold-2);
  background: rgba(215, 187, 120, 0.2);
}

.calendar-details {
  min-height: 100%;
  padding: clamp(20px, 3vw, 30px);
}

.calendar-details-date {
  display: block;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-details h3 {
  margin-top: 12px;
}

.calendar-details p {
  color: rgba(243, 234, 216, 0.72);
}

.calendar-event-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.calendar-event {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(7, 19, 16, 0.44);
}

.calendar-event time,
.calendar-event span {
  display: block;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
}

.calendar-event strong {
  display: block;
  margin-top: 6px;
}

.schedule-empty {
  min-height: 230px;
  display: grid;
  align-content: center;
  padding: 22px;
}

.schedule-empty p {
  margin: 14px 0 6px;
  color: rgba(243, 234, 216, 0.72);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.news-card {
  overflow: hidden;
}

.news-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: stretch;
}

.news-card img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.news-card div {
  padding: clamp(20px, 3vw, 34px);
}

.news-card time {
  display: block;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.news-card h3 {
  margin-top: 12px;
}

.news-card p {
  color: rgba(243, 234, 216, 0.74);
}

.donation {
  background:
    linear-gradient(180deg, #11110f 0%, #201812 100%);
}

.donation-panel {
  padding: clamp(24px, 4vw, 38px);
}

.donation-panel strong {
  display: block;
  margin: 10px 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  white-space: nowrap;
}

.copy-status,
.form-status {
  min-height: 26px;
  margin: 14px 0 0;
  color: var(--gold-2);
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  border: 1px solid rgba(239, 228, 207, 0.24);
  border-radius: var(--radius);
  background: rgba(7, 19, 16, 0.74);
  padding: 12px 14px;
}

.contact-form textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agree {
  grid-template-columns: 20px 1fr !important;
  align-items: start;
}

.agree input {
  min-height: 20px;
  margin-top: 4px;
}

.hp-field {
  position: absolute;
  left: -100vw;
}

.contact-note {
  margin-top: 28px;
  padding: 20px;
}

.contact-note strong,
.contact-note a {
  display: block;
}

.contact-note a {
  margin-top: 8px;
  color: var(--gold-2);
  font-size: 22px;
  text-decoration: none;
}

.info-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(20px, 4vw, 30px);
}

.info-panel h2 {
  font-size: clamp(26px, 4vw, 40px);
}

.info-panel p {
  color: rgba(243, 234, 216, 0.76);
}

.site-footer {
  padding: 38px 0;
  color: var(--muted);
  background: #050d0b;
  border-top: 1px solid var(--line);
}

.footer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 28px;
  align-items: center;
}

.footer-layout > div:first-child {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
}

.footer-layout strong,
.footer-layout p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  text-decoration: none;
}

@media (max-width: 1120px) {
  .site-nav {
    gap: 12px;
    font-size: 13px;
  }

  .rites-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .menu-toggle,
  .light-toggle {
    display: inline-block;
  }

  .site-nav {
    position: fixed;
    inset: 68px 0 0;
    display: grid;
    align-content: start;
    gap: 0;
    padding: 18px 20px 34px;
    background: rgba(7, 19, 16, 0.96);
    transform: translateX(100%);
    transition: transform 240ms ease;
  }

  body.nav-open .site-nav {
    transform: translateX(0);
  }

  .site-nav a {
    min-height: 54px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
  }

  .nav-action {
    margin-top: 16px;
    justify-content: center;
    border-bottom: 1px solid rgba(215, 187, 120, 0.45) !important;
  }

  .about-layout,
  .contact-layout,
  .donation-layout,
  .priest-band {
    grid-template-columns: 1fr;
  }

  .priest-band {
    grid-template-columns: 1fr;
  }

  .priest-side,
  .priest-media,
  .priest-copy {
    grid-column: auto;
  }

  .priest-side {
    padding: 28px 20px 0;
  }

  .priest-side-right {
    padding-top: 0;
    padding-bottom: 34px;
  }

  .priest-media::after {
    background: linear-gradient(180deg, rgba(9, 12, 11, 0.2), rgba(9, 12, 11, 0.82) 100%);
  }

  .split-head {
    display: grid;
    align-items: start;
  }

  .moscow-date {
    white-space: normal;
  }

  .calendar-shell,
  .news-card.featured {
    grid-template-columns: 1fr;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .footer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 72px;
  }

  .section-inner {
    width: min(100% - 28px, var(--max));
  }

  .brand-text span {
    display: none;
  }

  .hero-content {
    padding-top: 92px;
    padding-bottom: 96px;
  }

  .hero-quote {
    margin-bottom: 24px;
  }

  h1 {
    font-size: clamp(30px, 8vw, 36px);
  }

  .hero-quote {
    font-size: 16px;
    line-height: 1.48;
    overflow-wrap: break-word;
  }

  .hero h1 .mobile-line {
    display: block;
  }

  .hero-actions,
  .inline-actions {
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .light-toggle {
    position: fixed;
    left: 14px;
    right: auto;
    bottom: 14px;
  }

  .facts-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .about-photo img {
    aspect-ratio: 1 / 1.15;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 54px;
    padding: 7px;
  }

  .calendar-day i {
    right: 4px;
    bottom: 4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .priest-copy {
    padding: 34px 20px 56px;
  }

  .donation-panel strong {
    font-size: clamp(28px, 8vw, 40px);
  }
}

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

  .hero-video {
    display: none;
  }

  .hero-video-grace {
    opacity: 0 !important;
  }
}
