/* =====================================================================
   AI Kurd — design system
   Dark editorial theme. Tokens first, then components.
   ===================================================================== */

/* ---------- self-hosted fonts ---------- */
/* Aria (Kurdish). Single ExtraBold cut, served for every weight so the
   browser never fakes a bold. To add more cuts, add more @font-face blocks
   with their own font-weight. */
@font-face {
    font-family: 'Aria';
    src: url('../fonts/Aria-ExtraBold.woff2') format('woff2'),
         url('../fonts/Aria-ExtraBold.otf') format('opentype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg:        #09090b;
    --bg-2:      #0d0d10;
    --surface:   #121216;
    --surface-2: #17171c;
    --surface-3: #1e1e24;
    --line:      rgba(255,255,255,.08);
    --line-2:    rgba(255,255,255,.14);
    --line-3:    rgba(255,255,255,.26);
    --text:      #f5f5f7;
    --text-2:    #c2c2ca;
    --text-3:    #8b8b96;
    --text-4:    #5c5c66;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --ease:      cubic-bezier(.22,1,.36,1);
    --font-en:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-ku:   'Aria', 'Vazirmatn', 'Noto Sans Arabic', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    /* transparent so the fixed background layers (negative z-index) show through;
       the <html> element carries the solid colour */
    background: transparent;
    color: var(--text);
    font-family: var(--font-en);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---------- ambient background: scrolling scenes + spotlight + grain ---------- */
.scenes { transition: opacity .9s var(--ease); position: fixed; inset: -6vh 0; z-index: -3; pointer-events: none; overflow: hidden; }
.scene {
    position: absolute; inset: 0; opacity: 0;
    background-size: cover; background-position: center;
    transform: scale(1.06) translateY(var(--parallax, 0px));
    transition: opacity 1.6s var(--ease);
    will-change: opacity, transform;
}
.scene.active { opacity: .72; }
.scenes::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(9,9,11,.6) 0%, rgba(9,9,11,.15) 45%, rgba(9,9,11,.65) 100%),
        radial-gradient(70% 60% at 50% 50%, transparent 40%, rgba(9,9,11,.55) 100%);
}
/* PS5-style hover backdrop: the hovered card's picture fills the page */
.hover-bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0; transition: opacity .9s var(--ease); overflow: hidden; }
.hover-bg.show { opacity: 1; }
body.has-hover-bg .scenes { opacity: .25; }
.hover-bg img {
    position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover;
    filter: blur(8px) brightness(.8) saturate(1.15);
    transform: scale(1.1);
    transition: transform 8s linear, opacity .9s var(--ease);
}
.hover-bg.show img { transform: scale(1); }
.hover-bg::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(9,9,11,.6) 0%, rgba(9,9,11,.15) 45%, rgba(9,9,11,.8) 100%),
        radial-gradient(60% 50% at 50% 45%, transparent 30%, rgba(9,9,11,.5) 100%);
}
.site-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.075), transparent 60%),
        radial-gradient(800px 500px at 100% 20%, rgba(255,255,255,.025), transparent 60%),
        radial-gradient(700px 500px at 0% 80%, rgba(255,255,255,.02), transparent 60%);
}
.site-bg::after {
    content: ""; position: absolute; inset: 0; opacity: .045; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ---------- typography ---------- */
h1, h2, h3, h4 { letter-spacing: -.02em; }
.rtl, [dir="rtl"], .ku-only, .font-kurdish {
    font-family: var(--font-ku);
    letter-spacing: 0;
}
.rtl, [dir="rtl"] { direction: rtl; }
.ku-only h1, h1.ku-only, .ku-only h2, h2.ku-only { line-height: 1.5; font-weight: 800; }
.ku-only p, p.ku-only, p.rtl, .rtl p { line-height: 2; word-spacing: .06em; }
.prose.rtl { font-size: 17px; }
.font-mono { font-family: var(--font-mono); }

.display { font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-3);
}
.muted   { color: var(--text-2); }
.muted-2 { color: var(--text-3); }
.muted-3 { color: var(--text-4); }

