/* ============================================================
   Zavii — shared styles
   Soft editorial calm. Warm canvas, muted-navy ink, AAC-tile motif.
   Honors the product's own rules: calm visuals, no flashing,
   full prefers-reduced-motion support, RTL-ready (logical props).
   ============================================================ */

:root {
  /* palette (from zavi_figma_starter_spec §1.1) */
  --canvas:   #FAF7F2;
  --surface:  #FFFFFF;
  --subtle:   #EEF2F5;
  --muted:    #F4F0E9;
  --border:   #E4DED4;
  --border-strong: #C9C1B3;
  --ink:      #2C3138;
  --ink-2:    #5B6470;
  --ink-3:    #8B8F96;
  --navy:     #2C4A6B;
  --navy-deep:#1F3A57;
  --sage:     #A8C5A8;
  --peach:    #E8B89C;
  --butter:   #F5E4B5;
  --dusk:     #B7C4D9;
  --rose:     #DFB5B5;
  --success:  #7BA47B;

  --maxw: 1080px;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow-soft: 0 1px 2px rgba(44,49,56,.04), 0 12px 32px -16px rgba(44,49,56,.18);
  --shadow-lift: 0 2px 4px rgba(44,49,56,.05), 0 24px 48px -20px rgba(44,49,56,.22);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Lexend", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 1rem + .2vw, 18px);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  /* gentle warm atmosphere — soft radial washes, never harsh */
  background-image:
    radial-gradient(60% 50% at 12% -5%, rgba(183,196,217,.30), transparent 60%),
    radial-gradient(55% 45% at 98% 8%, rgba(232,184,156,.22), transparent 62%),
    radial-gradient(50% 50% at 50% 120%, rgba(168,197,168,.20), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle paper grain for warmth (very low opacity, no motion) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

img { max-width: 100%; display: block; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 460; line-height: 1.08; letter-spacing: -.01em; color: var(--ink); margin: 0; }
h1 { font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.4rem); font-weight: 430; }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); font-weight: 500; font-optical-sizing: auto; }
p  { margin: 0 0 1rem; }
a  { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.eyebrow {
  font-family: var(--font-body); font-weight: 600;
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy); margin: 0 0 1rem;
  display: inline-flex; align-items: center; gap: .55rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--peach); border-radius: 2px; }
.lede { font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); color: var(--ink-2); line-height: 1.6; }
.serif-accent { font-family: var(--font-display); font-style: italic; font-weight: 380; color: var(--navy); }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; position: relative; z-index: 1; }
section { padding-block: clamp(3.5rem, 2rem + 8vw, 7rem); position: relative; z-index: 1; }
.stack > * + * { margin-top: 1rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(250,247,242,.72);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: .85rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px; background: var(--navy); }
.brand .mark i { border-radius: 2px; display: block; }
.brand .mark i:nth-child(1){ background: var(--dusk);} .brand .mark i:nth-child(2){ background: var(--peach);}
.brand .mark i:nth-child(3){ background: var(--sage);} .brand .mark i:nth-child(4){ background: var(--butter);}
.topbar nav { display: flex; align-items: center; gap: 1.4rem; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }
.topbar .btn { padding-block: .55rem; }
@media (max-width: 720px){ .topbar nav .hide-sm { display:none; } }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--navy); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: .9rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); cursor: pointer; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: 0 1px 2px rgba(44,49,56,.12);
}
.btn:hover { background: var(--navy-deep); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }
.btn.secondary { --bg: var(--surface); --fg: var(--navy); border-color: var(--border-strong); }
.btn.secondary:hover { --bg: #fff; box-shadow: var(--shadow-soft); }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-3px); }
.btn.block { width: 100%; }
.btn.lg { padding: 1.05rem 1.7rem; font-size: 1.05rem; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.5rem, 1.5rem + 5vw, 4.5rem); }
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.2rem; }
.hero .lede { max-width: 38ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero .trust { margin-top: 1.4rem; font-size: .9rem; color: var(--ink-3); display: flex; align-items: center; gap: .5rem; }
.hero .trust svg { flex: none; }
@media (max-width: 860px){ .hero .grid { grid-template-columns: 1fr; } .hero .art { order: -1; } }

/* ---------- the tile motif (echoes the AAC board) ---------- */
.tilewall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile {
  aspect-ratio: 1 / 1; border-radius: var(--radius); border: 1.5px solid var(--border-strong);
  background: var(--surface); padding: 14px; display: flex; flex-direction: column;
  justify-content: space-between; box-shadow: var(--shadow-soft);
}
.tile .ic { width: 38%; aspect-ratio: 1; border-radius: 9px; opacity: .9;
  background: linear-gradient(150deg, rgba(255,255,255,.4), transparent), var(--tc, var(--dusk));
  border: 1px solid rgba(0,0,0,.05); }
.tile .lbl { font-weight: 600; font-size: .95rem; color: var(--ink); }
.tile.sage{ --tc: var(--sage);} .tile.peach{ --tc: var(--peach);} .tile.butter{ --tc: var(--butter);}
.tile.dusk{ --tc: var(--dusk);} .tile.rose{ --tc: var(--rose);}
.tile.fill { background: var(--tc); }
.tile.fill .ic { background: rgba(255,255,255,.55); }

/* ---------- generic cards ---------- */
.cards { display: grid; gap: 1.1rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px){ .cols-3, .cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem; box-shadow: var(--shadow-soft);
}
.card .chip { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 1rem; background: var(--muted); }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--ink-2); margin: 0; font-size: .98rem; }
.card.accent-sage .chip{ background: color-mix(in srgb, var(--sage) 55%, white);}
.card.accent-peach .chip{ background: color-mix(in srgb, var(--peach) 55%, white);}
.card.accent-dusk .chip{ background: color-mix(in srgb, var(--dusk) 60%, white);}
.card.accent-butter .chip{ background: color-mix(in srgb, var(--butter) 60%, white);}

