/* Faithful — Catholic formation. Sacred, not startup. */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Sans+3:wght@300;400;500;600&display=swap");

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors — aged parchment, wine, stone, charcoal. No purple, no neon. */
  --color-parchment: #f4efe6;
  --color-parchment-deep: #e8e0d4;
  --color-stone: #c4b8a8;
  --color-stone-muted: #a89b8c;
  --color-wine: #5c2a2e;
  --color-wine-deep: #3d1c1f;
  --color-charcoal: #2a2624;
  --color-ink: #1c1917;
  --color-separator: rgba(42, 38, 36, 0.12);
  --color-border: rgba(42, 38, 36, 0.28);
  --color-border-strong: rgba(92, 42, 46, 0.35);
  --color-surface: var(--color-parchment);
  --color-text: var(--color-ink);
  --color-text-muted: #5c534c;
  --color-accent: var(--color-wine);
  --color-accent-hover: var(--color-wine-deep);

  /* Typography */
  --font-heading: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-weight-heading: 500;
  --font-weight-body: 400;
  --line-height-tight: 1.15;
  --line-height-body: 1.7;
  --letter-spacing-wide: 0.04em;
  --letter-spacing-ui: 0.12em;

  /* Type scale — generous, book-like */
  --text-hero: clamp(3.25rem, 12vw + 1rem, 8.5rem);
  --text-subhero: clamp(1rem, 2vw + 0.75rem, 1.35rem);
  --text-h2: clamp(1.75rem, 3vw + 1rem, 2.5rem);
  --text-h3: clamp(1.25rem, 1.5vw + 0.9rem, 1.5rem);
  --text-body: clamp(1.0625rem, 0.5vw + 1rem, 1.1875rem);
  --text-small: clamp(0.8125rem, 0.2vw + 0.75rem, 0.875rem);
  --text-button: 0.75rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;
  --space-section: clamp(5rem, 12vw, 9rem);
  --space-gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Layout */
  --content-max: 720px;
  --separator-width: 1px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 1.1s;
  --duration-fast: 0.25s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Section fade-in
   -------------------------------------------------------------------------- */
@keyframes faithful-fade-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-fade {
  animation: faithful-fade-in var(--duration) var(--ease-out) both;
}

.section-fade:nth-of-type(1) {
  animation-delay: 0.05s;
}

.section-fade:nth-of-type(2) {
  animation-delay: 0.12s;
}

.section-fade:nth-of-type(3) {
  animation-delay: 0.19s;
}

.section-fade:nth-of-type(4) {
  animation-delay: 0.26s;
}

.section-fade:nth-of-type(5) {
  animation-delay: 0.33s;
}

.section-fade:nth-of-type(n + 6) {
  animation-delay: 0.4s;
}

/* --------------------------------------------------------------------------
   Site nav — minimal, quiet
   -------------------------------------------------------------------------- */
.site-nav {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
  padding-block: var(--space-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

.site-nav--chapel {
  justify-content: flex-start;
}

.site-nav--spread {
  justify-content: space-between;
}

.site-nav__link,
.site-nav__home {
  font-family: var(--font-heading);
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out);
}

.site-nav__links {
  display: flex;
  gap: var(--space-md);
}

.site-nav__link:hover,
.site-nav__home:hover {
  color: var(--color-charcoal);
}

/* --------------------------------------------------------------------------
   Hero — full viewport, centered
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-gutter);
  padding-block: var(--space-xl);
}

.hero__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  font-size: var(--text-hero);
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
  color: var(--color-charcoal);
  max-width: 20ch;
}

.hero__subtitle {
  margin-top: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--text-subhero);
  font-weight: 300;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-muted);
  max-width: 36ch;
  line-height: 1.5;
}

/* Hero scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 2.5rem;
  background: var(--color-stone-muted);
  opacity: 0.5;
  animation: scroll-hint 2s var(--ease-out) infinite;
}

@keyframes scroll-hint {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  40% { opacity: 0.5; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   Content sections — narrow measure, centered
   -------------------------------------------------------------------------- */
.content {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
  padding-block: var(--space-section);
}

.content + .content {
  padding-top: 0;
}

.content__heading {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-tight);
  color: var(--color-charcoal);
  margin-bottom: var(--space-md);
}

