/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES (Moroccan Sufi Tijani Green style)
   ========================================================================== */
:root {
    /* Color Palette (Deep Emerald Sufi Green & Warm Parchment Amber) */
    --color-bg: hsl(160, 45%, 5%);             /* Deep Velvet Forest/Emerald Green */
    --color-bg-alt: hsl(160, 40%, 7%);         /* Organic dark green card background */
    --color-surface: rgba(10, 28, 20, 0.65);   /* Velvet Green Glass */
    --color-surface-hover: rgba(18, 46, 34, 0.8);
    --color-border: rgba(212, 163, 89, 0.16);   /* Authentic Moroccan Gold / Brass border */
    --color-border-hover: rgba(212, 163, 89, 0.35);
    
    --color-primary: hsl(145, 60%, 28%);       /* Tijani Sacred Green */
    --color-primary-glow: hsla(145, 60%, 28%, 0.1);
    --color-primary-light: hsl(145, 55%, 45%); /* Soft Emerald */
    --color-secondary: hsl(43, 60%, 88%);      /* Warm Tactile Parchment Cream */
    
    --color-accent-amber: hsl(40, 65%, 55%);   /* Muted Moroccan Gold / Brass */
    --color-accent-green: hsl(145, 60%, 28%);  
    
    --color-text-main: hsl(43, 20%, 86%);      /* Light warm paper text */
    --color-text-muted: hsl(43, 10%, 65%);     /* Muted book-page grey */
    --color-text-dark: hsl(160, 30%, 8%);
    
    /* Typography - Replaced Outfit/Cairo with highly authentic scholarly serifs */
    --font-primary: 'Lora', 'EB Garamond', serif;
    --font-header: 'EB Garamond', 'Playfair Display', serif;
    --font-arabic: 'Amiri', serif;
    --font-code: 'Fira Code', monospace;
    
    /* Layout Constants - Rectangular & Tactile rather than standard round capsules */
    --max-width: 1200px;
    --header-height: 80px;
    --radius-sm: 2px;                          /* Authentic sharp/rectangular style */
    --radius-md: 4px;                          /* Minimal rounding, feels like leather-bound covers */
    --radius-lg: 6px;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(212, 163, 89, 0.04);
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .project-card-title, .cv-name, .cv-section-title, .cv-item-name, .book-title-carousel {
    font-family: var(--font-header);
    font-weight: 500;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-bg-alt);
    border: 2px solid var(--color-bg);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Global Link Styles */
a {
    color: var(--color-accent-amber);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--color-secondary);
}

.text-link {
    color: var(--color-primary-light);
    border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
    padding-bottom: 1px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.text-link:hover {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */
.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--header-height) + 2rem) 1.5rem 4rem 1.5rem;
    position: relative;
    z-index: 2;
}

section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-desc {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin-bottom: 3.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.code-path {
    font-family: var(--font-code);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--color-accent-amber);
}

/* ==========================================================================
   GLOWING BACKGROUND EFFECTS
   ========================================================================== */
