/* Loafyn — matches HearthHue palette from the iOS app */

:root {
  --bg-page: #f5ebdc;
  --bg-card: #fffaf2;
  --oven-flame: #e07a2f;
  --yeast-gold: #c9a227;
  --crust-brown: #5c3d2e;
  --starter-green: #6b8f5e;
  --alert-red: #c44d3a;
  --nav-bg: #5c3d2e;
  --tab-bar: #e8d9c4;
  --text-primary: #2a1f18;
  --text-secondary: #6b5a4a;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 10px 32px rgba(92, 61, 46, 0.1), 0 2px 8px rgba(92, 61, 46, 0.06);
  --shadow-soft: 0 4px 18px rgba(92, 61, 46, 0.08);
  --max: 920px;
  --prose: 720px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Flour dust texture — echoes FlourDustOverlayView */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(224, 122, 47, 0.11), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(201, 162, 39, 0.1), transparent 34%),
    radial-gradient(circle at 50% 95%, rgba(107, 143, 94, 0.07), transparent 40%),
    radial-gradient(rgba(92, 61, 46, 0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 9px 9px;
}

a {
  color: var(--oven-flame);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--crust-brown); }

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top navigation (app nav bar) ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  box-shadow: 0 4px 20px rgba(42, 31, 24, 0.22);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand:hover { color: #fff; opacity: 0.92; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--oven-flame), var(--yeast-gold));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.topnav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.topnav a.is-active {
  color: #fff;
  background: rgba(224, 122, 47, 0.35);
}

/* ── Main layout ── */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ── Hero (home) ── */
.hero {
  text-align: center;
  padding: 20px 0 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(224, 122, 47, 0.14);
  color: var(--crust-brown);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--crust-brown);
  letter-spacing: -0.02em;
}

.hero .lead {
  margin: 0 auto 28px;
  max-width: 540px;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.hero-accent {
  width: 64px;
  height: 4px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--oven-flame), var(--yeast-gold));
}

/* Feature chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--tab-bar);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chip--flame svg { color: var(--oven-flame); }
.chip--gold svg { color: var(--yeast-gold); }
.chip--green svg { color: var(--starter-green); }

/* Link cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--tab-bar);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--oven-flame), var(--yeast-gold));
  opacity: 0.85;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(92, 61, 46, 0.14);
  color: inherit;
}

.link-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(224, 122, 47, 0.12);
  color: var(--oven-flame);
}

.link-card-icon--green { background: rgba(107, 143, 94, 0.14); color: var(--starter-green); }
.link-card-icon--gold { background: rgba(201, 162, 39, 0.16); color: var(--yeast-gold); }

.link-card h2 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--crust-brown);
}

.link-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.link-card-arrow {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--oven-flame);
  margin-top: 4px;
}

/* ── Page hero (inner pages) ── */
.page-hero {
  margin-bottom: 22px;
  padding: 28px 26px;
  background: var(--bg-card);
  border: 1px solid var(--tab-bar);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 122, 47, 0.12), transparent 70%);
  pointer-events: none;
}

.page-hero .pill {
  margin-bottom: 12px;
}

.page-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.15;
  color: var(--crust-brown);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
}

.page-hero .meta {
  margin-top: 14px;
  margin-bottom: 0;
}

/* ── Content card ── */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--tab-bar);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 30px 28px;
}

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

.pill {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(224, 122, 47, 0.13);
  color: var(--crust-brown);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(232, 217, 196, 0.5);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Prose / legal content */
.prose h2 {
  margin: 32px 0 12px;
  padding-top: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-top: 1px solid var(--tab-bar);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose p, .prose ul, .prose ol { margin: 0 0 14px; }

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

.prose li { margin-bottom: 7px; }

.prose li::marker { color: var(--oven-flame); }

.prose strong { color: var(--crust-brown); }

/* Highlight boxes */
.highlight-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--tab-bar);
  background: linear-gradient(135deg, rgba(255, 250, 242, 1), rgba(232, 217, 196, 0.35));
  box-shadow: var(--shadow-soft);
}

.highlight-box-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(224, 122, 47, 0.14);
  color: var(--oven-flame);
}

.highlight-box-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--crust-brown);
  font-size: 0.95rem;
}

.highlight-box-body p {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.faq-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--tab-bar);
  transition: border-color 0.15s ease;
}

.faq-card:hover {
  border-color: rgba(224, 122, 47, 0.35);
}

.faq-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--crust-brown);
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-card h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--oven-flame);
  flex-shrink: 0;
}

.faq-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

/* Info strip */
.info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.info-strip-item {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--tab-bar);
  text-align: center;
}

.info-strip-item .num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--oven-flame);
  line-height: 1.2;
}

.info-strip-item .label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--nav-bg);
  color: rgba(255, 255, 255, 0.75);
  padding: 28px 20px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.footer-links a:hover { color: #fff; }

.footer-copy {
  width: 100%;
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

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

@media (max-width: 640px) {
  .topbar-inner { height: auto; min-height: 56px; padding: 10px 16px; flex-wrap: wrap; }
  .topnav { width: 100%; justify-content: flex-start; }
  .main { padding: 24px 16px 36px; }
  .content-card { padding: 22px 18px; }
  .page-hero { padding: 22px 18px; }
  .hero { padding-top: 8px; }
}
