/* ===========================================================
   CalBoard landing styles. Plain CSS, no build step.
   Logical properties only (RTL-safe). Colors from docs/BRAND.md (tangerine).
   =========================================================== */
:root {
  --font-latin: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-hebrew: "Heebo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Brand tokens (docs/BRAND.md). Tangerine is a surface color: no small white text on it. */
  --brand: #ff5b36;
  --on-brand: #1c1c1e;
  --bg: #faf8f6;
  --bg-alt: #f3efeb;
  --bg-raised: #ffffff;
  --text: #1c1c1e;
  --text-muted: #6b6b6f;
  --border: #e6e0da;
  --accent: #d63d19;          /* fills with white text, 4.6:1 */
  --accent-text: #b8320f;     /* links and accent words on white/paper, 6.0:1 */
  --accent-tint: #ffe9e2;
  --accent-tint-text: #8a2408;
  --on-accent: #ffffff;
  --key-gray: #d1d5db;
  --focus-ring: #d63d19;
  --ink: #1c1c1e;
  --on-ink: #ffffff;
  --on-ink-muted: #d9d6d3;
  --on-ink-accent: #ff8a6b;

  --chat-bg: #efe9e3;
  --bubble-in: #ffffff;
  --bubble-in-text: #1c1c1e;
  --bubble-out: #ffe0d5;
  --bubble-out-text: #8a2408;
  --phone-frame: #1c1c1e;
  --kb-bg: #d1d5db;
  --row-bg: #ffffff;
  --row-text: #6b6b6f;

  --shadow-md: 0 8px 24px rgba(28, 28, 30, 0.10);
  --shadow-lg: 0 24px 56px rgba(28, 28, 30, 0.18);
  --radius-card: 12px;
  --radius-row: 10px;
  --radius-key: 8px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --bg-alt: #1b1a19;
    --bg-raised: #222120;
    --text: #f4f2f0;
    --text-muted: #a8a5a2;
    --border: #34302d;
    /* BRAND.md dark accent is #E5431F (4.1:1 with white): fine for large text and glyphs.
       Small button labels keep #D63D19 so they stay AA. */
    --accent: #d63d19;
    --accent-strong: #e5431f;
    --accent-text: #ff8a6b;
    --accent-tint: #3a1d14;
    --accent-tint-text: #ffb39e;
    --focus-ring: #ff8a6b;
    --ink: #000000;
    --chat-bg: #1a1817;
    --bubble-in: #2a2826;
    --bubble-in-text: #f4f2f0;
    --bubble-out: #3a1d14;
    --bubble-out-text: #ffb39e;
    --phone-frame: #2c2a28;
    --kb-bg: #2e2c2a;
    --row-bg: #222120;
    --row-text: #a8a5a2;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-latin);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[lang="he"] body, html[lang="he"] button { font-family: var(--font-hebrew); }
/* RTL helpers: isolate Latin names and times inside Hebrew, mirror direction arrows */
.ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .flip { display: inline-block; transform: scaleX(-1); }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3 { letter-spacing: 0; }
p { margin: 0; }
a { color: var(--accent-text); }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 1.25rem; }
.wrap-narrow { max-width: 720px; }
.section { padding-block: var(--space-5); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-block-end: var(--space-4); }
.section-head h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.section-head p { margin-block-start: 0.75rem; color: var(--text-muted); font-size: 1.1rem; }
.eyebrow { color: var(--accent-text); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-block-end: 0.5rem; }
html[lang="he"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }

.skip-link { position: absolute; inset-inline-start: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { inset-inline-start: 0; }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-block-end: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.wordmark-icon { width: 32px; height: 32px; border-radius: 8px; display: block; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem 1rem; }
.nav-links { display: none; gap: 1.25rem; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent-text); }
@media (min-width: 720px) { .nav-links { display: flex; } }

