/* Ritus Per Diem — ceremonial static sanctum */

:root {
  --black: #0a0a0a;
  --black-deep: #050505;
  --ink: #121212;
  --ivory: #f5f0e6;
  --ivory-dim: #c9c2b4;
  --stone: #8a8174;
  --taupe: #6b6358;
  --gold: #b89c62;
  --gold-soft: rgba(184, 156, 98, 0.45);
  --gold-line: rgba(184, 156, 98, 0.55);
  --cream: #ebe4d4;
  --max: 1120px;
  --measure: 38rem;
  --serif: "Cormorant Garamond", "Times New Roman", Times, serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--ivory);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--ivory);
  color: var(--black);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-family: var(--sans);
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 1rem;
}

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

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0));
  backdrop-filter: blur(0px);
  transition: background 0.4s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(184, 156, 98, 0.12);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-mark {
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory);
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-links a,
.nav-ig {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  text-decoration: none;
}

.nav-links a:hover,
.nav-ig:hover {
  color: var(--gold);
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(30, 28, 24, 0.55) 0%, transparent 55%),
    var(--black-deep);
}

.hero-axis {
  width: 1px;
  height: clamp(2.5rem, 8vh, 4.5rem);
  background: linear-gradient(to bottom, transparent, var(--gold-line), transparent);
  margin-bottom: 2.5rem;
}

.hero-axis-bottom {
  margin: 2.5rem 0 0;
}

.wordmark {
  margin: 0;
  font-weight: 400;
  line-height: 0.95;
}

.wm-line {
  display: block;
  font-size: clamp(3.2rem, 12vw, 7.5rem);
  letter-spacing: 0.18em;
  color: var(--ivory);
  font-weight: 400;
  padding-left: 0.18em; /* optical balance for tracking */
}

.hero-sub {
  margin: 2.25rem 0 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.7rem, 1.5vw, 0.82rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--stone);
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 2rem;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
  text-decoration: none;
}

.scroll-cue span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  animation: drip 2s var(--ease) infinite;
}

@keyframes drip {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

/* Bleed images */
.bleed-image {
  margin: 0;
  background: var(--black);
}

.bleed-image img {
  width: 100%;
  max-height: 85vh;
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
  filter: saturate(0.85) contrast(1.05);
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4.5rem, 12vw, 8rem) clamp(1.25rem, 4vw, 2.5rem);
}

.section-head {
  max-width: 40rem;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.25rem;
}

.section-head h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--ivory);
}

.lede {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--ivory-dim);
  font-size: 1.08em;
  line-height: 1.75;
}

.liturgy {
  font-style: italic;
  color: var(--cream);
  font-size: 1.12em;
  letter-spacing: 0.01em;
}

.center {
  text-align: center;
}

/* Doctrine */
.doctrine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.doctrine-copy p {
  margin: 0 0 1.35rem;
  color: var(--ivory-dim);
}

.doctrine-copy .liturgy {
  color: var(--ivory);
}

.doctrine-ornament {
  margin: 0;
}

.doctrine-ornament img {
  width: 100%;
  border: 1px solid rgba(184, 156, 98, 0.18);
}

.pull {
  margin: 4rem auto 0;
  max-width: 32rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--gold-soft);
  text-align: center;
}

.pull p {
  margin: 0;
  font-style: italic;
  color: var(--ivory);
  font-size: 1.15em;
  line-height: 1.65;
}

@media (max-width: 860px) {
  .doctrine-grid {
    grid-template-columns: 1fr;
  }
  .doctrine-ornament {
    order: -1;
    max-width: 28rem;
    margin: 0 auto 1rem;
  }
}

/* Books */
.book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: clamp(4rem, 10vw, 7rem);
  padding-top: 2rem;
  border-top: 1px solid rgba(184, 156, 98, 0.15);
}

.book:last-child {
  margin-bottom: 0;
}

.book-reverse .book-text {
  order: 2;
}

.book-reverse .book-figure {
  order: 1;
}

.verse-ref {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.85rem;
}

.book-text h3 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.book-text p {
  margin: 0 0 1.2rem;
  color: var(--ivory-dim);
  max-width: var(--measure);
}

.book-text .liturgy {
  color: var(--ivory);
}

.book-figure {
  margin: 0;
}

.book-figure img {
  width: 100%;
  border: 1px solid rgba(184, 156, 98, 0.12);
}

.book-figure figcaption {
  margin-top: 0.85rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  text-align: center;
}

@media (max-width: 860px) {
  .book,
  .book-reverse {
    grid-template-columns: 1fr;
  }
  .book-reverse .book-text,
  .book-reverse .book-figure {
    order: initial;
  }
  .book-figure {
    order: -1;
  }
}

/* Congregation */
.congregation {
  text-align: center;
  border-top: 1px solid rgba(184, 156, 98, 0.15);
  border-bottom: 1px solid rgba(184, 156, 98, 0.15);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 156, 98, 0.06), transparent 55%);
}

.congregation-form {
  max-width: 28rem;
  margin: 0 auto;
}

.field-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--gold-soft);
  background: rgba(0, 0, 0, 0.35);
}

.field-row:focus-within {
  border-color: var(--gold);
}

.congregation-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 1rem 1.15rem;
  letter-spacing: 0.02em;
}

.congregation-form input::placeholder {
  color: var(--taupe);
}

.congregation-form button {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--gold-soft);
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0 1.35rem;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.congregation-form button:hover {
  background: rgba(184, 156, 98, 0.12);
  color: var(--ivory);
}

.form-note,
.form-status {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--stone);
  margin: 1rem 0 0;
  line-height: 1.6;
}

.form-status.is-ok {
  color: var(--gold);
}

.form-status.is-err {
  color: #c4a090;
}

/* Sanctum */
.sanctum-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.btn-gold {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory);
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid var(--gold-line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn-gold:hover {
  background: rgba(184, 156, 98, 0.1);
  border-color: var(--gold);
  color: var(--ivory);
}

.creator-line {
  text-align: center;
  color: var(--ivory-dim);
  max-width: 28rem;
  margin: 0 auto 1.25rem;
  font-size: 1.02em;
}

.quiet-line {
  text-align: center;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 2rem auto 0;
}

/* Sacred note */
.sacred {
  max-width: 42rem;
}

.sacred-copy p {
  color: var(--ivory-dim);
  margin: 0 0 1.4rem;
  font-size: 0.98em;
}

.sacred-copy p:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  padding: 3rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  text-align: center;
}

.footer-rule {
  width: min(12rem, 40%);
  height: 1px;
  margin: 0 auto 2rem;
  background: linear-gradient(to right, transparent, var(--gold-line), transparent);
}

.footer-line {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  line-height: 1.8;
}

.footer-small {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--taupe);
  line-height: 1.7;
}

.footer-small span {
  color: var(--stone);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-cue span {
    animation: none;
  }
  * {
    transition: none !important;
  }
}
