/*
 * holystic.ai — marketing site styles.
 *
 * Aligned with the app's visual system (source of truth:
 * mobile/lib/app/theme.dart; mirrored by packages/webapp/src/styles.css
 * and packages/extension/src/popup/popup.css). The marketing site uses
 * the inter_denominational default accent (sage / slate-green) since it
 * doesn't know the visitor's tradition.
 *
 *   - Warm off-white background (#FBF7F4) — quiet, contemplative
 *   - Near-black ink (#1A1A1A), soft secondary (#555555)
 *   - Hairline borders (#E6E2D9)
 *   - Sage accent (#5C7560) — matches the new botanical-h logo
 *   - Cormorant Garamond for display + serif headings + the brand wordmark
 *   - Inter for body + UI chrome
 *   - Generous whitespace; max-width column for readability
 */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --background: #FBF7F4;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #555555;
  --hairline: #E6E2D9;
  --accent: #5C7560;
  --accent-soft: rgba(92, 117, 96, 0.08);
  --max-prose: 640px;
  --max-section: 720px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(92, 117, 96, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--accent);
}

/* --- Layout shell --- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-section);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.prose {
  max-width: var(--max-prose);
}

main {
  flex: 1;
  padding: 32px 0 80px;
}

/* --- Header --- */

.site-header {
  padding: 28px 0 8px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* Brand wordmark in the header. Serif lowercase to match the logo's
   serif botanical h — the two read as a single lockup. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.2px;
  line-height: 1;
}

.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

/* Inline brand-mark beside the wordmark in the header. Uses the 48px
   logo export at its native size so the botanical detail stays crisp. */
.brand-mark {
  width: 40px;
  height: 40px;
  background-image: url('/assets/holystic-logo-48.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 15px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* --- Footer --- */

.site-footer {
  border-top: 0.5px solid var(--hairline);
  padding: 28px 0 48px;
  color: var(--ink-soft);
  font-size: 13px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

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

/* --- Hero --- */

.hero {
  padding: 56px 0 32px;
}

/* Home-page logo lockup. The brand image (botanical h) sits to the
   right of the tagline on wide screens, stacks above it on mobile. */
.hero-lockup {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.hero-lockup__image {
  width: 220px;
  height: auto;
  display: block;
  /* No drop-shadow: the filter follows the PNG's rectangular bounds
     and would draw a soft square around the whole image since the
     cream inside the logo matches the page background. The botanical
     mark stands on its own without lift. */
}

@media (max-width: 720px) {
  .hero-lockup {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-lockup__image {
    width: 160px;
    margin-bottom: 8px;
  }
}

.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

.hero .lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: var(--max-prose);
  margin: 0 0 28px;
}

/* --- Typography for content pages --- */

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

main h1 {
  font-size: 40px;
  letter-spacing: -0.4px;
  margin-bottom: 24px;
}

h2 {
  font-size: 26px;
  margin-top: 44px;
  margin-bottom: 12px;
}

/* Global h3: sans, smaller weight than the serif h2 so the hierarchy
   reads as a clear step down. Note: .three-up h3 intentionally uses
   the serif treatment as a card-subheading flourish — codified, not
   accidental. Don't "unify" them. */
h3 {
  font-size: 20px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  margin-top: 32px;
  margin-bottom: 8px;
  color: var(--ink);
}

p {
  margin: 0 0 16px;
  max-width: var(--max-prose);
}

ul, ol {
  margin: 0 0 16px;
  padding-left: 22px;
  max-width: var(--max-prose);
}

li {
  margin-bottom: 6px;
}

ul.tight, ol.tight {
  margin-bottom: 8px;
}

strong { font-weight: 600; }

.muted {
  color: var(--ink-soft);
  font-size: 15px;
}

/* --- Three-up section --- */

.three-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 48px 0 24px;
}

/* Deliberately serif (vs the global sans h3) — card subheadings as
   editorial flourish. See the comment above the global h3 rule. */
.three-up h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 8px;
}

.three-up p {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* --- Buttons --- */

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.button:hover {
  text-decoration: none;
  filter: brightness(0.92);
}

.button.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(92, 117, 96, 0.4);
}

.button.outline:hover {
  background: var(--accent-soft);
  color: var(--accent);
  filter: none;
}

/* --- Section dividers --- */

hr {
  border: 0;
  border-top: 0.5px solid var(--hairline);
  margin: 48px 0;
}

/* --- Inline citations / definitions --- */

dfn {
  font-style: normal;
  border-bottom: 1px dotted var(--accent);
  color: var(--accent);
  cursor: help;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 8px;
}

/* --- Coming-soon banner --- */

.banner {
  background: var(--accent-soft);
  border: 0.5px solid rgba(92, 117, 96, 0.25);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 32px 0;
  font-size: 15px;
  color: var(--ink);
  max-width: var(--max-prose);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 36px 0 20px; }
  main { padding: 16px 0 56px; }
  h2 { margin-top: 32px; }
  .site-header { padding: 20px 0 8px; }
  .brand { font-size: 24px; }
  .brand-mark { width: 36px; height: 36px; }
}

/* ===========================================================================
 * Redesign primitives (docs/web-redesign-plan.md, Phase 1). Additive — the
 * existing pages render unchanged until markup opts into these classes
 * (Phase 4). Brand tokens above are the single source of truth; nothing here
 * introduces a new color or font. Calm-first: motion is subtle and every
 * animation is disabled under prefers-reduced-motion.
 * ======================================================================== */

/* --- Sticky, quietly-backed header (global) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Translucent wash so content scrolling underneath stays legible without a
     hard bar. backdrop-filter is progressive — no blur is a fine fallback. */
  background: rgba(251, 247, 244, 0.82);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--hairline);
}