::selection { background: #fff; color: #000; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }

/* ---------- language switching ---------- */
body:not(.lang-ku) .ku-only { display: none !important; }
body.lang-ku .en-only { display: none !important; }

/* ---------- layout ---------- */
.container-x { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 640px)  { .container-x { padding-inline: 28px; } }
@media (min-width: 1024px) { .container-x { padding-inline: 40px; } }
.section { padding-block: clamp(56px, 8vw, 112px); }

/* ---------- hero fills the first screen ---------- */
.hero-fold { min-height: calc(100svh - 72px); display: flex; align-items: center; }
@media (max-width: 1023px) { .hero-fold { min-height: 0; } }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 60;
    transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
    border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
    background: rgba(9,9,11,.72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-color: var(--line);
}
.nav-link {
    position: relative; font-size: 14px; font-weight: 500; color: var(--text-3);
    padding: 8px 12px; border-radius: 999px;
    transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--text); background: rgba(255,255,255,.08); }
.scroll-progress {
    position: absolute; left: 0; bottom: -1px; height: 1px; width: 0%;
    background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.2));
    transition: width .1s linear;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px; padding: 0 22px; border-radius: 999px;
    font-size: 14px; font-weight: 600; white-space: nowrap;
    transition: transform .25s var(--ease), background .2s, border-color .2s, color .2s, box-shadow .25s;
    border: 1px solid transparent; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e9e9ee; box-shadow: 0 10px 30px rgba(255,255,255,.12); }
.btn-ghost { border-color: var(--line-2); color: var(--text-2); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--line-3); color: var(--text); background: rgba(255,255,255,.05); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn .arrow { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: rgba(0,0,0,.08); }
.btn-ghost .arrow { background: rgba(255,255,255,.08); }
.btn-icon {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
    border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,.02);
    transition: all .2s;
}
.btn-icon:hover { color: var(--text); border-color: var(--line-3); background: rgba(255,255,255,.06); }

/* ---------- pills / chips ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
    border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2);
    background: rgba(255,255,255,.04); border: 1px solid var(--line);
    transition: all .2s; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--line-2); }
.chip.active { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.chip .plus { opacity: .5; font-weight: 400; }
.chip.active .plus { opacity: .6; }
.tag {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-2); background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.tag-solid { background: #fff; color: #000; border-color: #fff; }
.hashtag { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.hashtag::before { content: "#"; opacity: .6; }

/* ---------- surfaces ---------- */
.card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: transform .4s var(--ease), border-color .3s, box-shadow .4s var(--ease), background .3s;
}
.card-hover:hover, a.card:hover {
    transform: translateY(-4px);
    border-color: var(--line-2);
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03);
    background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
}
.panel {
    position: relative;
    background: linear-gradient(180deg, #121216 0%, #0c0c0f 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: 0 60px 140px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
}
.panel::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.14), transparent 30%, transparent 70%, rgba(255,255,255,.08));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.inset { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius-md); }
.divider { height: 1px; background: var(--line); }

/* legacy compatibility for secondary pages */
.glow-card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-color: var(--line) !important;
    transition: transform .4s var(--ease), border-color .3s, box-shadow .4s var(--ease);
}
.glow-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-2) !important;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.8);
}
.bg-black { background-color: var(--surface) !important; }
input, textarea, select {
    background: var(--surface) !important;
    border-color: var(--line-2) !important;
    color: var(--text);
    border-radius: 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--line-3) !important; outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
input::placeholder, textarea::placeholder { color: var(--text-4); }
.grid-bg {
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 56px 56px;
}
.grid-fade {
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 30%, transparent 100%);
}

/* ---------- search field ---------- */
.search {
    display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
    background: rgba(255,255,255,.04) !important; border: 1px solid var(--line) !important; border-radius: 999px;
    color: var(--text); transition: all .2s;
}
.search:focus-within { border-color: var(--line-3) !important; background: rgba(255,255,255,.06) !important; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.search input { background: transparent !important; border: 0 !important; box-shadow: none !important; flex: 1; font-size: 14px; min-width: 0; }
.search input:focus { box-shadow: none !important; }
.search svg { color: var(--text-3); flex: none; }

/* ---------- article covers ---------- */
.cover {
    position: relative; overflow: hidden; background: var(--surface-3);
    border-radius: inherit;
}
.cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .8s var(--ease), filter .5s;
}
a:hover .cover img, .card-hover:hover .cover img { transform: scale(1.04); }
.cover-fallback {
    position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
    background:
        radial-gradient(90% 90% at 20% 0%, rgba(255,255,255,.14), transparent 55%),
        radial-gradient(80% 80% at 90% 100%, rgba(255,255,255,.08), transparent 55%),
        linear-gradient(160deg, #1d1d24, #0d0d10);
}
.cover-fallback::before {
    content: ""; position: absolute; inset: 0; opacity: .5;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 20%, black 20%, transparent 70%);
    mask-image: radial-gradient(ellipse at 30% 20%, black 20%, transparent 70%);
}
.cover-fallback span {
    position: relative; font-weight: 800; letter-spacing: -.04em; line-height: 1;
    font-size: clamp(40px, 12cqw, 120px);
    background: linear-gradient(180deg, #fff, rgba(255,255,255,.35));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cover-fallback .cf-label {
    position: absolute; left: 14px; bottom: 12px; font-size: 10px; letter-spacing: .18em;
    text-transform: uppercase; color: rgba(255,255,255,.45); background: none; -webkit-text-fill-color: rgba(255,255,255,.45);
    font-weight: 600; line-height: 1; font-family: var(--font-mono);
}
.cover-shade {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.55) 75%, rgba(0,0,0,.85) 100%);
}

