@font-face { font-family: "Satoshi"; src: url("/fonts/satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/satoshi-700.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/satoshi-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

/* alzo — design system
   Identity: Sidi Bou Saïd blue on warm paper, ink black text, flag red only for streaks and mistakes. */
:root {
  --bg: #f6f2ec;
  --surface: #ffffff;
  --surface-2: #efe9e0;
  --surface-3: #e6ded2;
  --ink: #17140f;
  --ink-2: #3b352d;
  --muted: #7a7166;
  --line: rgba(23, 20, 15, .09);
  --line-2: rgba(23, 20, 15, .16);
  --blue: #1d5fae;
  --blue-ink: #144a8a;
  --blue-soft: #e2ebf7;
  --red: #e0352b;
  --red-soft: #fbe5e2;
  --green: #18885b;
  --green-soft: #def2e8;
  --sun: #f2b632;
  --sun-soft: #fdf1d6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 12px 32px -20px rgba(23, 20, 15, .28);
  --shadow-lg: 0 30px 70px -30px rgba(23, 20, 15, .45);
  --sans: "Satoshi", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Alexandria", "Satoshi", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f0e0c; --surface: #191714; --surface-2: #221f1b; --surface-3: #2c2823;
  --ink: #f4efe8; --ink-2: #d9d2c8; --muted: #9b9287;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --blue: #5b9bf0; --blue-ink: #8ab8f5; --blue-soft: #16273d;
  --red-soft: #3a1714; --green-soft: #12291f; --sun-soft: #33280f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.9);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e0c; --surface: #191714; --surface-2: #221f1b; --surface-3: #2c2823;
    --ink: #f4efe8; --ink-2: #d9d2c8; --muted: #9b9287;
    --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
    --blue: #5b9bf0; --blue-ink: #8ab8f5; --blue-soft: #16273d;
    --red-soft: #3a1714; --green-soft: #12291f; --sun-soft: #33280f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.9);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 16px/1.55 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.025em; line-height: 1.12; font-weight: 800; }
p { margin: 0; }
[dir="rtl"], .ar { font-family: var(--arabic); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 600px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- logo: a speech bubble ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; text-decoration: none; letter-spacing: -.04em; }
.logo i {
  position: relative; width: 28px; height: 24px;
  border-radius: 9px 9px 9px 3px;
  background: var(--blue);
}
.logo i::before, .logo i::after {
  content: ""; position: absolute; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: #fff;
}
.logo i::before { left: 8px; }
.logo i::after { left: 16px; }

/* ---------- public top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.bar nav { display: flex; align-items: center; gap: 6px; }
.bar nav a:not(.btn) { text-decoration: none; font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); }
.bar nav a:not(.btn):hover { background: var(--surface-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px;
  border: 0; border-radius: 14px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--blue) 90%, transparent); }
.btn-primary:hover { background: var(--blue-ink); }
:root[data-theme="dark"] .btn-primary:hover { background: #4a8be0; }
.btn-dark { color: var(--bg); background: var(--ink); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--surface-3); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 58px; padding: 0 28px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.panel { background: var(--surface-2); border-radius: var(--radius); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2);
}
.pill-blue { background: var(--blue-soft); color: var(--blue-ink); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-green { background: var(--green-soft); color: var(--green); }

.eyebrow { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .01em; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 700; }
.input {
  width: 100%; min-height: 52px; padding: 0 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font: 500 16px var(--sans);
}
.input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.error { color: var(--red); font-size: 14px; font-weight: 600; }
.notice {
  padding: 13px 15px; border-radius: var(--radius-sm); font-size: 14.5px;
  background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 45%, transparent);
}

/* ---------- choices (quiz, setup) ---------- */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 15px 16px;
  text-align: start;
  border-radius: 16px; border: 1.5px solid var(--line-2);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.choice:hover { border-color: var(--ink-2); }
.choice:active { transform: scale(.99); }
.choice.on { border-color: var(--blue); background: var(--blue-soft); }
.choice b { display: block; font-size: 16px; }
.choice small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.choice .dot { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.choice.on .dot { border: 7px solid var(--blue); }
.choice .emo { flex: 0 0 auto; font-size: 22px; width: 30px; text-align: center; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); }
.segmented button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 11px;
  background: transparent; font-weight: 700; font-size: 14.5px; color: var(--muted); cursor: pointer;
}
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer;
}
.chip.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--blue); transition: width .4s ease; }

.spin {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- speech bubbles ---------- */
.bubble { padding: 11px 15px; border-radius: 18px; font-size: 15px; max-width: 86%; unicode-bidi: plaintext; text-align: start; }
.bubble.coach { background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--blue); color: #fff; border-end-end-radius: 6px; align-self: flex-end; }
.bubble.coach[dir="rtl"] { border-end-start-radius: 18px; border-end-end-radius: 6px; }

/* ---------- app shell: sidebar on desktop, tab bar on phones ---------- */
.shell { min-height: 100dvh; }
.side { display: none; }
.app-main { padding: 22px 0 110px; }
.app-top { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0; border-radius: 12px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none;
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--blue); }
.tab.talk .ico { display: grid; place-items: center; width: 44px; height: 32px; border-radius: 12px; background: var(--blue); color: #fff; margin-bottom: 1px; }
.tab.talk .ico svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 6px;
    position: sticky; top: 0; height: 100dvh;
    padding: 22px 16px;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
  }
  .side .logo { padding: 4px 10px 22px; }
  .side a.nav {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 12px;
    font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink-2);
  }
  .side a.nav svg { width: 21px; height: 21px; color: var(--muted); }
  .side a.nav:hover { background: var(--surface-2); }
  .side a.nav.on { background: var(--blue-soft); color: var(--blue-ink); }
  .side a.nav.on svg { color: var(--blue); }
  .side .side-cta { margin-top: 14px; }
  .side .side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .tabs, .app-top { display: none; }
  .app-main { padding: 40px 0 60px; }
  .app-main .wrap { padding-inline: 40px; max-width: 1060px; margin: 0; }
}

/* ---------- footer ---------- */
.footer { padding: 40px 0 36px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 26px; }
.footer a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