/* ---------- section heading block ---------- */
.head { max-width: 60ch; margin-bottom: 2.4rem; }
.head.center { margin-inline: auto; text-align: center; }
.head p { color: var(--ink-2); margin-top: .8rem; }

/* ---------- "two things" split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 760px){ .split { grid-template-columns: 1fr; } }
.panel { border-radius: var(--radius); padding: 1.8rem; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel.tinted-1 { background: linear-gradient(160deg, color-mix(in srgb, var(--dusk) 22%, var(--surface)), var(--surface)); }
.panel.tinted-2 { background: linear-gradient(160deg, color-mix(in srgb, var(--sage) 22%, var(--surface)), var(--surface)); }
.panel .tag { font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--navy); text-transform: uppercase; }
.panel ul { margin: .9rem 0 0; padding: 0; list-style: none; }
.panel li { position: relative; padding-inline-start: 1.6rem; margin-bottom: .55rem; color: var(--ink-2); }
.panel li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 9px; height: 9px; border-radius: 3px; background: var(--peach); }
.panel.tinted-2 li::before { background: var(--sage); }

/* ---------- feature list ("what's different") ---------- */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 2.2rem; }
@media (max-width: 720px){ .features { grid-template-columns: 1fr; gap: 1.2rem; } }
.feature { display: flex; gap: 1rem; align-items: flex-start; padding: .3rem 0; }
.feature .ft {
  flex: none; width: 46px; height: 46px; border-radius: 13px; margin-top: .15rem;
  border: 1.5px solid var(--border-strong); box-shadow: var(--shadow-soft);
  background:
    linear-gradient(150deg, rgba(255,255,255,.55), transparent 60%),
    var(--fc, var(--dusk));
  position: relative;
}
.feature .ft::after { /* a tiny "tile chip" inside, echoing the AAC buttons */
  content: ""; position: absolute; inset: 9px; border-radius: 6px;
  background: rgba(255,255,255,.6);
}
.feature .ft.dusk{ --fc: var(--dusk);} .feature .ft.peach{ --fc: var(--peach);}
.feature .ft.sage{ --fc: var(--sage);} .feature .ft.butter{ --fc: var(--butter);}
.feature .ft.rose{ --fc: var(--rose);}
.feature h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.12rem; margin-bottom: .25rem; }
.feature p { color: var(--ink-2); margin: 0; font-size: .98rem; line-height: 1.55; }
.features-foot { margin-top: 2.4rem; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--ink); }
.features-foot a { font-style: normal; font-family: var(--font-body); font-weight: 600; white-space: nowrap; }