/* ---------- glowing orb (hero decoration) ---------- */
.orb-wrap { position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; margin-inline: auto; }
.orb-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.07);
    animation: orb-spin 40s linear infinite;
}
.orb-ring::after {
    content: ""; position: absolute; top: -2px; left: 50%; width: 4px; height: 4px;
    border-radius: 50%; background: #fff; box-shadow: 0 0 12px 3px rgba(255,255,255,.6);
}
.orb-ring.r2 { inset: 9%;  animation-duration: 28s; animation-direction: reverse; border-color: rgba(255,255,255,.1); }
.orb-ring.r3 { inset: 18%; animation-duration: 20s; border-color: rgba(255,255,255,.14); }
.orb {
    position: absolute; inset: 27%; border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #ffffff 0%, #d9d9e2 18%, #7d7d8c 45%, #26262e 75%, #0b0b0e 100%);
    box-shadow:
        0 0 80px 10px rgba(255,255,255,.12),
        0 40px 100px -20px rgba(0,0,0,.9),
        inset 0 -20px 60px rgba(0,0,0,.6);
    animation: orb-float 8s ease-in-out infinite;
}
.orb::after {
    content: ""; position: absolute; inset: -30%; border-radius: 50%; z-index: -1;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
    filter: blur(20px);
}
.orb-shadow {
    position: absolute; left: 20%; right: 20%; bottom: -6%; height: 12%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,.12), transparent 70%);
    filter: blur(10px);
}
@keyframes orb-spin  { to { transform: rotate(360deg); } }
@keyframes orb-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-stagger.visible > * { opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(1) { transition-delay: .00s }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: .07s }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: .14s }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: .21s }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: .28s }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: .35s }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: .42s }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: .49s }
.reveal-stagger.visible > *:nth-child(9) { transition-delay: .56s }

/* hero text entrance */
.hero-in > * { opacity: 0; transform: translateY(16px); animation: hero-in 1s var(--ease) forwards; }
.hero-in > *:nth-child(1) { animation-delay: .05s }
.hero-in > *:nth-child(2) { animation-delay: .15s }
.hero-in > *:nth-child(3) { animation-delay: .25s }
.hero-in > *:nth-child(4) { animation-delay: .35s }
.hero-in > *:nth-child(5) { animation-delay: .45s }
.hero-in > *:nth-child(6) { animation-delay: .55s }
@keyframes hero-in { to { opacity: 1; transform: none; } }

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .3s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .reveal, .reveal-stagger > *, .hero-in > * { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
    .orb, .orb-ring { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- article body (prose) ---------- */
.prose { font-size: 17px; line-height: 1.8; color: var(--text-2); }
.prose p { margin-bottom: 1.35em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose h2 { font-size: 1.55em; font-weight: 700; color: var(--text); margin: 2.2em 0 .8em; line-height: 1.25; }
.prose h2:first-child { margin-top: 0; }
.prose.rtl { font-size: 18px; line-height: 2.05; }
.prose.rtl h2 { line-height: 1.5; }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- misc ---------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hairline { border-top: 1px solid var(--line); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-3); }
.marquee { mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.stat-num { font-weight: 800; letter-spacing: -.04em; font-size: clamp(34px, 4vw, 48px); line-height: 1; }
.toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); opacity: 0;
    background: #fff; color: #000; font-size: 13px; font-weight: 600; padding: 12px 18px; border-radius: 999px;
    transition: all .3s var(--ease); pointer-events: none; z-index: 80; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.mobile-menu { display: none; }
.mobile-menu.open { display: block; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
