/* Shu Ya'ni — limestone, ink, Hebron-glass cobalt. One loud thing per page: the handwritten headword. */
:root {
  --stone: #f2f3ef;
  --stone-2: #e7e9e3;
  --paper: #fbfbf9;
  --ink: #1a2233;
  --ink-2: #4a5263;
  --ink-3: #7b8292;
  --rule: #d6d9d1;
  --glass: #1f3fa0;
  --glass-soft: #e3e8f6;
  --focus: #1f3fa0;
  --d-pal: #b8233a;
  --d-leb: #2f7d4e;
  --d-egy: #a8691a;
  --d-gulf: #177e89;
  --d-irq: #7a4e2d;
  --d-msa: #6b7383;
  --bubble: #ffffff;
  --shadow: 0 1px 0 rgba(26, 34, 51, .06), 0 6px 18px -10px rgba(26, 34, 51, .25);
  --ar-display: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  --sans: "Readex Pro", "Noto Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone: #121722; --stone-2: #1a2130; --paper: #161c28; --ink: #e9ebef; --ink-2: #b7bcc7; --ink-3: #8a91a0;
    --rule: #2a3243; --glass: #9db2ff; --glass-soft: #1f2a48; --focus: #9db2ff; --bubble: #1d2533;
    --d-pal: #f0627a; --d-leb: #5fbf86; --d-egy: #e0a24c; --d-gulf: #4cc0cb; --d-irq: #c9936b; --d-msa: #9aa2b2;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --stone: #121722; --stone-2: #1a2130; --paper: #161c28; --ink: #e9ebef; --ink-2: #b7bcc7; --ink-3: #8a91a0;
  --rule: #2a3243; --glass: #9db2ff; --glass-soft: #1f2a48; --focus: #9db2ff; --bubble: #1d2533;
  --d-pal: #f0627a; --d-leb: #5fbf86; --d-egy: #e0a24c; --d-gulf: #4cc0cb; --d-irq: #c9936b; --d-msa: #9aa2b2;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--stone); color: var(--ink);
  font: 400 17px/1.6 var(--sans); font-feature-settings: "kern";
}
a { color: var(--glass); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[lang="ar"] { font-family: var(--sans); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { border-bottom: 1px solid var(--rule); background: var(--stone); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-ar { font-family: var(--ar-display); font-size: 30px; line-height: 1; color: var(--glass); }
.brand-en { font-weight: 600; font-size: 16px; letter-spacing: .01em; }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px;
}
.search input::placeholder { color: var(--ink-3); }
.results {
  position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow);
}
.results[hidden] { display: none; }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.results a:hover, .results a.on { background: var(--glass-soft); }
.results .ar { font-family: var(--ar-display); font-size: 20px; line-height: 1.1; color: var(--ink-2); }
.results .none { padding: 8px 10px; color: var(--ink-3); font-size: 14px; }
@media (max-width: 719px) {
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 16px; }
  .search { max-width: none; order: 2; flex-basis: 100%; }
}

/* Entry head: question on the left, the handwritten word on the right */
.head { display: grid; gap: 8px 48px; padding: 40px 0 36px; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; padding: 64px 0 56px; } }
.crumbs { font-size: 14px; color: var(--ink-3); margin: 0 0 14px; }
.crumbs a { color: var(--ink-3); }
h1 { font-weight: 600; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -.015em; margin: 0 0 18px; max-width: 20ch; text-wrap: balance; }
.answer { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--ink); max-width: 36em; margin: 0; }
.literal { margin: 16px 0 0; color: var(--ink-2); font-size: 15px; }
.literal b { font-weight: 500; color: var(--ink); }
.word { text-align: right; }
@media (max-width: 899px) { .word { order: -1; text-align: left; } }
.word-ar {
  font-family: var(--ar-display); font-weight: 400; color: var(--ink); line-height: 1.15; margin: 0;
  font-size: clamp(88px, 15vw, 168px); letter-spacing: 0; direction: rtl; unicode-bidi: isolate;
}
.word-en { font-size: clamp(26px, 3vw, 34px); font-weight: 600; color: var(--glass); margin: 0 0 4px; }
.word-say { display: inline-flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--ink-2); font-size: 16px; }
.word-say .say { font-weight: 500; color: var(--ink); }
.arabizi { color: var(--ink-3); }

/* Play button, shared */
.play {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--glass); color: #fff;
}
:root[data-theme="dark"] .play, .play { color: var(--stone); }
.play svg { width: 16px; height: 16px; }
.play .i-pause { display: none; }
.play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-pause { display: block; }
.play:disabled { background: var(--stone-2); color: var(--ink-3); cursor: default; }
.play.small { width: 34px; height: 34px; }
.play.small svg { width: 12px; height: 12px; }

