/* AIN71 — ain71.com · tokens from the AIN71 design system (Wadi palette, IBM Plex) */
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/fonts/IBMPlexSansArabic-Light.woff) format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/fonts/IBMPlexSansArabic-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/fonts/IBMPlexSansArabic-Medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url(/fonts/IBMPlexSansArabic-SemiBold.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/IBMPlexSans-Variable.woff) format("woff"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/IBMPlexMono-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }

:root {
  --surface: #f7f5f0; --surface-raised: #ffffff; --line: #e4dfd4; --line-strong: #8a8475;
  --ink: #13201d; --ink-muted: #55605c;
  --primary: #0b5b55; --primary-soft: #ddede9; --on-primary: #ffffff;
  --accent: #7d5e29; --accent-soft: #f4e6cb;
  --danger: #b42318; --danger-soft: #fbe6e3; --warning: #b04a05; --warning-soft: #fcebdc;
  --success: #1f7a3a; --success-soft: #e0f1e5; --info: #1d5fa8; --info-soft: #e2ecf8;
  --night: #0d1412; --night-raised: #151e1b; --night-ink: #e7edea; --night-muted: #9ba9a4; --night-primary: #6dbfa8; --night-line: #25302c;
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  --font-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --font-lat: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius-sm: 4px; --radius-md: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-ar); font-size: 16px; line-height: 1.75; letter-spacing: 0; font-synthesis: none; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { font-family: var(--font-lat); font-size: 15px; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { color: var(--primary); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

/* type */
.display { font-size: clamp(48px, 7.4vw, 96px); line-height: 1.25; font-weight: 400; margin: 0; }
html[lang="en"] .display { font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; }
.title { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.45; font-weight: 400; margin: 0 0 24px; }
html[lang="en"] .title { font-weight: 300; line-height: 1.2; }
.heading { font-size: 22px; line-height: 1.45; font-weight: 500; margin: 0 0 8px; }
html[lang="en"] .heading { font-size: 19px; line-height: 1.4; }
.body-lg { font-size: 18px; line-height: 1.8; color: var(--ink-muted); }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--night-primary); margin: 0 0 16px; }
.eyebrow--dark { color: var(--primary); }
html[lang="en"] .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding-inline: 24px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: filter .12s ease-out, background-color .12s ease-out; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { filter: brightness(1.12); }
.btn--primary[disabled] { opacity: .5; cursor: progress; }
.btn--ghost { color: var(--night-ink); border-color: var(--night-line); }
.btn--ghost:hover { background: var(--night-raised); }

/* header + hero (Night Wadi) */
.top { position: absolute; inset-inline: 0; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; }
.brand img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--night-muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--night-ink); }
.lang { background: none; border: 1px solid var(--night-line); color: var(--night-ink); border-radius: var(--radius-sm); min-width: 44px; height: 36px; font: 500 14px var(--font-lat); cursor: pointer; }
html[lang="en"] .lang { font-family: var(--font-ar); font-size: 16px; }

.hero { position: relative; overflow: hidden; background: var(--night); color: var(--night-ink); min-height: min(92vh, 820px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px; padding: 140px max(32px, calc((100vw - 1120px) / 2)) 96px; }
.hero__text { position: relative; z-index: 1; max-width: 600px; }
.lede { font-size: 19px; line-height: 1.85; color: var(--night-muted); margin: 24px 0 40px; max-width: 520px; }
html[lang="en"] .lede { font-size: 18px; line-height: 1.6; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn--primary { background: var(--night-primary); color: #062019; }
.hero__art { position: relative; height: 100%; min-height: 360px; display: grid; place-items: center; }
.hero__symbol { position: relative; width: min(100%, 420px); height: auto; }
/* square nuqta grid at space-10 pitch, dots = space-2 */
.nuqta-field { position: absolute; inset: 6% 2%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='8' height='8' fill='%2325302c'/%3E%3C/svg%3E"); background-size: 40px 40px; }

/* tools */
.tools { padding: 112px 0 96px; }
.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--line); margin-block-end: 32px; overflow-x: auto; }
.tab { background: none; border: 0; border-block-end: 2px solid transparent; padding: 12px 18px; font: inherit; font-weight: 500; color: var(--ink-muted); cursor: pointer; white-space: nowrap; margin-block-end: -1px; }
.tab.is-active { color: var(--primary); border-block-end-color: var(--primary); }
.panel__intro { color: var(--ink-muted); max-width: 720px; margin: 0 0 24px; }
.form { display: flex; gap: 12px; max-width: 720px; }
.form--stack { flex-direction: column; align-items: flex-start; }
.input { flex: 1; width: 100%; min-height: 48px; padding: 10px 16px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); font: 16px var(--font-mono); }
.input--area { min-height: 180px; resize: vertical; font-size: 14px; line-height: 1.6; }
.input:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--primary); }

