/* =========================================================
   memereply landing — palette from mobile/content/palette.json
   ========================================================= */
:root {
  --bone: #F7F7F2;
  --cream: #E4E6C3;
  --sage: #899878;
  --charcoal: #222725;
  --ink: #121113;
  --forest: #1F3D2D;   /* header wordmark green */
  --moss: #647C5E;     /* app icon tile green */

  --bg: var(--bone);
  --bg-alt: #EFEFE7;
  --surface: #FFFFFF;
  --surface-2: var(--bone);
  --text: var(--ink);
  --text-muted: #121113B3;
  --heading: var(--forest);
  --accent: var(--sage);
  --accent-strong: var(--forest);
  --on-accent: var(--bone);
  --border: #1211131A;
  --shadow: 0 1px 2px #12111314, 0 12px 32px -12px #1F3D2D33;
  --leaf: var(--forest);

  --radius: 20px;
  --radius-sm: 12px;
  --max: 1160px;
  --gutter: 16px;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0C;
    --bg-alt: #121413;
    --surface: #1A1C1B;
    --surface-2: #242725;
    --text: var(--bone);
    --text-muted: #F7F7F2B3;
    --heading: var(--cream);
    --accent-strong: var(--sage);
    --on-accent: var(--ink);
    --border: #FFFFFF14;
    --shadow: 0 1px 2px #00000066, 0 16px 40px -16px #000000AA;
    --leaf: #2C4A38;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0B0C;
  --bg-alt: #121413;
  --surface: #1A1C1B;
  --surface-2: #242725;
  --text: var(--bone);
  --text-muted: #F7F7F2B3;
  --heading: var(--cream);
  --accent-strong: var(--sage);
  --on-accent: var(--ink);
  --border: #FFFFFF14;
  --shadow: 0 1px 2px #00000066, 0 16px 40px -16px #000000AA;
  --leaf: #2C4A38;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--heading); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
em { font-style: normal; font-weight: 700; color: var(--accent-strong); }
svg { width: 1em; height: 1em; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }
.narrow { max-width: 820px; }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--forest); color: var(--bone); padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-muted); }
.small { font-size: .92rem; color: var(--text-muted); }


/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .15s, background-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--forest); color: var(--bone); }
:root[data-theme="dark"] .btn-primary { background: var(--sage); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--sage); color: var(--ink); } }
.btn-primary:hover { box-shadow: 0 8px 20px -8px #1F3D2D99; transform: translateY(-1px); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .95rem;
  transition: background-color .2s, color .2s, transform .15s;
}
.chip:hover { background: var(--cream); color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip.is-active { background: var(--forest); color: var(--bone); border-color: transparent; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -18px #00000066; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.3rem; color: var(--heading); letter-spacing: -0.02em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 600; color: var(--text-muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.is-current { color: var(--heading); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cta-mobile { display: none; }
.menu-btn { display: none; }
.menu-btn path { transition: transform .25s, opacity .2s; transform-origin: center; }
.menu-btn[aria-expanded="true"] .m-top { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .m-mid { opacity: 0; }
.menu-btn[aria-expanded="true"] .m-bot { transform: translateY(-5px) rotate(-45deg); }

#theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] #theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) #theme-toggle .i-moon { display: block; }
}

@media (max-width: 880px) {
  .menu-btn { display: inline-grid; }
  .nav-cta { display: none; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 24px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px -24px #00000066;
    transform: translateY(-12px); opacity: 0; pointer-events: none; visibility: hidden;
    transition: transform .25s, opacity .25s, visibility .25s;
  }
  .nav-links.is-open { transform: none; opacity: 1; pointer-events: auto; visibility: visible; }
  .nav-links li a { display: block; padding: 14px 4px; font-size: 1.15rem; border-bottom: 1px solid var(--border); }
  .nav-cta-mobile { display: block; margin-top: 16px; }
  .nav-links .nav-cta-mobile a { display: flex; border: 0; color: var(--bone); padding: 14px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(40px, 8vw, 96px) 0 clamp(200px, 30vw, 300px);
  min-height: min(88vh, 860px);
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.hero-icon img {
  width: 100%; max-width: 420px; border-radius: 22%;
  box-shadow: 0 30px 60px -30px #1F3D2D99;
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1deg); } }
.wordmark {
  font-size: clamp(3.2rem, 10vw, 7.5rem); font-weight: 800;
  letter-spacing: -0.045em; line-height: .95; margin: 0 0 .1em;
}
.tagline { font-size: clamp(1.4rem, 3.4vw, 2.4rem); font-weight: 700; color: var(--heading); margin-bottom: .8em; letter-spacing: -0.02em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-muted); max-width: 34em; }
.hero-note { margin-top: 14px; font-size: .9rem; color: var(--text-muted); font-weight: 600; }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; scroll-margin-top: 100px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bone); text-decoration: none;
  font-weight: 700; font-size: 1.1rem; line-height: 1.1;
  border: 1px solid #FFFFFF1F;
  transition: transform .15s, box-shadow .2s;
}
.store-btn svg { width: 26px; height: 26px; }
.store-btn small { display: block; font-size: .7rem; font-weight: 500; opacity: .8; }
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px #12111399; }
.store-btn.is-suggested { outline: 3px solid var(--sage); outline-offset: 3px; }