/* ---------- survey chooser cards ---------- */
.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 760px){ .choose { grid-template-columns: 1fr; } }
.choose-card {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius); padding: 1.8rem; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-soft); transition: transform .18s ease, box-shadow .18s ease;
}
.choose-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.choose-card .who { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--navy); }
.choose-card .who .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.choose-card h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.25rem; }
.choose-card .time { font-size: .85rem; color: var(--ink-3); margin-top: auto; padding-top: .4rem; }
.choose-card .go { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--navy); }

/* ---------- waitlist ---------- */
.waitlist { background: var(--navy); color: #fff; border-radius: var(--radius); padding: clamp(2rem, 1rem + 4vw, 3.4rem); position: relative; overflow: hidden; }
.waitlist::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(40% 60% at 100% 0, rgba(232,184,156,.30), transparent 60%),
  radial-gradient(40% 60% at 0 100%, rgba(168,197,168,.26), transparent 60%); pointer-events: none; }
.waitlist h2, .waitlist p { color: #fff; position: relative; }
.waitlist p { color: rgba(255,255,255,.82); }
.waitlist form { display: flex; gap: .7rem; margin-top: 1.4rem; max-width: 480px; position: relative; flex-wrap: wrap; }
.waitlist input { flex: 1 1 220px; }
.field-note { font-size: .82rem; color: rgba(255,255,255,.7); margin-top: .8rem; position: relative; }
.form-msg { margin-top: .9rem; font-weight: 500; position: relative; min-height: 1.2em; }

/* ---------- forms (shared with surveys) ---------- */
input, textarea, select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: .8rem .95rem; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px color-mix(in srgb, var(--navy) 14%, transparent); }
textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
label { font-weight: 500; }

/* ---------- footer ---------- */
footer { padding-block: 2.6rem; border-top: 1px solid var(--border); margin-top: 2rem; color: var(--ink-3); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
footer a { color: var(--ink-2); }

/* ---------- reveal animation (calm; disabled for reduced-motion) ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================
   Bilingual: language toggle + RTL + Arabic typography
   ============================================================ */
.lang-toggle {
  font-family: "IBM Plex Sans Arabic", var(--font-body);
  font-weight: 600; font-size: .92rem; color: var(--navy);
  background: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: .45rem .85rem; cursor: pointer; line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}
.lang-toggle:hover { background: var(--surface); border-color: var(--border-strong); }

/* arrows mirror in RTL (the inline → glyphs in CTAs) */
[dir="rtl"] .btn .arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(3px); }

/* Arabic typography — Fraunces/Lexend have no Arabic, so swap to IBM Plex Sans Arabic.
   (Brand wordmark stays Latin/display on purpose.) */
[lang="ar"] body,
[lang="ar"] input, [lang="ar"] textarea, [lang="ar"] select, [lang="ar"] button,
[lang="ar"] .btn, [lang="ar"] .lede, [lang="ar"] .eyebrow { font-family: "IBM Plex Sans Arabic", var(--font-body); }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] .serif-accent, [lang="ar"] .features-foot {
  font-family: "IBM Plex Sans Arabic", var(--font-body);
  font-style: normal; font-weight: 600; letter-spacing: 0;
}
[lang="ar"] h1 { font-weight: 700; line-height: 1.25; }
[lang="ar"] h2 { line-height: 1.3; }
[lang="ar"] .serif-accent { color: var(--navy); }

/* letter-spacing + uppercase break Arabic shaping — turn them off */
[lang="ar"] .eyebrow, [lang="ar"] .tag, [lang="ar"] .panel .tag,
[lang="ar"] .focus-col h3, [lang="ar"] .seg-btn, [lang="ar"] .tag-pill {
  letter-spacing: normal; text-transform: none;
}
/* keep the brand mark in Latin display even when page is Arabic */
[lang="ar"] .brand { font-family: var(--font-display); }
