/* BrainWave welcome page. Self-contained; logical properties give right-to-left for free. */
:root {
    --ink: #0f2f36;
    --teal: #0f6f78;
    --teal-dark: #0b5961;
    --teal-light: #17909a;
    --mint: #e4f3f2;
    --sky: #eef7fb;
    --sun: #f6b73c;
    --coral: #ef6f5e;
    --text: #25383e;
    --muted: #55696f;
    --line: #d9e6e7;
    --card: #fff;
    --radius: 18px;
    --shadow: 0 18px 44px rgba(15, 47, 54, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; font-family: system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif; color: var(--text); background: #fbfdfd; line-height: 1.6; }
a { color: var(--teal); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; }
:focus-visible { outline: 3px solid #e59b00; outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: 1.25rem; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; border-radius: 999px; padding: .72rem 1.35rem; border: 2px solid var(--teal); background: var(--teal); color: #fff; transition: background .15s, transform .15s; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.ghost { background: transparent; color: var(--teal); }
.btn.ghost:hover { background: var(--mint); }
.btn.small { padding: .5rem 1.05rem; font-size: .95rem; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: var(--mint); border-color: var(--mint); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 1.4rem; margin-inline-start: 1.5rem; }
.nav a { color: var(--text); text-decoration: none; font-weight: 550; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--teal-light); }
.head-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .75rem; }
.head-actions form { margin: 0; }
.lang { font: inherit; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; }
.lang:hover { background: var(--mint); }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #e3f3f2 0%, #f3fafa 70%, #fbfdfd 100%); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 520px; height: 520px; inset-block-start: -220px; inset-inline-end: -160px; background: radial-gradient(circle, rgba(246, 183, 60, .28), transparent 68%); }
.hero::after { width: 460px; height: 460px; inset-block-end: -200px; inset-inline-start: -140px; background: radial-gradient(circle, rgba(23, 144, 154, .22), transparent 70%); }
.hero-grid { position: relative; z-index: 1; display: grid; gap: 2.5rem; align-items: center; padding-block: 3.5rem 4.5rem; grid-template-columns: 1.05fr .95fr; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; font-size: .9rem; color: var(--teal-dark); background: #fff; border: 1px solid #c4e1e0; border-radius: 999px; padding: .3rem .85rem; margin-bottom: 1.1rem; }
.eyebrow::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--sun); }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: 1.1rem; }
.hero h1 em { font-style: normal; color: var(--teal); }
.lead { font-size: 1.15rem; color: var(--text); max-width: 56ch; margin-bottom: 1.6rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: .45rem; font-size: .92rem; color: var(--muted); }
.chips svg { width: 18px; height: 18px; color: var(--teal); }