.hero-phone {
  position: absolute; z-index: 1; right: -4%; bottom: -6%;
  width: clamp(320px, 46vw, 680px);
  transform: translateY(var(--parallax, 0px));
  pointer-events: none;
}

/* blurred leaves like the header art */
.leaves { position: absolute; left: -80px; bottom: -40px; width: 520px; height: 520px; z-index: 0; pointer-events: none; }
.leaves span {
  position: absolute; display: block; width: 240px; height: 110px;
  background: var(--leaf); border-radius: 100% 0;
  filter: blur(14px); opacity: .85;
}
.leaves span:nth-child(1) { left: -40px; top: 40px; transform: rotate(-70deg); }
.leaves span:nth-child(2) { left: 40px; top: 250px; transform: rotate(-20deg); width: 280px; }
.leaves span:nth-child(3) { left: 220px; top: 360px; transform: rotate(-5deg); width: 260px; filter: blur(18px); }
.leaves span:nth-child(4) { left: -60px; top: 360px; transform: rotate(-40deg); }

@media (max-width: 820px) {
  .hero { padding-bottom: 240px; min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-icon { display: flex; justify-content: center; }
  .hero-icon img { max-width: 180px; }
  .lede { margin-left: auto; margin-right: auto; }
  .store-row { justify-content: center; }
  .hero-phone { right: -18%; bottom: -4%; width: 420px; }
  .leaves { transform: scale(.65); transform-origin: bottom left; }
}
@media (max-width: 420px) {
  .store-btn { flex: 1 1 100%; justify-content: center; }
  .hero-phone { width: 340px; right: -30%; }
}

/* ---------- marquee strip ---------- */
.strip { background: var(--forest); color: var(--cream); padding: 18px 0; overflow: hidden; position: relative; z-index: 3; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 48px; animation: marquee 28s linear infinite; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.marquee-track span::after { content: "✦"; margin-left: 48px; color: var(--sage); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; scroll-margin-top: 60px; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { margin-bottom: 0; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow);
}
.step p { color: var(--text-muted); margin: 0; }
.step-num { position: absolute; top: 20px; right: 24px; font-size: 3.4rem; font-weight: 900; line-height: 1; color: color-mix(in srgb, var(--sage) 30%, transparent); }
.step-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--moss); color: var(--bone); margin-bottom: 20px;
}
.step-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- lingo ---------- */
.lingo-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.lingo-copy p { color: var(--text-muted); font-size: 1.1rem; }
.lingo-copy .small { font-size: .95rem; }
.lingo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.lingo-try label, .lingo-add-title { display: block; font-weight: 700; margin: 0 0 8px; color: var(--heading); }
.input-row { display: flex; gap: 8px; }
.input-row.two { flex-wrap: wrap; }
.input-row.two input { flex: 1 1 160px; }
input[type="text"], input[type="email"], select {
  width: 100%; min-width: 0; height: 48px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input[type="text"]:focus, input[type="email"]:focus, select:focus { border-color: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent); }
