/* Mi Credo — shared styles for the landing page, the privacy policy and the
   error page. The two page types are namespaced with body.page-home and
   body.page-doc, because each defines its own .card. */

:root {
  --bg: #fffdfa;
  --fg: #241e17;
  --muted: #5f574d;
  --rule: #e8e1d6;
  --accent: #8a6124;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(36,30,23,.05), 0 8px 24px rgba(36,30,23,.07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110d;
    --fg: #ece7df;
    --muted: #a9a29a;
    --rule: #2e2820;
    --accent: #e0bc7f;
    --card: #1c1812;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 20px; }

/* ---------- language switcher ---------- */
.langbar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  padding: .7rem 20px;
  font-size: .88rem;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.langbar .label { color: var(--muted); margin-right: .2rem; }
.langbar a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .17rem .72rem;
}
.langbar a:hover { color: var(--fg); border-color: var(--accent); }
.langbar a[aria-current="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
/* the landing page floats it over the hero */
.page-home .langbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  background: transparent;
  border-bottom: none;
}
.page-home .langbar .label { color: rgba(255,250,241,.72); }
.page-home .langbar a {
  color: rgba(255,250,241,.85);
  border-color: rgba(255,250,241,.35);
  backdrop-filter: blur(2px);
}
.page-home .langbar a:hover { color: #fff; border-color: rgba(255,250,241,.85); }
.page-home .langbar a[aria-current="true"] {
  color: #2a2013;
  background: rgba(255,250,241,.92);
  border-color: rgba(255,250,241,.92);
}

/* ================= landing page ================= */
.page-home { position: relative; }

.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  place-items: end center;
  text-align: center;
  overflow: hidden;
  background: #0d0b08;
}
.hero img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 18%, rgba(0,0,0,0) 35%, rgba(10,8,5,.42) 100%),
    linear-gradient(to bottom, rgba(10,8,5,.12) 0%, rgba(10,8,5,.20) 45%, rgba(10,8,5,.86) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 0 20px 4.5rem; max-width: 40rem; }
.hero h1 {
  font-size: clamp(3rem, 11vw, 5.4rem);
  line-height: .98;
  margin: 0 0 .5rem;
  color: #fffaf1;
  font-weight: 700;
  letter-spacing: -.02em;
  text-shadow: 0 2px 28px rgba(0,0,0,.55);
}
.hero p {
  font-size: clamp(1.02rem, 2.6vw, 1.22rem);
  line-height: 1.5;
  margin: 0 auto 1.8rem;
  color: #f3e9d9;
  text-shadow: 0 1px 14px rgba(0,0,0,.6);
  max-width: 30rem;
}
.scroll-cue {
  display: inline-block;
  color: #f3e9d9;
  text-decoration: none;
  font-size: .88rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  opacity: .85;
  border: 1px solid rgba(255,250,241,.4);
  border-radius: 999px;
  padding: .5rem 1.25rem;
}
.scroll-cue:hover { opacity: 1; border-color: rgba(255,250,241,.8); }

.page-home section { padding: 4.5rem 0; }
.eyebrow {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
  font-weight: 600;
}
.page-home h2 {
  font-size: clamp(1.6rem, 4.2vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 .7rem;
  letter-spacing: -.01em;
}
.lede { color: var(--muted); max-width: 34rem; margin: 0 0 2.6rem; }

.cards { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
/* two across, so six cards land as a clean 2x3 */
@media (min-width: 680px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.page-home .card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.page-home .card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--rule);
}
.page-home .card .body { padding: 1.1rem 1.25rem 1.35rem; }
.page-home .card h3 { margin: 0 0 .35rem; font-size: 1.07rem; }
.page-home .card p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }

/* parchment cards, matching how these screens look in the app */
.quote-card .quote {
  aspect-ratio: 16 / 10;
  background-image: url("/img/parchment.jpg");
  background-size: 190%;
  background-position: center;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem 1.6rem;
  text-align: center;
}
.quote-text { margin: 0 0 .5rem; color: #3a2d1b; font-size: .95rem; line-height: 1.5; font-style: italic; }
.quote-ref { margin: 0; color: #6f5838; font-size: .82rem; letter-spacing: .02em; }

.langs { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.langs li {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: .25rem .85rem;
  font-size: .92rem;
  color: var(--muted);
}

.band { position: relative; margin-top: 1rem; overflow: hidden; text-align: center; background: #0d0b08; }
.band img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,8,5,.42), rgba(10,8,5,.64));
}
.band .inner { position: relative; z-index: 1; padding: 4.5rem 20px; max-width: 34rem; margin: 0 auto; color: #fffaf1; }
.band h2 { color: #fffaf1; margin-bottom: .6rem; }
.band p { color: #ece0cd; margin: 0 auto; }
.badge {
  display: inline-block;
  margin-bottom: 1.1rem;
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #f0dcb4;
  border: 1px solid rgba(240,220,180,.45);
  border-radius: 999px;
  padding: .32rem 1rem;
}

.page-home footer { padding: 2.6rem 0 3.4rem; border-top: 1px solid var(--rule); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 1rem; }
.page-home footer a { color: var(--accent); }
.fineprint { color: var(--muted); font-size: .88rem; margin: 0; }

/* ================= document pages (privacy, error) ================= */
.page-doc main { max-width: 46rem; margin: 0 auto; padding: 3rem 20px 5rem; }
.page-doc h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .3rem; }
.page-doc h2 { font-size: 1.15rem; margin: 2.4rem 0 .6rem; color: var(--accent); }
.page-doc h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.page-doc .sub { color: var(--muted); margin: 0 0 2rem; font-size: .95rem; }
.page-doc .summary {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}
.page-doc .summary p { margin: .4rem 0; }
.page-doc ul { padding-left: 1.3rem; }
.page-doc li { margin: .35rem 0; }
.page-doc table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.page-doc th, .page-doc td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.page-doc th { color: var(--muted); font-weight: 600; }
.page-doc code { background: var(--card); padding: .1rem .3rem; border-radius: 4px; font-size: .9em; }
.page-doc footer {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .9rem;
}

/* ---------- error page ---------- */
.page-doc.error main { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
/* it is a <p>, so it inherits max-width from .error p — keep the auto margins or it sits flush left */
.error .code { font-size: 4.4rem; line-height: 1; font-weight: 700; color: var(--accent); margin: 0 auto .4rem; letter-spacing: -.02em; }
.error h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
.error p { color: var(--muted); margin: 0 auto 1.8rem; max-width: 28rem; }
.error .actions { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; }

@media (max-width: 600px) {
  .hero { min-height: 72vh; }
  .page-home section { padding: 3.4rem 0; }
  .langbar { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