/* --- Reading-progress hairline (opt-in: needs #progress + reveal.js) --- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
}

/* --- Cards / bento --- */
.card {
  background: var(--surface);
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  padding: 28px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 40px 0;
}
.card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 8px;
}
.card p {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* --- Media: a consistent calm treatment so photos read as one set --- */
.media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0; /* kill descender gap under the img */
}
.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Slight desaturation + warmth pulls stock-ish photos toward the brand's
     quiet register. */
  filter: saturate(0.85) contrast(1.02);
}
/* Subtle sage wash. Pseudo-element keeps it off the <img> so alt/SEO is clean. */
.media--toned::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0.10;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.media figcaption,
figcaption.media-caption {
  line-height: 1.5;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* --- Alternating image + text section --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin: 64px 0;
}
.split--reverse .split__media { order: 2; }
.split__body { max-width: 520px; }
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; gap: 24px; margin: 44px 0; }
  .split--reverse .split__media { order: 0; }
}

/* --- Hero with a soft background image (Phase 4 hero) --- */
.hero--image {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  padding: 64px 40px;
}
.hero--image .hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero--image .hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8);
}
/* Legibility scrim: warm background fading from opaque (text side) to clear. */
.hero--image .hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(251, 247, 244, 0.94) 0%,
    rgba(251, 247, 244, 0.80) 45%,
    rgba(251, 247, 244, 0.35) 100%
  );
}
.hero--image > *:not(.hero__bg) { position: relative; z-index: 1; }

/* --- Per-tradition accent scopes (for the reflection animation) --- */
.t-catholic { --accent: #9C7E3A; --accent-soft: rgba(156, 126, 58, 0.10); }
.t-orthodox { --accent: #3D5A80; --accent-soft: rgba(61, 90, 128, 0.10); }
.t-protestant,
.t-evangelical { --accent: #7A2E2E; --accent-soft: rgba(122, 46, 46, 0.10); }
.t-inter { --accent: #5C7560; --accent-soft: rgba(92, 117, 96, 0.10); }

/* --- Scroll-reveal (driven by /reveal.js) ---
   Perceptible-but-calm: a longer rise + gentle ease-out so the motion reads
   clearly without feeling flashy. Tuned up from the first near-invisible pass. */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s ease,
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger helper for grids of revealed items. */
.reveal[data-delay='1'] { transition-delay: 0.1s; }
.reveal[data-delay='2'] { transition-delay: 0.2s; }
.reveal[data-delay='3'] { transition-delay: 0.3s; }

/* --- Tradition reflection demo (docs/web-redesign-plan.md, Phase 3) ---
   Data-driven: /reflection-demo.js loads web/assets/reflections/{tradition}.json
   and plays it. Display labels ("Voices", layer titles) live in that script, not
   the data, so terminology renames are one-place changes. */
.demo-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 4px; }
.demo-chips button {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.demo-chips button:hover { color: var(--accent); border-color: var(--accent); }
.demo-chips button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.demo-stage { margin-top: 28px; }
.demo-entry { margin: 0 0 28px; }
.demo-slider { margin: 0 0 16px; }
.demo-slider .ends {
  display: flex; justify-content: space-between;
  font-size: 12px; letter-spacing: 0.3px; color: var(--ink-soft); margin-bottom: 7px;
}
.demo-track { position: relative; height: 4px; background: var(--hairline); border-radius: 2px; }
.demo-thumb {
  position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: left 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-layer {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 0 18px;
}
.demo-layer.show { opacity: 1; transform: none; }
.demo-layer .label {
  text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px;
  font-weight: 600; color: var(--accent); margin-bottom: 4px;
}
.demo-layer p { margin: 0; }

.demo-voices {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 28px;
}
.demo-voices.show { opacity: 1; transform: none; }
.demo-voices > .label {
  text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px;
  font-weight: 600; color: var(--ink-soft); margin-bottom: 12px;
}
.demo-voice { border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; margin: 0 0 16px; }
.demo-voice .q { font-family: 'Cormorant Garamond', serif; font-size: 19px; line-height: 1.5; color: var(--ink); }
.demo-voice cite { display: block; font-style: normal; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.demo-voice cite a { color: var(--ink-soft); }

/* Honor reduced-motion: show everything immediately, no transitions anywhere. */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .progress { transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
