/* Rain or Shine Apps — shared design system.
   Each page sets its app palette by overriding the tokens in its own :root block. */

:root {
  --brand: #B65A3D;
  --brand-dark: #83412C;
  --brand-tint: #F6E9D2;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #3c2a22;
  --muted: #7a6a5e;
  --line: #ece3da;
  --radius: 16px;
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-dark); font-weight: 900; font-size: 24px; letter-spacing: -0.5px; }
.brand-link img { width: 38px; height: 38px; border-radius: 10px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); font-weight: 800; font-size: 15px; text-decoration: none; }
.site-nav a:hover { color: var(--brand); }
@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-header .btn { margin-left: auto; }
  .site-header .wrap { gap: 12px; }
  .site-header .btn { white-space: nowrap; }
  .brand-link { font-size: 19px; white-space: nowrap; }
  .brand-link img { width: 32px; height: 32px; }
}

/* ---------- Buttons (Duolingo-style pressable) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  background: var(--brand); color: #fff; border: 0; border-bottom: 4px solid var(--brand-dark);
  font: 800 15px/1 var(--font); text-transform: uppercase; letter-spacing: 0.6px; text-decoration: none;
  cursor: pointer; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { border-bottom-width: 0; transform: translateY(4px); }
.btn-ghost { background: var(--surface); color: var(--brand); border: 2px solid var(--line); border-bottom-width: 4px; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 13px; }

/* ---------- Store badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-link { display: inline-block; border-radius: 12px; transition: transform .12s, box-shadow .12s; line-height: 0; }
.badge-link img { height: 60px; width: auto; }
.badge-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.badge-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.badge-link.is-suggested { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent); }
.badges-note { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
@media (max-width: 420px) { .badges { gap: 10px; } .badge-link img { height: 46px; } }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; font-weight: 900; letter-spacing: -1px; color: var(--brand-dark); margin-bottom: 16px; }
.hero .lead { font-size: 19px; color: var(--muted); margin-bottom: 28px; max-width: 30em; }
.hero-media { display: flex; justify-content: center; }
@media (max-width: 820px) {
  .hero { padding: 28px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .hero-copy { order: -1; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero .badges { justify-content: center; }
}

/* ---------- Phone frame ---------- */
.phone {
  width: min(280px, 70vw); aspect-ratio: 1290 / 2796; border-radius: 40px; padding: 10px;
  background: #1f1a17; box-shadow: 0 30px 60px -20px rgba(60,30,20,.45), inset 0 0 0 2px #3a322d;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; }
.hero .phone { width: min(300px, 64vw); transform: rotate(-3deg); }
@media (max-width: 820px) { .hero .phone { width: min(230px, 60vw); } }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-tint { background: var(--brand-tint); }
.section-title { text-align: center; font-size: clamp(28px, 4vw, 40px); font-weight: 900; color: var(--brand-dark); letter-spacing: -0.6px; line-height: 1.15; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); font-size: 18px; max-width: 34em; margin: 0 auto 56px; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; max-width: 860px; margin: 0 auto; align-items: center; }
.feature + .feature { margin-top: 88px; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media { display: flex; justify-content: center; }
.feature .phone { width: min(240px, 60vw); }
.feature h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 900; color: var(--brand); line-height: 1.2; margin-bottom: 12px; letter-spacing: -0.4px; }
.feature p { font-size: 18px; color: var(--muted); }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature + .feature { margin-top: 64px; }
  .feature .phone { width: min(220px, 58vw); }
}

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 20px; padding: 24px; }
.tile h3 { font-size: 19px; font-weight: 900; color: var(--brand-dark); margin-bottom: 6px; line-height: 1.25; }
.tile p { color: var(--muted); font-size: 16px; }
.tile-tag { display: inline-block; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- App page extras (no screenshots) ---------- */
.hero-icon { width: min(280px, 60vw); aspect-ratio: 1; border-radius: 22%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); transform: rotate(-4deg); }
@media (max-width: 820px) { .hero-icon { width: min(180px, 46vw); } }
.tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 16px; background: var(--brand-tint); font-size: 26px; line-height: 1; }
.tile-icon img { width: 30px; height: 30px; }
.tile.is-soon { border-style: dashed; border-bottom-width: 2px; background: transparent; }
.inline-icon { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.15em; margin: 0 1px; }
.prose { max-width: 720px; margin: 0 auto; font-size: 18px; color: var(--muted); }
.prose p + p { margin-top: 16px; }
.cta-band .store-soon { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.5); }

/* ---------- App list (hub page) ---------- */
.app-list { display: flex; flex-direction: column; gap: 20px; max-width: 900px; margin: 0 auto; }
.app-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 24px; align-items: start;
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 24px; padding: 28px;
}
.app-row .app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 16px rgba(0,0,0,.10); }
.app-row h3 { font-size: 26px; font-weight: 900; color: var(--app, var(--ink)); letter-spacing: -0.4px; line-height: 1.2; }
.app-row .app-desc { color: var(--muted); font-size: 16px; margin: 6px 0 18px; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.app-actions .badge-link img { height: 48px; }
.app-actions .btn { --brand: var(--app); --brand-dark: var(--app-dark); }
.app-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-size: 14px; font-weight: 700; }
.app-links a { color: var(--muted); text-decoration: none; }
.app-links a:hover { color: var(--app); }
.store-soon { display: inline-flex; align-items: center; height: 48px; padding: 0 16px; border-radius: 10px; border: 2px dashed var(--line); color: var(--muted); font-weight: 800; font-size: 14px; }
.app-row.is-soon { background: transparent; border-style: dashed; border-bottom-width: 2px; }
.pill { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--app) 14%, white); color: var(--app-dark, var(--app)); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
@media (max-width: 600px) {
  .app-row { grid-template-columns: 1fr; gap: 14px; padding: 22px; text-align: center; }
  .app-row .app-icon { width: 80px; height: 80px; margin: 0 auto; }
  .app-actions { flex-direction: column; }
  .app-actions .badges, .app-links { justify-content: center; }
  .app-actions .badges { gap: 8px; }
  .app-actions .badge-link img { height: 40px; }
}