.top-glow {
    position: absolute;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 600px;
    background: radial-gradient(circle, hsla(150, 65%, 42%, 0.08) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   NAVIGATION HEADER
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(8, 18, 14, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.logo-accent {
    color: var(--color-accent-amber);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent-amber);
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--color-secondary);
}

.nav-link.active::after {
    width: 100%;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.75rem;
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent-amber);
    color: var(--color-bg);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover {
    background: hsl(43, 85%, 60%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
}

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-secondary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-border-hover);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.icon {
    flex-shrink: 0;
}

.spinning {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    background: rgba(217, 119, 6, 0.1);
    color: var(--color-accent-amber);
    border: 1px solid rgba(217, 119, 6, 0.22);
    margin-bottom: 1.5rem;
}

.badge-amber {
    background: rgba(217, 119, 6, 0.12);
    color: var(--color-accent-amber);
    border: 1px solid rgba(217, 119, 6, 0.25);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.section-hero {
    border-bottom: 1px solid var(--color-border);
    padding-top: 3rem;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
}

.hero-visual-container {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    line-height: 1.7;
}

.hero-metrics {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .project-card-title, .cv-name, .cv-section-title, .cv-item-name, .book-title-carousel {
    font-family: var(--font-header);
    font-weight: 500;
}

.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    outline: 1px solid var(--color-border);
    outline-offset: -4px;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    flex: 1;
    text-align: center;
    transition: var(--transition-smooth);
}

.metric-card-link:hover .metric-card {
    border-color: var(--color-accent-amber);
    outline-color: var(--color-accent-amber);
    background: var(--color-surface-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 750;
    color: var(--color-accent-amber);
    margin-bottom: 0.25rem;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Premium Scriptorium Parchment Card */
.pitch-card-premium {
    background: linear-gradient(135deg, hsl(160, 40%, 6%) 0%, hsl(160, 45%, 4%) 100%);
    border: 1px solid var(--color-border);
    outline: 1px solid var(--color-border);
    outline-offset: -6px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    overflow: hidden;
    width: 100%;
}

.pitch-header {
    background: rgba(8, 18, 14, 0.9);
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.arabic-script-header {
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent-amber);
    letter-spacing: 0.02em;
}

.terminal-title {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.pitch-body.scriptorium-parchment {
    padding: 2rem;
    color: var(--color-text-main);
}

.scriptorium-quote {
    margin-bottom: 1.75rem;
    border-left: 2px solid var(--color-accent-amber);
    padding-left: 1.25rem;
}

.quote-text {
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--color-secondary);
}

.quote-author {
    font-size: 0.85rem;
    color: var(--color-accent-amber);
    font-weight: 600;
    margin-top: 0.5rem;
}

.scriptorium-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
    margin: 1.5rem 0;
    position: relative;
}

.scriptorium-divider::before {
    content: "❖";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: var(--color-accent-amber);
    background-color: hsl(165, 30%, 5%);
    padding: 0 0.5rem;
}

.scriptorium-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.scriptorium-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cell-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-accent-amber);
}

.cell-desc {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.pitch-footer {
    background: rgba(8, 18, 14, 0.9);
    padding: 0.65rem 1.25rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

/* ==========================================================================
   PROJECTS SECTION & HTR SLIDER
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

/* Full-width visual assets */
#project-leibniz {
    grid-column: span 2;
}

.project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    outline: 1px solid var(--color-border);
    outline-offset: -5px;
    border-radius: var(--radius-sm);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.project-card:hover {
    border-color: var(--color-border-hover);
    outline-color: var(--color-border-hover);
    background: var(--color-surface-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.project-tag {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(212, 163, 89, 0.05);
    border: 1px solid var(--color-border);
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--color-accent-amber);
    z-index: 10;
}

.project-tag-accent {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(212, 163, 89, 0.08);
    border: 1px solid var(--color-border);
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--color-accent-amber);
    z-index: 10;
}

.project-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-secondary);
    padding-right: 8rem; /* Avoid overlap with tags */
}