.result:empty { display: none; }
.result { margin-block-start: 32px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 28px; max-width: 920px; }
.muted { color: var(--ink-muted); }
.error { color: var(--danger); }
.loading { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); }
.loading::before { content: ""; width: 10px; height: 10px; background: var(--primary); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }

.score { display: flex; align-items: center; gap: 24px; padding-block-end: 24px; border-block-end: 1px solid var(--line); margin-block-end: 24px; }
.grade { width: 88px; height: 88px; display: grid; place-items: center; font: 300 56px/1 var(--font-lat); color: var(--on-primary); background: var(--primary); border-radius: var(--radius-sm); }
.grade--C, .grade--D { background: var(--warning); } .grade--F { background: var(--danger); }
.score h3 { margin: 0; font-size: 22px; font-weight: 500; }
.score bdi { font-family: var(--font-mono); font-size: 17px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checks li { display: grid; grid-template-columns: 124px 1fr; gap: 16px; align-items: start; padding: 10px 0; border-block-end: 1px solid var(--line); }
.checks code { display: block; font: 12px/1.5 var(--font-mono); color: var(--ink-muted); direction: ltr; text-align: start; word-break: break-all; margin-block-start: 2px; }
html[dir="rtl"] .checks code { text-align: end; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 2px; font-size: 13px; font-weight: 500; line-height: 22px; white-space: nowrap; justify-self: start; }
.badge::before { content: ""; width: 8px; height: 8px; background: currentColor; }
.badge--pass { background: var(--success-soft); color: var(--success); }
.badge--pass::before { width: 9px; height: 5px; background: none; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg) translateY(-2px); }
.badge--warn { background: var(--warning-soft); color: var(--warning); }
.badge--warn::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.badge--fail, .badge--high { background: var(--danger-soft); color: var(--danger); }
.badge--medium { background: var(--accent-soft); color: var(--accent); }
.badge--medium::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.badge--low { background: var(--info-soft); color: var(--info); }
.badge--low::before { border-radius: 50%; }

.report { margin-block-start: 28px; padding: 24px; background: var(--primary-soft); border-radius: var(--radius-md); }
.report h4 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--primary); }
.report p { margin: 0 0 12px; }
.fixes { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.fixes li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.fixes strong { font-weight: 600; }
.fixes span.how { grid-column: 2; color: var(--ink-muted); }

.verdict { display: flex; align-items: center; gap: 16px; margin-block-end: 20px; }
.verdict__label { font-size: 26px; font-weight: 500; }
.verdict--danger .verdict__label { color: var(--danger); } .verdict--warn .verdict__label { color: var(--warning); } .verdict--ok .verdict__label { color: var(--success); }
.signals { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.signals li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }

/* idea + principles */
.idea { background: var(--surface-raised); padding: 112px 0; border-block: 1px solid var(--line); }
.idea__grid { display: grid; grid-template-columns: 280px 1fr; gap: 64px; align-items: center; }
.idea__symbol { width: 100%; height: auto; }
.principles { padding: 96px 0 112px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { padding: 32px 28px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.card p { margin: 0; color: var(--ink-muted); }
.nuqta { display: inline-block; width: 12px; height: 12px; background: var(--primary); margin-block-end: 20px; box-shadow: 20px 0 0 var(--accent); }
html[dir="rtl"] .nuqta { box-shadow: -20px 0 0 var(--accent); }

.foot { background: var(--night); color: var(--night-muted); padding: 48px max(32px, calc((100vw - 1120px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 24px; font-size: 14px; }
.foot p { margin: 0; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 120px 20px 64px; min-height: 0; }
  .hero__art { min-height: 220px; order: -1; }
  .hero__symbol { width: 200px; }
  .top { padding: 16px 20px; } .brand img { width: 112px; }
  .nav a { display: none; }
  .form { flex-direction: column; }
  .idea__grid { grid-template-columns: 1fr; gap: 32px; } .idea__symbol { width: 160px; }
  .cards { grid-template-columns: 1fr; }
  .checks li, .signals li { grid-template-columns: 1fr; gap: 6px; }
  .foot { flex-direction: column; align-items: flex-start; }
  .wrap { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .loading::before { animation: none; } }
