/* MacalinKaab marketing: the page's own layer over the taste-skill kit (system.css and friends, in the
   "taste" layer). Brand tokens from `start.mjs brand` (white ground, #111 ink, the logo's #6d3fee as
   the one accent: the owner kept the purple, docs/DECISIONS.md), Geist through next/font, dark mode
   (next-themes' html.dark), Arabic and RTL, and the "page CSS" the section recipes ask for. Tailwind's
   components and utilities still win over both layers. */
@layer theme, base, taste, site, components, utilities;
@layer site {
:root {
  --p-bg: #ffffff; --p-surface: #f4f4f4; --p-ink: #111111; --p-muted: #686868;
  --p-accent: #6d3fee; --p-accent-ink: #ffffff; --p-action: #6d3fee; --p-action-ink: #ffffff;
  --p-inv-bg: #111111; --p-inv-surface: #1e1e1e; --p-inv-ink: #ffffff; --p-inv-muted: #9a9a9a;
  --p-inv-accent: #6d3fee; --p-inv-accent-ink: #ffffff; --p-inv-action: #6d3fee; --p-inv-action-ink: #ffffff;
  /* next/font renames the families; its variables carry the real names */
  --font-display: var(--font-geist), var(--font-arabic), system-ui, sans-serif;
  --font-text: var(--font-geist), var(--font-arabic), system-ui, sans-serif;
  --font-mono: var(--font-geist-mono), ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500; --display-tracking: -0.035em; --display-tracking-xl: -0.045em;
}
/* dark: the inverse palette, the purple a step lighter where it is text or a mark */
html.dark {
  --p-bg: #0f0f10; --p-surface: #1a1a1c; --p-ink: #f4f4f5; --p-muted: #a1a1aa;
  --p-accent: #9b7bff; --p-accent-ink: #111111; --p-action: #6d3fee; --p-action-ink: #ffffff;
  --p-inv-bg: #f4f4f5; --p-inv-surface: #e4e4e7; --p-inv-ink: #111111; --p-inv-muted: #5c5c63;
  color-scheme: dark;
}
html.dark .d-win, html.dark .d-card { background: #17181b; color: #eceef0; box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 30px 70px -30px rgb(0 0 0 / .8); }

/* Arabic: Plex Sans Arabic first, and no negative tracking (it breaks the joins) */
:root:lang(ar) {
  --font-display: var(--font-arabic), var(--font-geist), system-ui, sans-serif;
  --font-text: var(--font-arabic), var(--font-geist), system-ui, sans-serif;
  --display-tracking: 0; --display-tracking-xl: 0;
}
:lang(ar) :is(h1, h2, h3, h4, .close__word, .footer__lede, .btn--xl) { letter-spacing: 0; }
:lang(ar) :is(h1, h2) { line-height: 1.25; }

/* the app's shadcn components keep their own type: no display tracking on their headings */
:is(h1, h2, h3, h4):where([data-slot], [data-slot] *) { font-family: var(--font-text); letter-spacing: normal; }

/* RTL: arrows point the way the line reads; the nav underline draws from the start side */
[dir="rtl"] :is(.btn, .link, .pill)::after, [dir="rtl"] .m-arrow { transform: scaleX(-1); }
@media (hover: hover) and (pointer: fine) {
  [dir="rtl"] :is(.btn, .link):hover::after { transform: scaleX(-1) translateX(3px); }
}
[dir="rtl"] .nav__link::before { transform-origin: left; }
[dir="rtl"] :is(.nav__link:hover, .nav__link:focus-visible, .nav__item:hover > .nav__link, .nav__item:focus-within > .nav__link)::before { transform-origin: right; }
[dir="rtl"] .d-win { text-align: start; }
[dir="rtl"] .d-msg--me { border-bottom-right-radius: 16px; border-bottom-left-radius: 6px; }
[dir="rtl"] .d-msg--bot { border-bottom-left-radius: 16px; border-bottom-right-radius: 6px; }

/* our column starts (the kit's .start-N share a name with Tailwind's start-N inset utility) */
@media (min-width: 1024px) {
  .grid > .cs-7 { grid-column-start: 7; }
  .grid > .cs-10 { grid-column-start: 10; }
}

/* a phone: the shadcn buttons in the bar's sheet and the legal row are 44px targets too */
@media (max-width: 639px) {
  :is(.nav__tools, .footer__legal) [data-slot="button"] { min-height: 44px; min-width: 44px; }
}

/* the name across the .wrap: MacalinKaab is 11 letters (the kit sizes for 8), so a phone sets it smaller;
   line-height 1 keeps the capitals inside the clip */
.close__word { line-height: 1; font-size: clamp(56px, min(14.5vw, 16svh), 216px); }
@media (min-width: 640px) { footer.closing > .wrap { row-gap: var(--s-7); } .closing__cta { gap: var(--s-5); } }
/* the close and the footer are at least one screen and grow with their content: on a short or narrow
   window the name never runs over the link columns (the kit fixes the height to one screen) */
footer.closing { height: auto; min-height: 100vh; min-height: 100svh; }
footer.closing > .wrap { height: auto; min-height: 100%; grid-template-rows: auto auto; }
@media (max-width: 639px) { .close__word { font-size: clamp(40px, 15vw, 96px); } }

/* ---------------------------------------------------------------- the header's own pieces */
.nav__logo img { height: 36px; width: auto; }
html.dark .nav__logo img, html.dark .footer-logo { filter: brightness(0) invert(1); }
/* language and theme: in the bar from 1024, in the open sheet below it (closed, the kit hides them) */
@media (min-width: 1024px) { .nav__tools { display: flex; align-items: center; gap: var(--s-1); } }
@media (max-width: 1023px) { .nav.is-open .nav__actions .nav__tools { display: flex; justify-content: center; gap: var(--s-2); order: 3; } }
/* a phone: the logo a step smaller; under 360px the bar keeps the logo and the menu (the hero holds the button) */
@media (max-width: 639px) { .nav__logo img { height: 28px; } }
@media (max-width: 359px) { .nav:not(.is-open) .nav__actions { display: none; } .nav:not(.is-open) .nav__toggle { margin-inline-start: auto; } }
.menu-card__title { display: block; font-weight: 500; }

/* ---------------------------------------------------------------- hero (hero--centred) */
/* the frame's painted ground before WebGL draws (and without it): sky, far hills, a lit near hill */
.hero__window { background:
  radial-gradient(120% 60% at 70% 118%, #6f7f3a 0 40%, transparent 41%),
  radial-gradient(90% 50% at 10% 108%, #57703f 0 42%, transparent 43%),
  radial-gradient(80% 40% at 60% 92%, #9fb2c4 0 40%, transparent 41%),
  linear-gradient(#5f93cc, #a9c7e4 70%, #c8d6dd); }
.hero__window .d-win__body { grid-template-columns: 260px 1fr; min-height: 420px; }
.hero__window .d-win__bar b { font-weight: 500; color: inherit; }
.hero__window .d-win__bar .sp { flex: 1; }
.hero__window .d-chat { padding: 14px 18px; gap: 8px; }
.hero__window .d-msg--me { background: var(--p-accent); color: #fff; }
.hero__window .d-msg--me small { display: none; }
.hero__window .d-msg--bot { max-width: 86%; background: #f1f1f3; color: #16181a; }
html.dark .hero__window .d-msg--bot { background: #24262b; color: #eceef0; }
.hero__window .d-msg--bot small { display: inline; margin-inline-start: 8px; white-space: nowrap; }
.hero__window .d-msg--bot small { opacity: 1; color: #555a60; }
html.dark .hero__window .d-msg--bot small { color: #a8adb3; }
.hero__window .d-tool { color: #6b7076; }
.roster { border-inline-end: 1px solid rgb(0 0 0 / .07); padding: 10px; display: grid; align-content: start; gap: 2px; }
html.dark .roster { border-color: rgb(255 255 255 / .07); }
.roster .q { height: 34px; margin-bottom: 6px; border-radius: 9px; background: rgb(0 0 0 / .04); display: flex; align-items: center; padding: 0 10px; color: #6b7076; font-size: 13px; }
html.dark .roster .q { background: rgb(255 255 255 / .06); color: #8d9399; }
.roster .t { display: grid; grid-template-columns: 30px 1fr auto; gap: 1px 10px; padding: 9px 8px; border-radius: 9px; font-size: 13px; }
.roster .t.is-on { background: rgb(109 63 238 / .08); }
.roster .t i { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--font-text); font-style: normal; color: #111; }
.roster .t b { font-weight: 500; } .roster .t time { color: #555a60; font-size: 12px; }
.roster .t span { grid-column: 2 / -1; color: #5d6268; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.dark .roster .t span, html.dark .roster .t time { color: #9aa0a6; }
.convo { display: grid; min-width: 0; align-content: start; }
.acts { display: flex; gap: 8px; }
.acts span { height: 30px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; background: var(--p-accent); color: #fff; }
.acts span + span { background: rgb(0 0 0 / .05); color: inherit; }
html.dark .acts span + span { background: rgb(255 255 255 / .08); }
@media (max-width: 639px) {
  .hero__window .d-win__bar .sp ~ span { display: none; }
  .hero__window .d-win__body { grid-template-columns: 1fr; }
  .roster { display: none; }
  .hero__window .d-chat { font-size: 13px; padding: 12px 14px; }
  .hero__window .d-msg--bot small, .hero__window .d-tool { display: none; }
}

/* ---------------------------------------------------------------- app-frame (sections-library.md) */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-inline-start: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
/* the open lesson fills its pane: the page on the left, its note at the right edge (RTL: the left) */
.app .ui-doc { width: 100%; }
[dir="rtl"] .ui-doc__note { right: auto; left: 0; }
@media (min-width: 1024px) {
  .app .ui-doc { padding: var(--s-6) 248px 0 var(--s-6); }
  .app .ui-doc__note { top: var(--s-6); right: var(--s-5); }
  [dir="rtl"] .app .ui-doc { padding: var(--s-6) var(--s-6) 0 248px; }
  [dir="rtl"] .app .ui-doc__note { right: auto; left: var(--s-5); }
}
.ui-win__ph { white-space: nowrap; }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app .ui-win__side { display: none; }
  .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-inline-start: 0; border-top: 1px solid var(--u-line); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}

/* ---------------------------------------------------------------- features-2x2: one panel height */
#features .panel { --p-h: 336px; }
@media (max-width: 639px) { #features .panel { --p-h: 176px; } }
#features .stage > .at-rise.is-chat, #features .stage > .at-rise.is-wide { --fit-max: 400px; --ax: max(24px, 50% - 200px); --ay: 56px; --ay-sm: 56px; }
#features .stage > .at-rise.is-low { --fit-max: 380px; --ax: 32px; --ay: calc(100% - 180px); --ay-sm: calc(100% - 180px); }

/* ---------------------------------------------------------------- about: the statement, centred in its screen */
#about > .wrap.statement { justify-content: center; gap: var(--s-7); }
#about .t-lead { color: var(--k-muted); }

/* ---------------------------------------------------------------- payouts split: the frame */
#payouts .frame--split { --ratio: 80%; }
@media (max-width: 639px) { #payouts .frame--split { --ratio: 100%; } }
#payouts .frame--split .stage > .at-corner { --ax: 56px; --ay: 56px; }
.facts { display: grid; gap: var(--s-2); }
.facts li { display: flex; align-items: baseline; gap: var(--s-3); }
.facts li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--k-accent); transform: translateY(-1px); }
#payouts .frame--split .stage > .at-over { --bx: 24px; --by: -40px; }
.quote-line { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); display: grid; gap: var(--s-3); }
.quote-line blockquote { font-size: var(--t-lead); line-height: 1.5; }
.quote-line figcaption { font-size: var(--t-small); color: var(--k-muted); }

/* ---------------------------------------------------------------- pricing: plan cards from the database */
.plans { align-items: stretch; }
.plans > .card--plan { grid-column: 1 / -1; }
@media (min-width: 1024px) { .plans > .card--plan { grid-column: auto / span 4; } }
.plans > .card--plan { --c-pad: 24px; gap: var(--s-3); }
.card--plan .plan__lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-4); font-size: var(--t-small); line-height: 1.35; align-content: start; flex: 1; }
.card--plan .plan__lines li { display: flex; gap: var(--s-2); }
.card--plan .plan__lines svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--k-accent); }
.card--plan .price .t-stat { font-variant-numeric: tabular-nums; font-size: var(--t-h3); }
.plan__meta { font-size: var(--t-small); color: var(--k-muted); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.plan__save { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s-2); border-radius: 999px; background: color-mix(in oklab, var(--k-accent) 12%, var(--bg)); color: var(--ink); font-size: var(--t-label); font-weight: 500; }
.plan__switch { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-small); }
.plan__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
/* a phone: the three plans stay within two screens (who each plan is for is in its name and lines) */
@media (max-width: 639px) {
  .plans > .card--plan { gap: var(--s-2); }
  .card--plan .plan__for { display: none; }
  .card--plan .plan__lines { gap: 6px var(--s-3); }
}
#pricing .section-head--split { align-items: end; }

/* ---------------------------------------------------------------- faq: the reply card under the words */
#faq .panel { --p-h: 200px; margin-top: var(--s-6); border-radius: var(--r-lg); }
/* a phone: the five answers fill the second of the section's two screens (.g2m) */
@media (max-width: 639px) {
  #faq .faq > .faq__item { padding: 10px 0; }
  #faq .faq__item > h3 { line-height: 1.3; }
}
#faq .stage > .at-rise { --fit-max: 360px; --ax: 24px; --ay: 40px; --ay-sm: 32px; }

/* ---------------------------------------------------------------- the footer's newsletter */
.footer__news { display: grid; gap: var(--s-3); }
.footer__news p { font-size: var(--t-small); color: var(--k-muted); }

/* ---------------------------------------------------------------- inner pages: the page head under the fixed bar */
.page-head { padding: calc(var(--nav) + var(--s-9)) 0 var(--s-8); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 20ch; font-size: clamp(36px, 2.29vw + 27px, 60px); line-height: 1.08; }
.page-head p { margin-top: var(--s-4); max-width: 60ch; font-size: var(--t-lead); color: var(--k-muted); }
}