.project-card-desc {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-card-desc-sub {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.project-bullet-list {
    margin-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.project-bullet-list strong {
    color: var(--color-secondary);
}

.project-highlight-box {
    display: flex;
    gap: 1.5rem;
    background: rgba(8, 18, 14, 0.6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.highlight-item {
    flex: 1;
}

.hl-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.hl-value-accent {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent-amber);
}

.hl-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: auto;
    margin-bottom: 1.25rem;
}

.project-tech-stack span {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.project-link-out {
    margin-top: auto;
}

.project-btn-link {
    display: inline-flex;
    color: var(--color-accent-amber);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border-bottom: 1px dashed rgba(217, 119, 6, 0.3);
    padding-bottom: 2px;
}

.project-btn-link:hover {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

/* Leibniz HTR Slider */
.htr-slider-container {
    height: 200px;
    background: hsl(165, 35%, 3%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    user-select: none;
    margin: 2rem 0 0.5rem 0;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.slider-image-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.slider-image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background: hsl(165, 30%, 5%);
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    transition: clip-path 0.05s linear;
}

.manuscript-mockup {
    padding: 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, hsl(38, 20%, 15%) 0%, hsl(165, 35%, 4%) 100%);
    opacity: 0.85;
}

.manuscript-line {
    font-size: 1.75rem;
    color: hsl(43, 70%, 70%);
    font-family: 'Times New Roman', serif;
    font-style: italic;
    letter-spacing: 0.02em;
    filter: blur(0.5px);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 4px rgba(217, 119, 6, 0.3);
}

.manuscript-handwriting {
    font-size: 0.95rem;
    color: hsl(43, 50%, 55%);
    font-style: italic;
    opacity: 0.7;
}

.manuscript-scribbles {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    color: hsl(43, 40%, 45%);
    font-family: serif;
    font-style: italic;
}

.manuscript-mockup-digitized {
    padding: 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, hsl(165, 30%, 8%) 0%, hsl(165, 35%, 4%) 100%);
}

.latex-output {
    font-family: var(--font-code);
    font-size: 1.25rem;
    color: var(--color-accent-amber);
    background: rgba(8, 18, 14, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.digital-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 2px;
    background-color: var(--color-accent-amber);
    z-index: 30;
    cursor: ew-resize;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.handle-line {
    flex: 1;
    width: 2px;
    background: linear-gradient(to bottom, rgba(217,119,6,0.1), var(--color-accent-amber), rgba(217,119,6,0.1));
}

.handle-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-accent-amber);
    border: 2px solid var(--color-bg);
    color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.2);
}

.helper-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   HERITAGE & 3D BOOK SHOWCASE
   ========================================================================== */
.section-heritage {
    background: radial-gradient(circle at 50% 50%, hsla(150, 65%, 42%, 0.04) 0%, rgba(0,0,0,0) 70%);
}

.section-header-centered {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3.5rem auto;
}

.section-header-centered .badge {
    margin-bottom: 1rem;
}

.section-header-centered .section-title {
    margin-bottom: 0.75rem;
}

.section-header-centered .section-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.heritage-body-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.heritage-details-card {
    background: rgba(8, 18, 14, 0.4);
    border: 1px solid var(--color-border);
    outline: 1px solid var(--color-border);
    outline-offset: -5px;
    border-radius: var(--radius-sm);
    padding: 3rem;
    box-shadow: var(--shadow-md), inset 0 1px 1px rgba(255,255,255,0.02);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    width: 100%;
}

.heritage-pitch {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 850px;
    text-align: center;
}

.heritage-subtext {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 850px;
    text-align: center;
}

.interests-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.interests-tags span {
    background: rgba(212, 163, 89, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-accent-amber);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.heritage-shop-link {
    margin-top: 1rem;
}

.shop-btn-link {
    display: inline-flex;
    align-items: center;
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.25);
    color: var(--color-accent-amber);
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.shop-btn-link:hover {
    background: var(--color-accent-amber);
    color: var(--color-bg);
    transform: translateY(-2px);
}

/* Beautiful Interactive 3D Book Layout */
.heritage-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.book-container {
    width: 200px;
    height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-15deg) rotateX(10deg);
    transition: transform 0.5s ease;
}

.book-container:hover {
    transform: rotateY(-5deg) rotateX(5deg) scale(1.05);
}

.book-3d {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
}

.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, hsl(150, 40%, 15%) 0%, hsl(150, 40%, 8%) 100%);
    border: 2px solid hsl(43, 60%, 40%);
    border-radius: 2px 8px 8px 2px;
    z-index: 5;
    transform: translateZ(10px);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-emboss {
    border: 1px solid hsl(43, 50%, 30%);
    height: 100%;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.book-category {
    font-size: 0.65rem;
    font-weight: 700;
    color: hsl(43, 70%, 65%);
    letter-spacing: 0.1em;
}

.book-title {
    font-family: var(--font-arabic);
    font-size: 2.25rem;
    font-weight: 700;
    color: hsl(43, 80%, 70%);
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.book-author {
    font-size: 0.75rem;
    color: hsl(160, 10%, 70%);
    font-style: italic;
}

.book-badge-logo {
    font-weight: 800;
    font-size: 0.85rem;
    color: hsl(43, 80%, 70%);
    border: 2px solid hsl(43, 80%, 70%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.book-spine {
    position: absolute;
    width: 20px;
    height: 100%;
    background: hsl(165, 35%, 4%);
    left: -10px;
    top: 0;
    transform: rotateY(-90deg) translateZ(0px);
    border-radius: 2px 0 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-spine span {
    transform: rotate(90deg);
    white-space: nowrap;
    color: hsl(43, 50%, 50%);
    font-size: 0.65rem;
    font-weight: 600;
}

.book-pages {
    position: absolute;
    width: 190px;
    height: 290px;
    background: #fdf6e2;
    top: 5px;
    left: 5px;
    z-index: 4;
    transform: translateZ(5px);
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.15);
    border-radius: 0 6px 6px 0;
}

.book-caption {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
}

/* ==========================================================================
   STANDARD PRINT-FRIENDLY CV CARD (Aesthetics on screen)
   ========================================================================== */
.section-cv-standard {
    border-bottom: none;
}

.cv-card-standard {
    background-color: #ffffff;
    color: var(--color-text-dark);
    padding: 3.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    outline: 1px solid rgba(0, 0, 0, 0.06);
    outline-offset: -8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-family: 'Lora', 'EB Garamond', serif;
    max-width: 900px;
    margin: 0 auto;
}

/* Screen adjustments to make it look outstanding while being a white card */
.cv-card-standard h2, 
.cv-card-standard h3, 
.cv-card-standard h4, 
.cv-card-standard h5 {
    color: hsl(222, 25%, 15%);
}

.cv-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.cv-header-left {
    flex: 1.2;
}

.cv-header-right {
    flex: 0.8;
    text-align: right;
    font-size: 0.9rem;
    color: hsl(222, 10%, 40%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cv-header-right a {
    color: hsl(222, 10%, 35%);
    text-decoration: none;
}

.cv-header-right a:hover {
    color: var(--color-primary);
}

.cv-name {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.cv-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary) !important;
    margin-bottom: 0.5rem;
}

.cv-tagline {
    font-size: 0.95rem;
    color: hsl(222, 10%, 40%);
}

.cv-section {
    margin-bottom: 2rem;
}

.cv-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid hsl(222, 20%, 85%);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}

.cv-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: hsl(222, 10%, 30%);
}

.cv-two-columns {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 2.5rem;
}

.cv-item {
    margin-bottom: 1.5rem;
}

.cv-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.cv-item-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.cv-item-inst {
    font-size: 0.9rem;
    color: hsl(222, 10%, 35%);
}

.cv-item-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cv-item-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: hsl(222, 10%, 30%);
    margin-bottom: 0.35rem;
}

.cv-item-subdesc {
    font-size: 0.85rem;
    background-color: hsl(210, 30%, 97%);
    border-left: 2.5px solid var(--color-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
    margin-top: 0.5rem;
    color: hsl(222, 10%, 30%);
}

.cv-bullet-list {
    margin-left: 1.25rem;
    font-size: 0.9rem;
    color: hsl(222, 10%, 30%);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cv-bullet-list a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.cv-bullet-list a:hover {
    text-decoration: underline;
}

.cv-skill-cat {
    font-size: 0.9rem;
    font-weight: 700;
    color: hsl(222, 10%, 35%);
    margin: 1rem 0 0.5rem 0;
}

.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cv-tags span {
    background-color: hsl(210, 30%, 94%);
    color: hsl(222, 20%, 25%);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.cv-tags-secondary span {
    background-color: hsl(38, 60%, 94%);
    color: hsl(38, 80%, 25%);
}

.cv-lang-list {
    list-style: none;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cv-small-text {
    font-size: 0.75rem;
    color: hsl(222, 10%, 50%);
}

.cv-print-footer {
    margin-top: 2rem;
    border-top: 1px solid hsl(222, 20%, 90%);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* CV Actions Container */
.cv-print-action-container {
    max-width: 900px;
    margin: 2rem auto 0 auto;
    text-align: center;
}

.print-instruction-text {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   GLOBAL FOOTER
   ========================================================================== */
.global-footer {
    border-top: 1px solid var(--color-border);
    background: hsl(165, 35%, 4%);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

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

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--color-primary-light);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-visual-container {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }
    
    .heritage-body-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .nav-menu {
        display: none; /* Mobile simplification */
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    #project-leibniz {
        grid-column: span 1;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-metrics {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cv-card-standard {
        padding: 1.5rem;
    }
    
    .cv-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cv-header-right {
        text-align: left;
    }
    
    .cv-two-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* ==========================================================================
   PROJECTS TABS & GENERAL SLIDER STYLES
   ========================================================================== */
.projects-tabs-container {
    margin-top: 2rem;
}

.tabs-buttons-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.25rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.75rem 2.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-icon-svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--color-secondary);
}

.tab-btn:hover .tab-icon-svg {
    color: var(--color-secondary);
}

.tab-btn.active {
    color: var(--color-accent-amber);
    background: rgba(217, 119, 6, 0.05);
}

.tab-btn.active .tab-icon-svg {
    color: var(--color-accent-amber);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1.35rem;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-accent-amber);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

#tab-saas.tab-content.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Image alignment & sample display inside sliders */
.slider-manuscript-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #060e0a;
    padding: 0.75rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
}

.arabic-output {
    font-size: 1.45rem;
    color: var(--color-secondary);
    background: rgba(8, 18, 14, 0.855);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
    text-align: right;
    font-family: var(--font-arabic);
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    letter-spacing: normal;
}

.project-numbered-list {
    margin-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.project-numbered-list strong {
    color: var(--color-secondary);
}

.project-sub-section {
    margin: 1.5rem 0;
}

.sub-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 0.75rem;
}

.leibniz-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.88rem;
    color: var(--color-text-main);
    background: rgba(8, 18, 14, 0.4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.leibniz-results-table th, .leibniz-results-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.leibniz-results-table th {
    background: rgba(8, 18, 14, 0.8);
    color: var(--color-secondary);
    font-weight: 600;
    text-align: left;
}

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

.leibniz-results-table tr.highlight-row {
    background: rgba(217, 119, 6, 0.08);
    color: var(--color-accent-amber);
}

.leibniz-results-table tr.highlight-row-accent {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-primary-light);
}

.text-right {
    text-align: right;
}

.project-image-container {
    margin: 1.5rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(8, 18, 14, 0.4);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.project-embed-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-img-caption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
}

.project-image-container-grid {
    margin: 1.5rem 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

.project-image-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(8, 18, 14, 0.4);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .project-image-container-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.htr-stats-container {
    background: rgba(8, 18, 14, 0.4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
}

.htr-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 0.65rem;
    margin-bottom: 1rem;
}

.stats-total-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.stats-total-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary-light);
}

.htr-stats-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.htr-stats-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent-amber);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.stats-list strong {
    color: var(--color-secondary);
}

/* ==========================================================================
   BOOK CAROUSEL STYLES
   ========================================================================== */
.book-carousel-container {
    width: 100%;
    background: linear-gradient(135deg, hsl(165, 30%, 5%) 0%, hsl(165, 35%, 3%) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    overflow: hidden;
    position: relative;
    padding: 2.25rem;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 300%; /* 3 slides */
}

.carousel-slide {
    width: 33.333%;
    flex-shrink: 0;
    opacity: 0.2;
    transition: opacity 0.5s ease;
    padding: 0 0.5rem;
}

.carousel-slide.active-slide {
    opacity: 1;
}

.book-card-carousel {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1.5rem;
    align-items: center;
}

.book-cover-wrapper {
    width: 110px;
    height: 165px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
    border: 1.5px solid hsl(43, 60%, 40%);
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-details-carousel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-title-carousel {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent-amber);
}

.book-desc-carousel {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.carousel-btn {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-accent-amber);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.carousel-btn:hover {
    background: var(--color-accent-amber);
    color: var(--color-bg);
    transform: scale(1.05);
}

.carousel-indicator {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--color-secondary);
    font-weight: 500;
}

.secondary-shop-link {
    background: transparent !important;
    border-color: var(--color-border) !important;
    color: var(--color-secondary) !important;
}

.secondary-shop-link:hover {
    border-color: var(--color-border-hover) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--color-secondary) !important;
}

@media (max-width: 1024px) {
    .projects-pillars-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 600px) {
    .book-card-carousel {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    
    .htr-stats-subgrid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.paper-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: var(--transition-smooth);
}

.paper-link:hover {
    color: var(--color-accent-amber);
    text-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
}

/* Authentic Lettrine / Dropcap Style */
.dropcap::first-letter {
    font-family: var(--font-header);
    font-size: 3.2em;
    float: left;
    margin: 0.05em 0.1em 0 0;
    line-height: 0.85;
    color: var(--color-accent-amber);
    font-weight: bold;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   @media PRINT - HIGH FIDELITY PDF ENGINE
   ========================================================================== */
@media print {
    /* Hide ALL interactive, online, glowing components completely */
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important; /* Standard printable point size */
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .top-glow,
    .main-header,
    .section-hero,
    .section-projects,
    .section-heritage,
    .cv-print-action-container,
    .global-footer {
        display: none !important;
    }
    
    /* Reveal and expand ONLY the print area */
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .section-cv-standard {
        padding: 0 !important;
        border: none !important;
    }
    
    .cv-card-standard {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    /* Ensure high contrast for print */
    .cv-card-standard h2, 
    .cv-card-standard h3, 
    .cv-card-standard h4, 
    .cv-card-standard h5 {
        color: #000000 !important;
    }
    
    .cv-title {
        color: hsl(150, 65%, 35%) !important; /* Rich print Sufi green */
    }
    
    .cv-item-date {
        color: hsl(150, 65%, 35%) !important;
    }
    
    .cv-header {
        border-bottom: 2px solid hsl(150, 65%, 35%) !important;
        padding-bottom: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .cv-item-subdesc {
        background-color: #f3f4f6 !important;
        border-left: 3px solid hsl(150, 65%, 35%) !important;
        padding: 6px 10px !important;
    }
    
    .cv-tags span {
        background-color: #e5e7eb !important;
        color: #1f2937 !important;
        border: 1px solid #d1d5db !important;
        padding: 2px 6px !important;
        font-size: 7.5pt !important;
    }
    
    .cv-tags-secondary span {
        background-color: #fef3c7 !important;
        color: #78350f !important;
        border: 1px solid #fde68a !important;
    }
    
    /* Keep 2-column structure cleanly */
    .cv-two-columns {
        display: grid !important;
        grid-template-columns: 1.3fr 0.7fr !important;
        gap: 20px !important;
    }
    
    /* Page Break Safety */
    .cv-section {
        page-break-inside: avoid !important;
    }
    
    .cv-item {
        page-break-inside: avoid !important;
    }
    
    @page {
        size: A4;
        margin: 1.2cm; /* Neat margins for 2-page print layout */
    }
}

/* ==========================================================================
   mybahr Project Styles
   ========================================================================== */
.mybahr-pipeline-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.pipeline-step {
    background: rgba(8, 18, 14, 0.4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.step-badge {
    background: var(--color-primary-light);
    color: var(--color-bg-dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.step-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 992px) {
    .mybahr-pipeline-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .mybahr-pipeline-container {
        grid-template-columns: 1fr;
    }
}

.mybahr-packages-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.mybahr-packages-table th, 
.mybahr-packages-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.mybahr-packages-table th {
    font-weight: 600;
    color: var(--color-secondary);
    border-bottom: 2px solid var(--color-border);
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

.mybahr-packages-table td code {
    color: var(--color-accent-amber);
    background: rgba(212, 163, 89, 0.05);
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    border: 1px solid rgba(212, 163, 89, 0.15);
}

.text-success {
    color: var(--color-primary-light) !important;
    font-weight: 500;
}

.text-warning {
    color: var(--color-accent-amber) !important;
    font-weight: 500;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}