/* ---------- Final CTA band ---------- */
.cta-band { background: var(--brand); color: #fff; text-align: center; padding: 80px 0; }
.cta-band h2 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 900; letter-spacing: -0.8px; line-height: 1.1; margin-bottom: 10px; }
.cta-band p { font-size: 18px; opacity: .9; margin-bottom: 28px; }
.cta-band .badges { justify-content: center; }
.cta-band .badges-note { color: rgba(255,255,255,.85); }
.cta-band .badge-link.is-suggested { box-shadow: 0 0 0 4px rgba(255,255,255,.55); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 2px solid var(--line); padding: 56px 0 32px; font-size: 15px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; margin-bottom: 40px; }
.footer-cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink); font-weight: 900; margin-bottom: 12px; }
.footer-cols a, .footer-cols button { display: block; color: var(--muted); text-decoration: none; font: 700 15px/1.4 var(--font); margin-bottom: 8px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.footer-cols a:hover, .footer-cols button:hover { color: var(--brand); }
.footer-base { color: var(--muted); font-size: 13px; text-align: center; border-top: 2px solid var(--line); padding-top: 24px; }

/* ---------- Cookie consent banner ---------- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; max-width: 560px; margin: 0 auto;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 20px;
  padding: 18px 20px; box-shadow: 0 16px 40px rgba(0,0,0,.18); font-family: var(--font);
}
.consent p { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.consent p strong { color: var(--ink); }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-actions .btn { flex: 1; min-width: 120px; }

.section-title + .tiles, .section-title + .prose { margin-top: 36px; }
.prose:has(> p:only-child) { text-align: center; }

/* ---------- Sub-pages: restyle the legacy page-title block and back links ---------- */
.header { background: var(--brand-tint); padding: 56px 20px 48px; text-align: center; border-bottom: 2px solid var(--line); }
.header h1 { color: var(--brand-dark); font-size: clamp(28px, 4.5vw, 42px); font-weight: 900; letter-spacing: -0.6px; line-height: 1.15; max-width: 720px; margin: 8px auto 0; }
.header p, .header .meta { color: var(--muted); font-size: 17px; max-width: 600px; margin: 12px auto 0; }
.header .eyebrow { color: var(--brand); font-size: 13px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.back { color: var(--muted); font-weight: 800; text-decoration: none; }
.back:hover { color: var(--brand); }
.site-nav a.active { color: var(--brand); }
.header select { background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 8px 14px; font: 700 15px var(--font); }

/* ---------- Phone menu ----------
   Under 720px the nav folds behind a menu button (button.nav-toggle, aria-controls="site-nav").
   Colours come from each page's own tokens; site.js opens and closes it. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav-toggle, .nav-extra { display: none; }
@media (max-width: 720px) {
  .site-header .wrap { position: relative; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; margin-left: auto;
    border: 2px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer;
  }
  .site-header .btn ~ .nav-toggle { margin-left: 0; }
  .nav-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 3px; border-radius: 3px; background: currentColor; transition: transform .2s, opacity .2s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0; flex-direction: column; gap: 0; padding: 6px 20px 18px;
    background: var(--bg); border-bottom: 2px solid var(--line); box-shadow: 0 18px 30px -12px rgba(0,0,0,.18);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 13px 2px; font-size: 19px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a.active { color: var(--brand); }
  .nav-extra { display: block; }
}
/* Small phones: logo, call-to-action and menu button share one row, so tighten them */
@media (max-width: 420px) {
  .site-header .wrap { gap: 8px; }
  .brand-link { min-width: 0; gap: 8px; font-size: 17px; }
  .brand-link img { flex: none; }
  .site-header .btn { padding: 0 12px; font-size: 12px; letter-spacing: .3px; }
  .nav-toggle { width: 42px; height: 42px; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}

/* ---------- Brickify: brick header bar on every Brickify page ---------- */
[data-app="brickify"] .site-header { background: #7F3F2D; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-app="brickify"] .brand-link { color: #F4E8D6; }
[data-app="brickify"] .site-nav a { color: color-mix(in srgb, #F4E8D6 85%, transparent); }
[data-app="brickify"] .site-nav a:hover,
[data-app="brickify"] .site-nav a.active { color: #fff; }
[data-app="brickify"] .site-nav a.active { text-decoration: underline 2px; text-underline-offset: 6px; }
[data-app="brickify"] .site-header .btn { background: #1C7B77; border-bottom-color: #11504d; color: #fff; }
[data-app="brickify"] .nav-toggle { color: #F4E8D6; border-color: color-mix(in srgb, #F4E8D6 40%, transparent); }
[data-app="brickify"] .nav-toggle:focus-visible { outline-color: #F4E8D6; }
[data-app="brickify"] .footer-logo { display: block; width: 84px; height: 84px; margin: 28px auto 4px; }
@media (max-width: 720px) {
  [data-app="brickify"] .site-nav {
    background: #7F3F2D; border-top: 2px solid color-mix(in srgb, #F4E8D6 18%, transparent); border-bottom: 0;
    box-shadow: 0 18px 30px -12px rgba(0,0,0,.4);
  }
  [data-app="brickify"] .site-nav a { color: #F4E8D6; border-bottom-color: color-mix(in srgb, #F4E8D6 14%, transparent); }
  [data-app="brickify"] .site-nav a.active { color: #fff; }
}
