@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@800&display=swap');

:root {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg-base: #eef4f8;
    --bg-panel: rgba(255, 255, 255, 0.78);
    --bg-panel-solid: #ffffff;
    --text-primary: #172033;
    --text-secondary: #52647a;
    --text-muted: #687b91;
}

.kernel-controls {
    display: flex;
    align-items: center;
}

.kernel-controls {
    gap: 0.55rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kernel-control,
.kernel-search-head button {
    appearance: none;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 0.35rem;
    background: rgba(0, 240, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    padding: 0.42rem 0.55rem;
    transition: 0.2s ease;
}

.kernel-control:hover,
.kernel-control:focus-visible {
    border-color: #00f0ff;
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.18);
}

body[data-language="ar"] .kernel-control,
body[data-language="ar"] .kernel-search-head,
body[data-language="ar"] .kernel-search-head button,
body[data-language="ar"] .kernel-search-panel input,
body[data-language="ar"] .kernel-search-results a {
    font-family: "IBM Plex Sans Arabic", "Rajdhani", sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.kernel-search-dialog {
    width: min(42rem, calc(100% - 2rem));
    padding: 0;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 1rem;
    background: #0e121a;
    color: #e2e8f0;
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.16);
}

.kernel-search-dialog::backdrop {
    background: rgba(3, 5, 8, 0.78);
    backdrop-filter: blur(6px);
}

.kernel-search-panel {
    padding: 1.25rem;
}

.kernel-search-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #00f0ff;
    font-family: "JetBrains Mono", monospace;
    text-transform: uppercase;
}

.kernel-search-panel input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    padding: 0.9rem 1rem;
}

.kernel-search-panel input:focus {
    border-color: #00f0ff;
}

.kernel-search-results {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.kernel-search-results a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    padding: 0.8rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
}

.kernel-search-results a:hover {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.06);
}

.kernel-search-results span {
    color: #94a3b8;
    font-size: 0.78rem;
}

.kernel-desktop-links a:not(:last-child)::after {
    content: '\00B7';
    color: #94a3b8;
    opacity: 0.65;
    margin-inline-start: 0.85rem;
    text-shadow: none;
}

body[data-language="ar"] .kernel-desktop-links a,
body[data-language="ar"] #mobile-navigation a {
    font-family: "IBM Plex Sans Arabic", "Rajdhani", sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.knowledge-domain-card {
    cursor: pointer;
    outline: none;
}

[data-domain-content][hidden] {
    display: none !important;
}

.knowledge-domain-card[aria-pressed="true"] {
    border-color: rgba(0, 240, 255, 0.5) !important;
    box-shadow: 0 0 28px rgba(0, 240, 255, 0.12);
}

.knowledge-domain-card.hover-amber[aria-pressed="true"] {
    border-color: rgba(255, 159, 0, 0.55) !important;
    box-shadow: 0 0 28px rgba(255, 159, 0, 0.12);
}

.knowledge-domain-card:focus-visible {
    box-shadow: 0 0 0 2px #06080d, 0 0 0 4px #00f0ff;
}

.professional-footer {
    position: relative;
    z-index: 10;
    margin-top: auto;
    border-top: 1px solid rgba(0, 240, 255, 0.16);
    background: rgba(5, 8, 14, 0.92);
    backdrop-filter: blur(18px);
}

.professional-footer-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 1.8fr) repeat(3, minmax(9rem, 1fr));
    gap: 3rem;
    width: min(80rem, calc(100% - 3rem));
    margin: 0 auto;
    padding: 3.5rem 0 2.75rem;
}

.footer-brand {
    max-width: 24rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #e2e8f0;
    text-decoration: none;
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 0.08em;
}

.footer-logo span {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid #00f0ff;
    border-radius: 0.35rem;
    color: #00f0ff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.16);
}

.footer-brand p,
.footer-column span {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.75;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-column h2 {
    margin: 0 0 0.35rem;
    color: #00f0ff;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer-column a {
    color: #94a3b8;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: #e2e8f0;
}

body[data-language="ar"] .footer-brand p,
body[data-language="ar"] .footer-column h2,
body[data-language="ar"] .footer-column a,
body[data-language="ar"] .footer-column span,
body[data-language="ar"] .professional-footer-bottom {
    font-family: "IBM Plex Sans Arabic", "Rajdhani", sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.professional-footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: min(80rem, calc(100% - 3rem));
    margin: 0 auto;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #64748b;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.policy-main {
    width: min(68rem, calc(100% - 2rem));
    margin: 0 auto;
    padding: 9rem 0 6rem;
}

.policy-hero,
.policy-section,
.policy-use-card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(12, 16, 28, 0.68);
    backdrop-filter: blur(16px);
}

.policy-hero {
    margin-bottom: 2rem;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 1.5rem;
}

.policy-kicker {
    color: #00f0ff;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.policy-hero h1 {
    margin: 1rem 0;
    color: #f8fafc;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1.02;
}

.policy-hero p,
.policy-section p,
.policy-section li {
    color: #94a3b8;
    line-height: 1.85;
}

.policy-sections {
    display: grid;
    gap: 1.25rem;
}

.policy-section {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 1rem;
}

.policy-section h2 {
    margin: 0 0 1rem;
    color: #f8fafc;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.55rem;
}

.policy-section a {
    color: #00f0ff;
}

