/* Rate Anything — styles.css
   Mobile-first, system fonts, no external dependencies.
   Palette: teal/emerald + warm neutrals. */

:root {
  --teal: #0e7c6b;
  --teal-dark: #0a5f52;
  --teal-deep: #06302a;
  --emerald: #10b981;
  --gold: #f59e0b;
  --gold-deep: #b45309;
  --bg: #faf8f3;
  --card: #ffffff;
  --ink: #292524;
  --muted: #78716c;
  --border: #e8e1d4;
  --star-empty: #cfc6b4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(41, 37, 36, 0.08), 0 4px 14px rgba(41, 37, 36, 0.06);
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.intro {
  font-size: 1.02rem;
  color: #44403c;
  margin: 1.1rem 0 0.25rem;
  max-width: 60ch;
}

.empty-note {
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  grid-column: 1 / -1;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0) 60%),
    radial-gradient(900px 420px at 8% 110%, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0) 55%),
    linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-deep) 78%);
  color: #fff;
  padding: 3.2rem 0 3.4rem;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.05fr 0.95fr; }
}
.hero .brand {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero .brand a { color: #fff; text-decoration: none; }
.hero .brand-star { color: var(--gold); margin-right: 0.15rem; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  font-weight: 700;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .tagline {
  margin: 0 0 1.6rem;
  color: #d9efe9;
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 44ch;
}
.hero-cta { margin: 0; display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.btn-hero {
  display: inline-block;
  background: var(--gold);
  color: #2a1c05;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.8rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.35);
}
.btn-hero:hover { background: #fbbf24; }
.hero-note { color: #a9cfc4; font-size: 0.88rem; }

/* fanned demo rating cards */
.hero-fan {
  position: relative;
  height: 300px;
  display: none;
}
@media (min-width: 860px) {
  .hero-fan { display: block; }
}
.mini-card {
  position: absolute;
  width: 208px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  color: var(--ink);
}
.mini-card svg { display: block; width: 100%; height: 118px; }
.mini-title { margin: 0.55rem 0.8rem 0.1rem; font-size: 0.86rem; font-weight: 700; }
.mini-stars { margin: 0 0.8rem 0.75rem; font-size: 0.8rem; color: var(--gold-deep); letter-spacing: 0.08em; }
.mini-stars span { color: var(--ink); font-weight: 700; letter-spacing: 0; margin-left: 0.25rem; }
.mc-a { left: 2%; top: 34px; transform: rotate(-8deg); }
.mc-b { left: 32%; top: 0; transform: rotate(2deg); z-index: 2; }
.mc-c { left: 62%; top: 52px; transform: rotate(9deg); }

/* ---------- Header (legacy, kept for static pages) ---------- */
.site-header {
  background: var(--teal-dark);
  color: #fff;
  padding: 1.25rem 0;
}
.site-header .brand {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.site-header .tagline {
  margin: 0.15rem 0 0;
  color: #d9efe9;
  font-size: 0.95rem;
}
.site-header a { color: #fff; text-decoration: none; }
.site-header a:hover { text-decoration: underline; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.9rem 0 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
}
.tab:hover { border-color: var(--teal); }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
}
.controls .label { color: var(--muted); font-size: 0.9rem; margin-right: 0.25rem; }
.sort-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
}
.sort-btn[aria-pressed="true"] {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
  font-weight: 600;
}
.result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem 0 2rem;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  overflow: hidden;
}
.card > *:not(.cover) { margin-left: 1.15rem; margin-right: 1.15rem; }
.cover {
  margin: 0 !important;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--teal-deep);
}
.cover svg { display: block; width: 100%; height: 100%; }
.card h2 {
  margin: 0.55rem 0 0;
  font-size: 1.12rem;
  line-height: 1.35;
}
.card .blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}
.badge {
  align-self: flex-start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal-dark);
  background: #e2f3ee;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-weight: 600;
}

/* stars */
.stars {
  display: flex;
  gap: 0.15rem;
  margin-top: auto;
  padding-top: 0.55rem;
}
.star {
  background: none;
  border: none;
  padding: 0.4rem;
  line-height: 1;
  color: var(--star-empty);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.star svg { width: 1.7rem; height: 1.7rem; display: block; }
.star.filled { color: var(--gold); }
.star:hover { transform: scale(1.12); }
.star:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.avg-line {
  margin: 0.1rem 0 0;
  font-weight: 600;
  font-size: 0.98rem;
}
.avg-line .star-glyph { color: var(--gold-deep); }
.your-rating {
  margin: 0;
  font-size: 0.9rem;
  color: var(--teal-dark);
  font-weight: 600;
}
.your-rating[hidden] { display: none; }

/* affiliate */
.affiliate { margin-top: 0.35rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.check-price {
  display: inline-block;
  border: 1.5px solid var(--teal);
  color: var(--teal-dark);
  background: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.check-price:hover { background: #eef8f5; }
.affiliate-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.affiliate-note a { color: var(--teal-dark); }

/* section-level disclosure + headings */
.section-disclosure {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.section-disclosure a { color: var(--teal-dark); }
.faq h2, .add-section h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ---------- Add form ---------- */
.add-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.4rem;
  margin: 0 0 2.5rem;
}
.add-section h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.add-section p { margin: 0 0 1rem; color: var(--muted); font-size: 0.93rem; }
.add-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.add-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.add-form input,
.add-form select {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: var(--ink);
}
.add-form input:focus,
.add-form select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--teal-dark); }
.form-msg { font-size: 0.92rem; margin: 0; }
.form-msg.ok { color: var(--teal-dark); font-weight: 600; }
.form-msg.err { color: #b3261e; font-weight: 600; }
@media (min-width: 640px) {
  .add-form { grid-template-columns: 1fr 1fr auto; align-items: end; }
}

/* ---------- Static pages ---------- */
.page-main { padding: 1.5rem 0 3rem; max-width: 720px; }
.page-main h1 { font-size: 1.7rem; margin: 0 0 0.75rem; }
.page-main h2 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.page-main p, .page-main li { color: #44403c; }
.page-main a { color: var(--teal-dark); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #f3eee3;
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}
.site-footer nav ul {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-footer a { color: var(--teal-dark); text-decoration: none; font-size: 0.93rem; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* FAQ sections */
.faq{max-width:56rem;margin:2.5rem auto;padding:0 1rem}
.faq h2{font-size:1.5rem;margin:0 0 1rem}
.faq details{border:1px solid #e2e2e2;border-radius:10px;padding:.8rem 1rem;margin:.6rem 0;background:#fff}
.faq summary{cursor:pointer;font-weight:600}
.faq p{margin:.6rem 0 0;line-height:1.6}

/* Studio Fungwa follow + newsletter */
.sf-social{margin:1.25rem 0 .5rem;text-align:center}
.sf-social-title{font-weight:700;margin:0 0 .6rem}
.sf-links{display:flex;gap:.6rem;justify-content:center;flex-wrap:wrap}
.sf-links a{display:inline-flex;align-items:center;gap:.4rem;padding:.45rem .85rem;border:1px solid currentColor;border-radius:999px;text-decoration:none;font-size:.9rem;color:inherit;opacity:.92}
.sf-links a:hover{opacity:1;text-decoration:underline}
.sf-links svg{width:18px;height:18px;flex:none}
.sf-news{margin:1rem auto 1.25rem;max-width:34rem;text-align:center}
.sf-news-title{font-weight:700;margin:0 0 .25rem}
.sf-news-sub{margin:0 0 .6rem;font-size:.92rem;opacity:.85}
.sf-news-form{display:flex;gap:.5rem;justify-content:center;flex-wrap:wrap}
.sf-news-form input[type=email]{padding:.55rem .8rem;border:1px solid #c9ccda;border-radius:8px;min-width:min(16rem,72vw);font-size:.95rem;background:#fff;color:#1a1a2e}
.sf-news-form button{padding:.55rem 1.15rem;border:none;border-radius:8px;font-weight:700;cursor:pointer;background:#f5a623;color:#1a1a2e;font-size:.95rem}
.sf-hidden{position:absolute;left:-9999px}

/* Studio Fungwa top bar */
.sf-topbar{position:sticky;top:0;z-index:1000;background:#14142b;color:#fff;font-size:.85rem;box-shadow:0 1px 6px rgba(0,0,0,.25)}
.sf-topbar-inner{max-width:72rem;margin:0 auto;padding:.38rem 1rem;display:flex;align-items:center;gap:.8rem;justify-content:center;flex-wrap:wrap}
.sf-topbar-follow{opacity:.92;white-space:nowrap}
.sf-topbar-icons{display:inline-flex;gap:.35rem}
.sf-topbar-icons a{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;color:#fff;opacity:.85;border:1px solid rgba(255,255,255,.4);border-radius:50%;text-decoration:none}
.sf-topbar-icons a:hover{opacity:1;background:rgba(255,255,255,.14)}
.sf-topbar-icons svg{width:14px;height:14px}
.sf-topbar-form{display:flex;gap:.35rem;align-items:center}
.sf-topbar-form input[type=email]{padding:.32rem .6rem;border:none;border-radius:6px;font-size:.82rem;width:11.5rem;background:#fff;color:#1a1a2e}
.sf-topbar-form button{padding:.34rem .85rem;border:none;border-radius:6px;background:#f5a623;color:#1a1a2e;font-weight:700;font-size:.82rem;cursor:pointer;white-space:nowrap}
.sf-topbar-cta{padding:.34rem .85rem;border-radius:6px;background:#f5a623;color:#1a1a2e;font-weight:700;font-size:.82rem;text-decoration:none;white-space:nowrap}
@media (max-width:640px){.sf-topbar-follow{display:none}.sf-topbar-form input[type=email]{width:9rem}}