input[aria-invalid="true"] { border-color: #9E4F3B; }
.lingo-out { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 0 4px; }
.lingo-out .arrow { font-weight: 800; color: var(--heading); margin-right: 4px; }
.tag { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--cream); color: var(--forest); font-weight: 700; font-size: .9rem; animation: pop .25s ease-out; }
.lingo-add { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 20px; }
.form-msg { font-size: .9rem; min-height: 1.4em; margin: 8px 0 0; color: var(--text-muted); }
.form-msg.ok { color: var(--accent-strong); font-weight: 600; }
.form-msg.err { color: #9E4F3B; font-weight: 600; }
.lingo-pack { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.lingo-pack-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lingo-pack-head p { margin: 0; font-weight: 700; color: var(--heading); }
.lingo-pack-head span { color: var(--text-muted); font-weight: 500; }
.lingo-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow: hidden; transition: max-height .4s ease; }
.lingo-chips.is-open { max-height: 2000px; }
.lingo-chips .chip { font-size: .85rem; padding: 4px 12px; }
.lingo-chips .chip.mine { background: var(--sage); color: var(--ink); border-color: transparent; }
.lingo-chips .chip .x { margin-left: 6px; opacity: .7; }
@media (max-width: 860px) { .lingo-grid { grid-template-columns: 1fr; } }

/* ---------- privacy ---------- */
.privacy { background: var(--forest); color: var(--cream); }
.privacy h2 { color: var(--bone); }
.privacy-copy p { color: #E4E6C3CC; font-size: 1.1rem; }
.privacy-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.privacy-list li {
  display: grid; gap: 4px; padding: 20px 22px 20px 58px; position: relative;
  border-radius: var(--radius-sm); background: #FFFFFF0D; border: 1px solid #FFFFFF14;
}
.privacy-list li::before {
  content: ""; position: absolute; left: 20px; top: 22px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121113' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.privacy-list strong { color: var(--bone); font-size: 1.05rem; }
.privacy-list span { color: #E4E6C3BF; font-size: .95rem; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ---------- faq ---------- */
.faq-list { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 22px; position: relative;
  font-weight: 700; font-size: 1.08rem; color: var(--heading);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg); transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-body { padding: 0 22px; overflow: hidden; }
.faq-body p { color: var(--text-muted); margin: 0 0 20px; }

/* ---------- cta ---------- */
.cta { padding-top: 0; }
.cta-card {
  text-align: center; padding: clamp(40px, 7vw, 80px) var(--gutter);
  background: var(--cream); color: var(--ink); border-radius: 32px; position: relative; overflow: hidden;
}
.cta-card h2 { color: var(--forest); }
.cta-card > p { color: #121113B3; font-size: 1.1rem; }
.cta .store-row { justify-content: center; margin-top: 8px; }
.cta-icon { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 20px; box-shadow: 0 16px 32px -16px #1F3D2D99; }
/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { text-decoration: none; color: var(--text-muted); font-weight: 600; }
.footer-links a:hover { color: var(--heading); }
.footer-legal { margin: 0; font-size: .9rem; color: var(--text-muted); width: 100%; }
.brand img[width="32"] { width: 32px; height: 32px; }

/* ---------- to-top + toast ---------- */
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--forest); color: var(--bone); display: grid; place-items: center;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bone); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; box-shadow: 0 12px 30px -10px #0009;
  transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
}

@keyframes pop { from { transform: scale(.85); opacity: 0; } }