/* The illustration of the app */
.mock { position: relative; display: grid; gap: 1rem; }
.mock-card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 1.15rem 1.25rem; border: 1px solid rgba(15, 47, 54, .06); }
.mock-card.board { inset-inline-start: 2rem; position: relative; margin-inline-end: 2rem; }
.mock-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.avatar { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--sun); color: var(--ink); font-weight: 800; flex: none; }
.mock-top strong { display: block; color: var(--ink); line-height: 1.2; }
.mock-top small { color: var(--muted); }
.pill { margin-inline-start: auto; font-weight: 700; font-size: .85rem; color: #1f6b3a; background: #e1f4e8; border-radius: 999px; padding: .2rem .7rem; white-space: nowrap; }
.chart { direction: ltr; display: block; width: 100%; height: auto; }
.mock-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: .6rem 0 .5rem; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; list-style: none; padding: 0; margin: 0; }
.steps li { display: grid; justify-items: center; gap: .15rem; text-align: center; font-size: .72rem; line-height: 1.25; color: var(--muted); background: var(--sky); border-radius: 12px; padding: .5rem .2rem; }
.steps li:first-child { background: #fff3d6; color: #6a4a00; box-shadow: inset 0 0 0 2px var(--sun); }
.steps .emoji, .tile .emoji { font-size: 1.5rem; line-height: 1.1; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tile { display: grid; justify-items: center; gap: .15rem; text-align: center; font-weight: 650; font-size: .82rem; color: var(--ink); border-radius: 14px; padding: .65rem .3rem; border: 2px solid transparent; }
.tile:nth-child(1) { background: #fde6e2; border-color: var(--coral); }
.tile:nth-child(2) { background: #e0f0fb; }
.tile:nth-child(3) { background: #e1f4e8; }
.tile:nth-child(4) { background: #fff3d6; }
.tile:nth-child(5) { background: #ece6fb; }
.tile:nth-child(6) { background: #e4f3f2; }
.caption { color: var(--muted); font-size: .8rem; text-align: center; }

.wave { display: block; width: 100%; height: 56px; margin-top: -1px; }

/* Sections */
section { padding-block: 3.5rem; }
.heading { max-width: 46rem; margin-bottom: 2rem; }
.heading h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .6rem; }
.heading p { color: var(--muted); font-size: 1.05rem; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; }
.feature { transition: transform .18s, box-shadow .18s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature h3 { font-size: 1.1rem; margin-block: .85rem .4rem; }
.feature p { color: var(--muted); }
.badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--mint); color: var(--teal); }
.feature:nth-child(3n+2) .badge { background: #fff3d6; color: #8a5d00; }
.feature:nth-child(3n) .badge { background: #fde6e2; color: #b2402f; }

/* Roles */
.roles { background: var(--sky); }
.role { position: relative; padding-top: 1.6rem; overflow: hidden; }
.role::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 6px; background: var(--teal); }
.role:nth-child(2)::before { background: var(--sun); }
.role:nth-child(3)::before { background: var(--coral); }
.role:nth-child(4)::before { background: var(--ink); }
.role h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: .8rem; }
.role h3 .icon { color: var(--teal); }
.role ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.role li { position: relative; padding-inline-start: 1.45rem; color: var(--text); }
.role li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .6em; width: .6rem; height: .6rem; border-radius: 50%; background: var(--mint); box-shadow: inset 0 0 0 2px var(--teal-light); }

/* Privacy */
.privacy { background: linear-gradient(135deg, var(--ink), #134650); color: #e5f2f3; }
.privacy h2 { color: #fff; }
.privacy .heading p { color: #b9d3d6; }
.checks { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: .75rem; align-items: flex-start; }
.checks .icon { color: var(--sun); margin-top: .1rem; }

/* Demo */
.demo { background: linear-gradient(180deg, #fff 0%, var(--mint) 100%); }
.demo-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.demo-card { display: flex; flex-direction: column; gap: .7rem; border: 2px solid var(--line); }
.demo-card h3 { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
.demo-card h3 .icon { color: var(--teal); }
.demo-card p { color: var(--muted); flex: 1; }
.demo-card form { margin: 0; }
.demo-card .btn { width: 100%; }
.notice { display: flex; gap: .6rem; align-items: flex-start; background: #fff7e0; color: #6a4a00; border: 1px solid #f1d58a; border-radius: 12px; padding: .8rem 1rem; margin-top: 1.4rem; }
details { margin-top: 1.2rem; }
summary { cursor: pointer; font-weight: 650; color: var(--teal-dark); }
.table-wrap { overflow-x: auto; margin-top: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: start; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
code { background: var(--mint); padding: .1rem .45rem; border-radius: 6px; font-size: .9em; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }

/* Closing call and footer */
.closing { text-align: center; }
.closing .card { background: linear-gradient(135deg, var(--teal), var(--teal-light)); border: 0; color: #fff; padding: 2.6rem 1.5rem; }
.closing h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .5rem; }
.closing p { color: #d9f0f1; margin-bottom: 1.4rem; }
.site-footer { padding-block: 1.8rem 2.5rem; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; }

/* Arabic: no letter-spacing, which breaks joined letters */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] .logo { letter-spacing: 0; }
[lang="ar"] .mock-label { letter-spacing: 0; text-transform: none; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; padding-block: 2.2rem 3rem; }
    .nav { display: none; }
    .mock-card.board { inset-inline-start: 0; margin-inline-end: 0; }
}
@media (max-width: 480px) {
    .head-actions .btn { padding: .5rem 1rem; }
    .steps { gap: .3rem; }
    .steps li { font-size: .66rem; }
    section { padding-block: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .feature, .btn { transition: none; }
    .feature:hover { transform: none; }
}

/* Videos */
.watch { padding-block: 3.5rem; background: var(--sky); }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; margin-top: 1.5rem; }
.video { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.video.wide { grid-column: 1 / -1; max-width: 860px; margin-inline: auto; width: 100%; }
.video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0f3d47; }
.video figcaption { padding: .9rem 1.1rem 1.1rem; display: grid; gap: .35rem; }
.video details summary { cursor: pointer; font-weight: 600; color: var(--teal); }
.video details p { margin: .5rem 0 0; color: var(--text); line-height: 1.6; }