.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--bg-raised); }
.lang-toggle a { display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; padding: 0.3rem 0.75rem; min-height: 36px; border-radius: 999px; }
.lang-toggle a:hover { color: var(--text); }
.lang-toggle a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.lang-toggle a[lang="he"] { font-family: var(--font-hebrew); }
.lang-toggle a[lang="en"] { font-family: var(--font-latin); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none; font-weight: 600; border-radius: 999px; min-height: 44px; padding: 0.6rem 1.2rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-nav { font-size: 0.9rem; padding: 0.4rem 1rem; min-height: 40px; }
.btn-nav, .lang-toggle a { white-space: nowrap; }
/* Narrow phones: the Hebrew switcher label is wider, so keep the nav on one line by showing only the icon */
@media (max-width: 400px) { .site-nav .wordmark span { display: none; } }
.badge-appstore { background: #000; color: #fff; border: 1px solid #3a3a3c; border-radius: 12px; padding-block: 0.5rem; padding-inline: 0.9rem 1.1rem; gap: 0.65rem; text-align: start; min-height: 52px; }
.badge-appstore svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.badge-appstore small { display: block; font-size: 0.7rem; font-weight: 400; line-height: 1.1; }
.badge-appstore strong { display: block; font-size: 1.15rem; line-height: 1.15; }
.badge-appstore:hover { filter: brightness(1.25); }
.store-badges { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.cta .store-badges { justify-content: center; }

/* Hero */
.hero { padding-block: var(--space-4) var(--space-5); overflow: hidden; }
.hero-grid { display: grid; gap: var(--space-4); align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero-sub { margin-block: 1.1rem 1.75rem; font-size: 1.15rem; color: var(--text-muted); max-width: 34rem; }
.hero-note { margin-block-start: 0.9rem; font-size: 0.9rem; color: var(--text-muted); }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } .hero { padding-block: var(--space-5) var(--space-6); } }

/* Phone mock (CSS-only animation, 11s loop) */
.phone-wrap { display: flex; justify-content: center; }
.phone { position: relative; width: 290px; height: 580px; background: var(--phone-frame); border-radius: 44px; padding: 10px; box-shadow: var(--shadow-lg); flex: none; direction: ltr; }
html[lang="he"] .phone, [dir="rtl"] .phone { direction: rtl; }
.phone-screen { position: relative; width: 100%; height: 100%; background: var(--chat-bg); border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; }
.chat-head { background: var(--bg-raised); padding: 1.6rem 1rem 0.55rem; font-size: 0.8rem; font-weight: 600; text-align: center; border-block-end: 1px solid var(--border); color: var(--text); }
.chat-body { flex: 1; padding: 0.8rem 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; justify-content: flex-start; }
.bubble { max-width: 82%; padding: 0.5rem 0.75rem; border-radius: 16px; font-size: 0.82rem; line-height: 1.35; opacity: 0; }
.bubble-in { align-self: flex-start; background: var(--bubble-in); color: var(--bubble-in-text); border-end-start-radius: 4px; }
.bubble-out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border-end-end-radius: 4px; }
.kb { background: var(--kb-bg); padding: 0.5rem 0.5rem 0.7rem; border-start-start-radius: 14px; border-start-end-radius: 14px; transform: translateY(100%); }
.kb-top { display: flex; align-items: center; justify-content: space-between; padding: 0.1rem 0.25rem 0.45rem; font-size: 0.7rem; font-weight: 700; color: var(--text); }
.kb-top span:last-child { background: var(--row-bg); border-radius: var(--radius-key); padding: 0.1rem 0.5rem; color: var(--row-text); font-weight: 600; }
.kb-days { display: flex; gap: 4px; margin-block-end: 0.45rem; }
.kb-days span { flex: 1; text-align: center; background: var(--row-bg); color: var(--row-text); border-radius: var(--radius-key); font-size: 0.62rem; padding: 0.25rem 0; font-weight: 600; }
.kb-days span.on { background: var(--accent); color: var(--on-accent); }
.kb-rows { display: flex; flex-direction: column; gap: 4px; }
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; background: var(--row-bg); color: var(--row-text); border: 1.5px solid transparent; border-radius: var(--radius-row); padding: 0.5rem 0.65rem; font-size: 0.72rem; font-weight: 500; }
.kb-row b { font-weight: 600; }
.kb-row .lock { width: 11px; height: 11px; fill: currentColor; opacity: 0.7; flex: none; }
.kb-row-free { background: var(--accent-tint); color: var(--accent-tint-text); border-color: var(--accent); font-weight: 600; }
.kb-row-free .check { width: 14px; height: 14px; opacity: 0; flex: none; }
.kb-insert { margin-block-start: 0.45rem; text-align: center; background: var(--row-bg); color: var(--accent-text); font-weight: 700; font-size: 0.72rem; padding: 0.45rem; border-radius: var(--radius-key); }

