/*
 * PraiseLoop public site
 * Mobile-first, no build step, no external assets.
 * Light and dark themes follow prefers-color-scheme.
 */

:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f1ebe1;
  --text: #1d1b18;
  --muted: #57514a;
  --border: #ddd4c7;

  --accent: #8a3a12;
  --accent-strong: #6d2c0d;
  --on-accent: #ffffff;
  --focus: #1a5fb4;

  --shadow: 0 1px 2px rgba(29, 27, 24, 0.06), 0 10px 28px rgba(29, 27, 24, 0.07);
  --radius: 14px;
  --measure: 65ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --surface: #1d1a17;
    --surface-alt: #26221e;
    --text: #f3efe8;
    --muted: #c2b9ac;
    --border: #3a342d;

    --accent: #f2b48c;
    --accent-strong: #ffd2b5;
    --on-accent: #241007;
    --focus: #8fc4ff;

    --shadow: none;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1.45rem + 2.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.85rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */

.skip-link {
  position: absolute;
  top: -4rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.65rem 1rem;
  border: 2px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

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

/* Shared shell */

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main.container {
  padding-block: 2.5rem 4rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}

.site-name {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.95rem;
}

.site-nav a {
  padding-block: 0.2rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 1.5rem 2rem;
}

.site-footer p {
  margin: 0;
}

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

/* Page rhythm */

main > section + section {
  margin-top: 3.5rem;
}

.section-lede {
  max-width: 60ch;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

main > section > p {
  max-width: 60ch;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Hero */

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  max-width: 19ch;
}

.lede {
  max-width: 46ch;
  font-size: 1.15rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 1rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
  }
}

/* Review-to-post illustration */

.flow {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flow-pair {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.flow-card {
  display: flex;
  flex: 1 1 8rem;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.flow-card--post {
  background: var(--surface-alt);
}

.flow-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-quote {
  margin: 0;
  color: var(--accent);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 0.8;
}

.flow-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.flow-lines span {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--border);
}

.flow-lines .short {
  width: 62%;
}

.flow-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--accent);
}

.flow-loop {
  width: 2.1rem;
  height: 2.1rem;
  border: 0.3rem solid var(--on-accent);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-40deg);
}

.flow-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.flow-arrow {
  align-self: center;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  transform: rotate(90deg);
}

.flow figcaption {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (min-width: 480px) {
  .flow-pair {
    flex-direction: row;
    align-items: stretch;
  }

  .flow-arrow {
    transform: none;
  }
}

/* Steps */

.steps {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.steps h3 {
  margin-bottom: 0.35rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Control list */

.control-list {
  display: grid;
  gap: 0.85rem;
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.control-list li {
  position: relative;
  padding-left: 1.9rem;
}

.control-list li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0.3rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Audience chips */

.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.audience li {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
}

/* FAQ */

.faq {
  display: grid;
  gap: 1.5rem;
  max-width: var(--measure);
  margin-top: 1.5rem;
}

.faq-item h3 {
  margin-bottom: 0.25rem;
}

.faq-item p {
  margin: 0;
}

.faq-item a {
  color: var(--accent);
}

/* Contact */

.contact {
  max-width: 48rem;
  margin-inline: auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.contact h2 {
  margin-bottom: 0.5rem;
}

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

.email-link {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Long-form pages (privacy, terms) */

.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

.prose h1 {
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose table,
.prose pre,
.prose blockquote {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--accent-strong);
}

.prose strong {
  font-weight: 700;
}

.prose hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--border);
  color: var(--muted);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 0.92em;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-alt);
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose caption {
  padding-bottom: 0.5rem;
  color: var(--muted);
  text-align: left;
}

.prose th,
.prose td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.prose th {
  background: var(--surface-alt);
  font-weight: 700;
}

.prose dt {
  font-weight: 700;
}

.prose dd {
  margin: 0 0 0.75rem;
}

/* Wider screens */

@media (min-width: 640px) {
  .container {
    padding-inline: 2rem;
  }

  main.container {
    padding-block: 3.5rem 5rem;
  }

  .contact {
    padding: 2rem;
  }
}
