/* Social Bird — website design system. Mirrors the app (lib/core/design):
   ivory background, forest green, restrained ochre/brass accent, charcoal text,
   Fraunces editorial serif for headlines, system sans for body. */

/* ---- Fonts (self-hosted, same family as the app; SIL OFL) ---- */
@font-face {
  font-family: 'Fraunces';
  src: url('/static/fonts/Fraunces.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/static/fonts/Fraunces-Italic.ttf') format('truetype');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ivory: #F7F6F0;
  --surface: #FFFFFF;
  --surface-subtle: #F0EEE5;
  --forest: #1F4D3A;
  --forest-container: #E7EFE9;
  --leaf: #5F8D62;
  --sky: #4C87A8;
  --ochre: #D5A447;
  --ochre-container: #F7EDD6;
  --charcoal: #202522;
  --text: #202522;
  --text-secondary: #5B635C;
  --text-muted: #8B928A;
  --border: #E5E2D6;
  --border-strong: #D4D0C2;
  --error: #C24A32;
  --shadow: 0 1px 2px rgba(32,37,34,.06), 0 8px 24px rgba(32,37,34,.06);
  --shadow-sm: 0 1px 3px rgba(32,37,34,.08);
  --radius: 16px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Grid/flex children may shrink below their content's intrinsic width so long
   lines wrap instead of forcing horizontal overflow on narrow screens. */
.grid > *, .hero-grid > *, .footer-grid > *, .shots > *, .btn-row > * { min-width: 0; }
h1, h2, h3, p, li { overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #163a2c; }

/* ---- Typography ---- */
h1, h2, h3 { font-family: var(--serif); color: var(--charcoal); line-height: 1.12; letter-spacing: -0.01em; font-weight: 520; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 0 0 .5em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; font-weight: 600; }
h4 { font-family: var(--sans); font-size: 1.02rem; font-weight: 700; margin: 1.4em 0 .4em; color: var(--charcoal); }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--text-secondary); line-height: 1.5; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--forest); margin: 0 0 .6em; }
.muted { color: var(--text-secondary); }
small, .small { font-size: .85rem; color: var(--text-muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-subtle { background: var(--surface-subtle); }
.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Skip link / a11y ---- */
.skip { position: absolute; left: -9999px; top: 0; background: var(--forest); color: var(--ivory); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 4px; }

/* ---- Header / nav ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247,246,240,.9); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--charcoal); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--forest); background: var(--forest-container); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--charcoal); }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: 100%; right: 12px; left: 12px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1rem; padding: 13px 22px; border-radius: 999px; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .05s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: var(--ivory); }
.btn-primary:hover { background: #163a2c; color: var(--ivory); }
.btn-ghost { background: transparent; color: var(--forest); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--forest-container); color: var(--forest); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- Hero ---- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 48px; } }
.hero-art { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 5; background: var(--forest-container); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.availability { display: inline-flex; align-items: center; gap: 8px; background: var(--ochre-container); color: #7a5a14; font-weight: 600; font-size: .85rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.availability .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ochre); }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card h3 { margin-top: 0; }
.feature { display: flex; flex-direction: column; gap: 8px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--forest-container); color: var(--forest); display: grid; place-items: center; font-size: 22px; margin-bottom: 4px; }

/* ---- App screenshot frames ---- */
.shots { display: grid; gap: 22px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .shots { grid-template-columns: repeat(4, 1fr); } }
.shot figure { margin: 0; text-align: center; }
.phone { border-radius: 26px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.phone img { width: 100%; height: auto; }
.shot figcaption { margin-top: 10px; font-size: .9rem; color: var(--text-secondary); font-weight: 500; }

/* ---- Pricing ---- */
.price { font-family: var(--serif); font-size: 3rem; color: var(--charcoal); line-height: 1; }
.price .per { font-family: var(--sans); font-size: 1rem; color: var(--text-secondary); font-weight: 500; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 8px 0 8px 32px; border-bottom: 1px solid var(--border); }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 8px; color: var(--forest); font-weight: 700; }
.checklist li:last-child { border-bottom: none; }

/* ---- Legal / prose pages ---- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .35em 0; }
.prose a { font-weight: 500; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 2rem; }
.toc ul { columns: 2; column-gap: 28px; list-style: none; padding: 0; margin: 0; }
.toc li { margin: 6px 0; break-inside: avoid; }
@media (max-width: 600px) { .toc ul { columns: 1; } }
.note { background: var(--ochre-container); border-left: 4px solid var(--ochre); border-radius: 8px; padding: 14px 18px; margin: 1.2rem 0; color: #5f4a16; }
.note strong { color: #5f4a16; }
.updated { font-size: .9rem; color: var(--text-muted); }

/* ---- FAQ ---- */
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 20px; margin-bottom: 12px; }
details.faq > summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; color: var(--charcoal); }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; float: right; color: var(--text-muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details.faq[open] > summary::after { content: "−"; }
details.faq > summary + * { padding-bottom: 8px; }

/* ---- Contact form ---- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--border-strong);
  border-radius: 12px; background: var(--surface); color: var(--text);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--forest); outline: none; }
.form-status { margin-top: 12px; font-weight: 600; }
.form-status.ok { color: var(--forest); }
.form-status.err { color: var(--error); }

/* ---- Footer ---- */
.site-footer { background: var(--forest); color: #dfe8e0; padding: 48px 0 32px; margin-top: 2rem; }
.site-footer a { color: #dfe8e0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; color: #fff; margin-bottom: 10px; }
.footer-brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer-col h5 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #a9c2b1; margin: 0 0 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 8px 0; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); font-size: .85rem; color: #a9c2b1; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---- 404 ---- */
.center-screen { min-height: 60vh; display: grid; place-items: center; text-align: center; }

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