.phone.is-playing .bubble-in { animation: inb 11s infinite; }
.phone.is-playing .kb { animation: kbup 11s infinite; }
.phone.is-playing .kb-row-free { animation: pick 11s infinite; }
.phone.is-playing .kb-row-free .check { animation: tick 11s infinite; }
.phone.is-playing .bubble-out { animation: outb 11s infinite; }
@keyframes inb { 0%, 3% { opacity: 0; transform: translateY(8px); } 8%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
@keyframes kbup { 0%, 15% { transform: translateY(100%); } 22%, 92% { transform: none; } 97%, 100% { transform: translateY(100%); } }
@keyframes pick { 0%, 40% { background: var(--accent-tint); color: var(--accent-tint-text); } 46%, 100% { background: var(--accent); color: #fff; } }
@keyframes tick { 0%, 40% { opacity: 0; } 46%, 100% { opacity: 1; } }
@keyframes outb { 0%, 58% { opacity: 0; transform: translateY(10px); } 64%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; } }
/* Static final frame: before JS runs, and for reduced motion */
.phone:not(.is-playing) .bubble, .phone:not(.is-playing) .kb { opacity: 1; transform: none; }
.phone:not(.is-playing) .kb-row-free { background: var(--accent); color: #fff; }
.phone:not(.is-playing) .kb-row-free .check { opacity: 1; }
.phone.is-paused, .phone.is-paused * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .phone .bubble, .phone .kb, .phone .kb-row-free, .phone .check { animation: none !important; opacity: 1; transform: none; }
  .phone .kb-row-free { background: var(--accent); color: #fff; }
  html { scroll-behavior: auto; }
}

/* Shuffle */
.shuffle-grid { display: grid; gap: var(--space-3); }
@media (min-width: 800px) { .shuffle-grid { grid-template-columns: 1.3fr 1fr; } }
.shuffle-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3); }
.shuffle-card h3 { font-size: 1.15rem; margin-block-end: 1rem; }
.shuffle-card.new { background: var(--accent-tint); border-color: var(--accent); }
.shuffle-card.new h3 { color: var(--accent-tint-text); }
.shuffle-card.new p { color: var(--accent-tint-text); font-size: 1.05rem; }
.shuffle-steps { counter-reset: s; display: grid; gap: 0.75rem; }
.shuffle-steps li { counter-increment: s; display: flex; gap: 0.75rem; align-items: flex-start; color: var(--text-muted); }
.shuffle-steps li::before { content: counter(s); flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--bg-alt); color: var(--text); font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }
.shuffle-score { margin-block-start: 1.1rem; font-weight: 700; color: var(--text); }
.shuffle-card.new .shuffle-score { color: var(--accent-tint-text); }

/* Cards */
.card-grid { display: grid; gap: var(--space-2); }
@media (min-width: 640px) { .card-grid-3, .card-grid-features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .card-grid-3, .card-grid-features { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-3); }
.card h3 { font-size: 1.15rem; margin-block: 0.9rem 0.4rem; }
.card p { color: var(--text-muted); }
.icon-badge { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-tint); color: var(--accent-text); display: grid; place-items: center; }
.icon-badge svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.step-n { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--accent-text); margin-inline-start: 0.6rem; }

/* Privacy strip */
.privacy-strip { background: var(--ink); color: var(--on-ink); }
.privacy-strip .wrap { display: grid; gap: var(--space-2); align-items: center; }
.privacy-strip h2 { font-size: clamp(1.5rem, 4vw, 2rem); color: var(--on-ink); }
.privacy-strip p { color: var(--on-ink-muted); font-size: 1.05rem; }
.privacy-strip a { color: var(--on-ink-accent); font-weight: 600; }
.privacy-strip-link { margin-block-start: 0.9rem; }
@media (min-width: 800px) { .privacy-strip .wrap { grid-template-columns: 1fr 1.4fr; gap: var(--space-4); } }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 760px; }
.faq-item { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-card); }
.faq-item summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; min-height: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-text); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding: 0 1.2rem 1.1rem; color: var(--text-muted); }

/* Final CTA: tangerine marketing surface, ink text only (white on tangerine is 3.1:1) */
.cta { text-align: center; background: var(--brand); color: var(--on-brand); }
.cta :focus-visible { outline-color: var(--on-brand); }
.cta h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-block-end: 1.5rem; }

/* Legal */
.legal { padding-block-start: var(--space-4); }
.back-link { display: inline-block; margin-block-end: var(--space-2); text-decoration: none; font-weight: 600; }
.legal h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.legal-updated { color: var(--text-muted); margin-block: 0.5rem var(--space-3); }
.legal-section { margin-block-end: var(--space-3); }
.legal-section h2 { font-size: 1.2rem; margin-block-end: 0.4rem; }
.legal-section p { color: var(--text-muted); }
.legal-section p + p { margin-block-start: 0.75rem; }
.legal-section strong { color: var(--text); }
.legal-intro p { font-size: 1.05rem; margin-block-end: var(--space-3); }
.legal-summary { background: var(--accent-tint); color: var(--accent-tint-text); border-radius: var(--radius-card); padding: var(--space-3); margin-block-end: var(--space-4); }
.legal-summary h2 { font-size: 1.1rem; margin-block-end: 0.6rem; }
.legal-summary ul { list-style: disc; padding-inline-start: 1.25rem; display: grid; gap: 0.35rem; }
.legal-contact { margin-block-start: var(--space-3); font-weight: 600; }

/* Footer */
.site-footer { border-block-start: 1px solid var(--border); padding-block: var(--space-4); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { color: var(--text); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-rights { color: var(--text-muted); font-size: 0.9rem; width: 100%; }
@media (min-width: 720px) { .footer-rights { width: auto; } }