/* Section rhythm */
.section { padding: 44px 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
h2 { font-size: clamp(22px, 2.4vw, 27px); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px; }
.sub { margin: 0 0 24px; color: var(--ink-2); max-width: 40em; }

/* The dialect voice notes — the signature element */
.notes { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.note {
  display: grid; gap: 10px 20px; align-items: center;
  grid-template-columns: 1fr; padding: 14px 16px 16px; border-radius: 4px 20px 20px 20px;
  background: var(--bubble); box-shadow: var(--shadow); border-left: 4px solid var(--dc);
  max-width: 820px;
}
@media (min-width: 760px) {
  .note { grid-template-columns: 170px minmax(0, 1fr) auto; padding: 16px 22px; }
}
.dur { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.note.msa { background: transparent; box-shadow: none; border: 1px dashed var(--rule); border-left: 4px solid var(--dc); }
.who { line-height: 1.3; }
.who strong { display: block; font-weight: 600; color: var(--dc); font-size: 16px; }
.who span { font-size: 13px; color: var(--ink-3); }
.who .instead { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--dc); }
.voice { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wave { display: flex; align-items: center; gap: 2px; height: 30px; flex: 0 1 180px; min-width: 60px; }
.wave i { display: block; width: 3px; border-radius: 2px; background: var(--dc); opacity: .35; }
.wave i.lit { opacity: 1; }
.said { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.said .ar { font-family: var(--ar-display); font-size: 40px; line-height: 1.15; direction: rtl; }
.said .lat { font-size: 15px; color: var(--ink-2); }
.said .lat b { font-weight: 500; color: var(--ink); }
.note p { grid-column: 1 / -1; margin: 0; font-size: 15px; color: var(--ink-2); max-width: 60em; }
.note .fem { font-size: 14px; color: var(--ink-3); }
.note .fem [lang="ar"] { font-size: 17px; color: var(--ink-2); }
@media (max-width: 759px) {
  .said { align-items: flex-start; text-align: left; }
  .said .ar { font-size: 36px; }
  .note .said { order: 1; }
  .note .voice { order: 2; }
  .note p { order: 3; }
}
.same { margin: 18px 0 0; font-size: 15px; color: var(--ink-2); }

/* Story + sidebar */
.cols { display: grid; gap: 40px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 64px; } }
.story p { margin: 0 0 1.1em; max-width: 34em; font-size: 18px; line-height: 1.7; }
.side h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.side section + section { margin-top: 30px; }
.forms { list-style: none; margin: 0; padding: 0; }
.forms li { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--rule); }
.forms li:last-child { border-bottom: 1px solid var(--rule); }
.forms .ar { grid-row: span 2; font-family: var(--ar-display); font-size: 30px; line-height: 1.1; min-width: 3.2em; text-align: right; }
.forms .lat { font-weight: 500; }
.forms .use { font-size: 14px; color: var(--ink-2); }
.meter { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; align-items: center; font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.meter .bar { height: 8px; border-radius: 4px; background: var(--stone-2); overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: var(--glass); border-radius: 4px; }
.meter-note { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; }
.dos { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.dos li { padding: 8px 0 8px 26px; position: relative; border-top: 1px solid var(--rule); }
.dos li::before { position: absolute; left: 2px; top: 8px; font-weight: 600; }
.dos .ok::before { content: "✓"; color: var(--d-leb); }
.dos .warn::before { content: "!"; color: var(--d-egy); left: 6px; }

/* Examples */
.examples { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ex { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 18px 0; border-top: 1px solid var(--rule); }
.ex:last-child { border-bottom: 1px solid var(--rule); }
.ex .play { grid-row: 1 / span 4; align-self: start; margin-top: 4px; }
.ex > span { grid-column: 2; }
.ex .ar { font-size: 26px; line-height: 1.4; direction: rtl; text-align: left; }
.ex .lat { color: var(--ink-2); font-size: 15px; }
.ex .en { font-size: 16px; }
.ex .tag { font-size: 13px; color: var(--dc); font-weight: 500; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); max-width: 46em; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 500; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 22px; color: var(--ink-3); font-weight: 300; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--ink-2); max-width: 40em; }

/* Word chips (related words, collections) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.chips a {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px 8px 14px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
}
.chips a:hover { border-color: var(--glass); }
.chips .ar { font-family: var(--ar-display); font-size: 22px; line-height: 1; color: var(--glass); }

/* How we checked */
.checked { font-size: 14px; color: var(--ink-2); max-width: 46em; }
.checked p { margin: 0 0 8px; }
.badge { display: inline-block; font-size: 13px; padding: 1px 9px; border-radius: 999px; background: var(--stone-2); color: var(--ink-2); }
.badge.native { background: color-mix(in srgb, var(--d-leb) 16%, transparent); color: var(--d-leb); }

/* Home */
.hero { padding: 48px 0 40px; display: grid; gap: 36px; border-bottom: 1px solid var(--rule); }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; padding: 72px 0 64px; gap: 64px; } }
.hero h1 { max-width: 16ch; }
.demo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.demo-head h2 { margin: 0; }
.playall { font: inherit; font-size: 14px; font-weight: 500; color: var(--glass); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.playall:hover { border-color: var(--glass); }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 30em; margin: 0 0 24px; }
.hero .search { max-width: 460px; }
.hero .search input { font-size: 17px; padding: 14px 22px; }
.hero-demo h2 { font-size: 17px; font-weight: 500; color: var(--ink-2); margin: 0 0 14px; }
.hero-demo .notes { gap: 10px; }
.hero-demo .note { grid-template-columns: 1fr auto; padding: 12px 16px; }
.hero-demo .note .voice { display: none; }
.hero-demo .said .ar { font-size: 34px; }
.hero-demo .note .who { display: flex; align-items: center; gap: 12px; }
.hero-demo .note.playing { box-shadow: 0 0 0 2px var(--dc), var(--shadow); }
.shelf { padding: 44px 0; border-bottom: 1px solid var(--rule); }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.shelf-head p { margin: 0; color: var(--ink-2); }
.wordgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.wordgrid a {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 124px; padding: 14px 16px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; background: var(--paper);
}
.wordgrid a:hover { background: var(--glass-soft); }
.wordgrid .ar { font-family: var(--ar-display); font-size: 38px; line-height: 1.1; direction: rtl; text-align: right; color: var(--ink); }
.wordgrid .en { font-size: 15px; font-weight: 500; }
.wordgrid .gl { font-size: 13px; color: var(--ink-2); line-height: 1.35; }

/* Footer */
.foot { padding: 40px 0 56px; color: var(--ink-3); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.foot a { color: var(--ink-2); }