.policy-use-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.policy-use-card {
    padding: 1.5rem;
    border-radius: 0.8rem;
}

.policy-use-card.allowed {
    border-color: rgba(0, 240, 255, 0.28);
}

.policy-use-card.prohibited {
    border-color: rgba(255, 85, 105, 0.3);
}

.policy-use-card h3 {
    color: #f8fafc;
}

.policy-use-card li + li {
    margin-top: 0.55rem;
}

[dir="rtl"] body {
    font-family: "Inter", sans-serif;
}

[dir="rtl"] .kernel-controls,
[dir="rtl"] .font-mono {
    letter-spacing: 0;
}

[dir="rtl"] .timeline-line {
    left: auto !important;
    right: 2.5rem;
}

html[data-theme="light"] body {
    background-color: #eef1f6 !important;
    color: #0d1829 !important;
}

html[data-theme="light"] body::before,
html[data-theme="light"] .bg-grid {
    opacity: 0.08;
}

html[data-theme="light"] .glass-panel,
html[data-theme="light"] .kernel-search-dialog,
html[data-theme="light"] .policy-hero,
html[data-theme="light"] .policy-section,
html[data-theme="light"] .policy-use-card,
html[data-theme="light"] .professional-footer {
    background: #ffffff !important;
    border-color: #c8d0dc !important;
    box-shadow: 0 18px 45px rgba(13, 24, 41, 0.06) !important;
}

html[data-theme="light"] .text-white,
html[data-theme="light"] .text-slate-200,
html[data-theme="light"] .text-slate-300,
html[data-theme="light"] .kernel-search-results a,
html[data-theme="light"] .brand-name {
    color: #0d1829 !important;
}

html[data-theme="light"] .footer-logo,
html[data-theme="light"] .policy-hero h1,
html[data-theme="light"] .policy-section h2,
html[data-theme="light"] .policy-use-card h3 {
    color: #0d1829 !important;
}

html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500,
html[data-theme="light"] .kernel-search-results span {
    color: #4a6080 !important;
}

html[data-theme="light"] .bg-base,
html[data-theme="light"] .bg-base\/50,
html[data-theme="light"] .bg-base\/80 {
    background-color: rgba(238, 241, 246, 0.92) !important;
}

html[data-theme="light"] .main-interface {
    --bg-base: #eef1f6;
    --bg-panel: #ffffff;
    --bg-panel-solid: #ffffff;
    --text-primary: #0d1829;
    --text-secondary: #4a6080;
    --text-muted: #4a6080;
}

html[data-theme="light"] .kernel-control,
html[data-theme="light"] .kernel-search-head button {
    background: rgba(238, 241, 246, 0.06);
    border-color: rgba(238, 241, 246, 0.22);
    color: #eef1f6;
    box-shadow: none;
}

html[data-theme="light"] .kernel-control:hover,
html[data-theme="light"] .kernel-control:focus-visible,
html[data-theme="light"] .kernel-search-head button:hover,
html[data-theme="light"] .kernel-search-head button:focus-visible {
    border-color: rgba(0, 201, 177, 0.42);
    color: #00c9b1;
    background: rgba(0, 201, 177, 0.08);
    box-shadow: none;
}

html[data-theme="light"] .kernel-search-dialog {
    color: #0d1829;
    box-shadow: 0 26px 70px rgba(13, 24, 41, 0.12) !important;
}

html[data-theme="light"] .kernel-search-panel .kernel-search-head button {
    background: #f1f5f9;
    border-color: #c8d0dc;
    color: #0d1829;
}

html[data-theme="light"] .kernel-search-panel .kernel-search-head button:hover,
html[data-theme="light"] .kernel-search-panel .kernel-search-head button:focus-visible {
    border-color: rgba(0, 201, 177, 0.42);
    color: #002e28;
    background: rgba(0, 201, 177, 0.10);
}

html[data-theme="light"] .kernel-search-dialog::backdrop {
    background: rgba(241, 245, 249, 0.72);
}

html[data-theme="light"] .kernel-search-panel input {
    background: #f1f5f9;
    border-color: #c8d0dc;
    color: #0d1829;
}

html[data-theme="light"] .kernel-search-panel input:focus {
    border-color: rgba(0, 201, 177, 0.48);
}

html[data-theme="light"] .kernel-search-results a {
    background: #ffffff;
    border-color: #c8d0dc;
}

html[data-theme="light"] .kernel-search-results a:hover {
    border-color: rgba(0, 201, 177, 0.42);
    background: #f8fbfc;
}

html[data-theme="light"] .professional-footer {
    background: #ffffff !important;
    border-top-color: #c8d0dc;
}

html[data-theme="light"] .footer-logo span {
    border-color: rgba(0, 201, 177, 0.42);
    color: #002e28;
    background: #00c9b1;
    box-shadow: none;
}

html[data-theme="light"] .footer-column h2,
html[data-theme="light"] .policy-kicker,
html[data-theme="light"] .policy-section a {
    color: #008f7f;
}

@media (max-width: 1100px) {
    .home-site-header {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .home-site-header .kernel-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .kernel-controls {
        flex-wrap: wrap;
    }

}

@media (max-width: 850px) {
    .professional-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .professional-footer-bottom,
    .policy-use-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .professional-footer-grid {
        grid-template-columns: 1fr;
    }
}
