/* ==========================================================================
   Sentinel CSS Stylesheet (Dual English LTR & Arabic RTL Version)
   Theme: Premium Utilitarian Minimalism & Editorial UI
   Aesthetic: Multi-lingual spacing, typography, and alignments
   ========================================================================== */

/* --- Custom Variables & Tokens --- */
:root {
    --bg-base: #FBFBFA;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F7F6F3;
    
    --color-text-primary: #111111;
    --color-text-secondary: #2F3437;
    --color-text-muted: #6E6E73;
    
    --color-border: #EAEAEA;
    --color-border-hover: #D6D6D6;
    
    /* English Typography */
    --font-sans-en: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-serif-en: 'Instrument Serif', 'Newsreader', 'Playfair Display', Georgia, serif;
    
    /* Arabic Typography */
    --font-sans-ar: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif-ar: 'Amiri', serif;
    
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
    
    --transition-clean: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Global Reset & Base Setup --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-base);
    color: var(--color-text-primary);
    font-family: var(--font-sans-en);
    font-size: 16.5px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100dvh;
    line-height: 1.625;
    direction: ltr;
    text-align: left;
}

/* --- RTL Arabic Override --- */
html[dir="rtl"] {
    font-family: var(--font-sans-ar);
    font-size: 16px;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    line-height: 1.7;
}

/* --- Layout Grid Container (Reading Constraint) --- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1 {
    font-family: var(--font-serif-en);
    font-weight: 400;
    font-size: 3.5rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

html[dir="rtl"] h1 {
    font-family: var(--font-serif-ar);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

h2 {
    font-family: var(--font-serif-en);
    font-weight: 400;
    font-size: 2.25rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    margin-top: 4rem;
    margin-bottom: 1.25rem;
}

html[dir="rtl"] h2 {
    font-family: var(--font-serif-ar);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
}

h3 {
    font-family: var(--font-sans-en);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

html[dir="rtl"] h3 {
    font-family: var(--font-sans-ar);
    font-weight: 600;
}

p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

html[dir="rtl"] p {
    font-size: 0.95rem;
    text-align: justify;
}

.text-lead {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    font-family: var(--font-serif-en);
    margin-bottom: 2.5rem;
}

html[dir="rtl"] .text-lead {
    font-family: var(--font-serif-ar);
    line-height: 1.6;
}

.text-muted {
    color: var(--color-text-muted);
}

.font-mono {
    font-family: var(--font-mono);
}

/* --- Inline Code & Block Quotes --- */
code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    direction: ltr;
    display: inline-block;
}

pre {
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 1.5rem 0 2.5rem 0;
    direction: ltr;
    text-align: left;
}

blockquote {
    border-left: 2px solid var(--color-text-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-serif-en);
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

html[dir="rtl"] blockquote {
    border-right: 3px solid var(--color-text-primary);
    border-left: none;
    padding-right: 1.5rem;
    padding-left: 0;
    font-family: var(--font-serif-ar);
    font-size: 1.3rem;
    line-height: 1.5;
}

/* --- Eyebrow Badge Tag --- */
.eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

html[dir="rtl"] .eyebrow {
    letter-spacing: 0.05em;
}

/* --- Buttons & CTAs --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-clean);
}

.btn-primary {
    background: #111111;
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border: 1px solid #111111;
}

.btn-primary:hover {
    background: #333333;
    border-color: #333333;
}

.btn-secondary {
    background: #ffffff;
    color: var(--color-text-primary);
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--bg-base);
    border-color: var(--color-border-hover);
}

.btn-icon {
    font-size: 0.8rem;
}

.btn:hover .btn-icon {
    transform: translateX(2px);
}

html[dir="rtl"] .btn:hover .btn-icon {
    transform: translateX(-2px); /* Mirror button animation in RTL */
}

/* --- Minimal Navigation --- */
.nav-bar {
    border-bottom: 1px solid var(--color-border);
    background: rgba(251, 251, 250, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text-primary);
}

.logo-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-clean);
}

.nav-link:hover {
    color: var(--color-text-primary);
}

.lang-switch {
    font-weight: 600;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg-surface);
    text-decoration: none;
    transition: var(--transition-clean);
}

.lang-switch:hover {
    background: var(--bg-surface-alt);
    border-color: var(--color-border-hover);
}

/* --- Hero & Sections --- */
.hero-section {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
}

.section {
    padding: 4rem 0;
}

/* --- Bento Grid / Cards Layout --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    width: 100%;
    text-align: left;
}

html[dir="rtl"] .bento-grid {
    text-align: right;
}

.col-span-4 { grid-column: span 4; }

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-crisp);
    padding: 2rem;
    transition: var(--transition-clean);
}

.bento-card:hover {
    border-color: var(--color-border-hover);
}

.bento-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.bento-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

html[dir="rtl"] .bento-desc {
    line-height: 1.6;
}

.inline-pre {
    background: var(--bg-surface-alt);
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    width: 100%;
    margin-top: 1rem;
    color: var(--color-text-primary);
    direction: ltr;
    text-align: left;
}

/* --- Technical Specifications Table --- */
.spec-table-wrapper {
    margin: 2rem 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--bg-surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
    min-width: 500px;
}

html[dir="rtl"] .spec-table {
    text-align: right;
    font-size: 0.8rem;
}

.spec-table th, .spec-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.spec-table th {
    background: var(--bg-base);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--color-text-muted);
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* --- Scroll Fade Entry Animation (Statically Visible) --- */
.scroll-fade {
    opacity: 1;
    transform: none;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--color-border);
    background: var(--bg-surface);
    padding: 3rem 0;
    margin-top: 6rem;
}

.footer-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition-clean);
}

.footer-link:hover {
    color: var(--color-text-primary);
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    html[dir="rtl"] {
        font-size: 15px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding-top: 4rem;
    }
    
    .section {
        padding: 3rem 0;
    }

    .nav-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.25rem;
        gap: 1.25rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .col-span-4 {
        grid-column: span 12;
    }

    .footer-wrapper {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.1rem;
    }

    pre {
        padding: 1rem;
        font-size: 0.725rem;
    }

    .spec-table th, .spec-table td {
        padding: 0.75rem 1rem;
    }
}