.content__heading + p,
.content__lead {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.content p + p {
  margin-top: var(--space-sm);
}

.content p {
  color: var(--color-text);
}

/* Procession — the seven sacraments */
.procession {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.procession__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-block: var(--space-sm);
  border-bottom: var(--separator-width) solid var(--color-separator);
}

.procession__item:last-child {
  border-bottom: none;
}

.procession__name {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-heading);
  color: var(--color-charcoal);
  letter-spacing: 0.01em;
}

.procession__desc {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  line-height: 1.5;
}

@media (min-width: 40rem) {
  .procession__item {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-md);
  }

  .procession__name {
    min-width: 12rem;
    flex-shrink: 0;
  }
}

/* Subtle section break */
.section-rule {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
  height: var(--separator-width);
  background: var(--color-separator);
  border: none;
  margin-block: 0;
}

.section-rule--spaced {
  margin-block: var(--space-lg);
}

/* Alternate: spacing-only separator */
.section-spacer {
  height: var(--space-2xl);
}

@media (min-width: 40rem) {
  .section-spacer {
    height: var(--space-3xl);
  }
}

/* --------------------------------------------------------------------------
   Form section
   -------------------------------------------------------------------------- */
.form-section {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
  padding-block: var(--space-section);
}

.form-section__title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-heading);
  color: var(--color-charcoal);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form__label {
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: transparent;
  border: var(--separator-width) solid var(--color-border);
  border-radius: 0;
  color: var(--color-text);
  transition: border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--color-stone-muted);
  opacity: 1;
}

.form__input:hover,
.form__textarea:hover {
  border-color: var(--color-border-strong);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-parchment-deep);
}

.form__textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: var(--line-height-body);
}

.form__actions {
  margin-top: var(--space-sm);
}

/* Signup form — inline layout on desktop */
.form--signup {
  margin-top: var(--space-lg);
}

.form__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form__field--grow {
  flex: 1;
}

.form__actions--inline {
  margin-top: 0;
}

@media (min-width: 40rem) {
  .form__row {
    flex-direction: row;
    align-items: flex-end;
    gap: var(--space-sm);
  }

  .form__actions--inline {
    padding-bottom: 1px;
  }
}

/* Form messages */
.error-message {
  color: var(--color-wine);
  font-size: var(--text-small);
  margin-top: var(--space-xs);
}

.success-message {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--color-charcoal);
  margin-top: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-button);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-ui);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-accent);
  border: var(--separator-width) solid var(--color-accent);
  border-radius: 0;
  background-color: transparent;
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--color-accent);
  color: var(--color-parchment);
  border-color: var(--color-accent);
}

.btn:focus-visible {
  outline: 2px solid var(--color-charcoal);
  outline-offset: 3px;
}

.btn:active {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
  padding-block: var(--space-xl) var(--space-2xl);
  border-top: var(--separator-width) solid var(--color-separator);
}

.footer__inner {
  text-align: center;
}

.footer__text {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  letter-spacing: var(--letter-spacing-wide);
  line-height: 1.6;
}

.footer__text + .footer__text {
  margin-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Responsive refinements (mobile-first)
   -------------------------------------------------------------------------- */
@media (min-width: 40rem) {
  :root {
    --line-height-body: 1.8;
  }

  .content__heading {
    margin-bottom: var(--space-lg);
  }
}

@media (min-width: 60rem) {
  .hero__subtitle {
    max-width: 42ch;
  }
}

/* --------------------------------------------------------------------------
   Scroll-based fade-in (IntersectionObserver)
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Disabled button state
   -------------------------------------------------------------------------- */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section-fade {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll-line {
    animation: none;
    opacity: 0.3;
  }

  .btn,
  .form__input,
  .form__textarea {
    transition: none;
  }
}
