/* ================================================================
   SWISS DESIGN — CSS VARIABLES
   ================================================================ */
:root {
    --bg: #ffffff;
    --bg-alt: #f5f5f5;
    --fg: #0a0a0a;
    --fg-sec: #6b6b6b;
    --fg-muted: #999999;
    --accent: #0294f6;
    --border: #e0e0e0;
    --border-strong: #cccccc;
    --card: #ffffff;
    --card-hover: #fafafa;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-alt: #111111;
    --fg: #f0f0f0;
    --fg-sec: #888888;
    --fg-muted: #555555;
    --accent: #0294f6;
    --border: #222222;
    --border-strong: #333333;
    --card: #141414;
    --card-hover: #1a1a1a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--fg);
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    line-height: 1.7;
}

[lang="ar"] body,
[lang="ar"] {
    font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
}

[lang="en"] body,
[lang="en"] {
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ================================================================
   TOP ACCENT BAR
   ================================================================ */
.top-accent-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    z-index: 1001;
}

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
    position: fixed;
    top: 2px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    border-bottom-color: var(--border);
}

.nav-link {
    color: var(--fg-sec);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.4rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

[dir="rtl"] .nav-link::after {
    right: 0;
}

[dir="ltr"] .nav-link::after {
    left: 0;
}

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

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

/* ================================================================
   SECTION TYPOGRAPHY — IMPROVED HIERARCHY
   ================================================================ */
.section-num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.section-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--fg);
}

.section-sub {
    color: var(--fg-sec);
    font-size: 0.95rem;
    margin-top: 0.6rem;
}

.red-line {
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

.red-line.visible {
    width: 60px;
}

/* ================================================================
   CARDS
   ================================================================ */
.swiss-card {
    background: var(--card);
    border: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

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

/* ================================================================
   TAGS
   ================================================================ */
.tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    color: var(--fg-sec);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* ================================================================
   SKILL PILLS
   ================================================================ */
.skill-pill {
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    color: var(--fg-sec);
    transition: all 0.2s ease;
    display: inline-block;
}

.skill-pill:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* ================================================================
   PROJECT ROWS — IMPROVED TITLE SIZE
   ================================================================ */
.proj-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.proj-row:hover {
    background: var(--bg-alt);
}

.proj-row:hover .proj-num {
    color: var(--accent);
}

.proj-row:hover .proj-title {
    color: var(--accent);
}

.proj-row:hover .proj-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

[dir="rtl"] .proj-row:hover .proj-arrow {
    transform: translateX(-4px);
}

/* ================================================================
   TIMELINE (Education & Experience)
   ================================================================ */
.tl-line {
    position: absolute;
    width: 1px;
    background: var(--border);
    top: 0;
    bottom: 0;
}

[dir="rtl"] .tl-line {
    right: 7px;
}

[dir="ltr"] .tl-line {
    left: 7px;
}

.tl-dot {
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    background: var(--bg);
    position: absolute;
    top: 6px;
    z-index: 2;
}

[dir="rtl"] .tl-dot {
    right: 1px;
}

[dir="ltr"] .tl-dot {
    left: 1px;
}

/* Active dot for current roles */
.tl-dot.active {
    background: var(--accent);
}

/* ================================================================
   EXPERIENCE — LARGER TYPOGRAPHY
   ================================================================ */
.exp-role {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--fg);
}

.exp-company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg-sec);
    margin-top: 0.25rem;
}

.exp-year {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
}

.exp-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--fg-muted);
    margin-top: 0.75rem;
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.exp-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.25rem 0.7rem;
}

/* Current badge */
.current-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-inline-start: 0.75rem;
    vertical-align: middle;
}

.current-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

/* ================================================================
   CERTIFICATE ROWS — LARGER NAMES
   ================================================================ */
.cert-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    transition: padding-inline-start 0.2s ease;
}

.cert-row:hover {
    padding-inline-start: 0.5rem;
}

.cert-row:hover .cert-name {
    color: var(--accent);
}

.cert-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg);
    transition: color 0.2s ease;
}

/* ================================================================
   TOOL CARDS — LARGER NAMES
   ================================================================ */
.tool-card {
    border: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--card);
}

.tool-card:hover {
    border-color: var(--accent);
    background: var(--bg-alt);
}

.tool-card:hover .tool-icon {
    color: var(--accent);
}

.tool-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg);
    margin-top: 0.75rem;
}

.tool-desc {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 0.4rem;
    line-height: 1.6;
}

.tool-users {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-top: 0.75rem;
    display: block;
}

/* ================================================================
   TESTIMONIALS — IMPROVED READABILITY
   ================================================================ */
.testi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border);
}

.testi-card {
    background: var(--card);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.3s ease;
    border: 1px solid transparent;
}

.testi-card:hover {
    border-color: var(--accent);
    position: relative;
    z-index: 1;
}

.testi-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 1.25rem;
}

.testi-star {
    color: var(--accent);
}

.testi-star.empty {
    opacity: 0.2;
}

.testi-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--fg-sec);
    flex: 1;
}

.testi-author {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.testi-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--fg);
}

.testi-role {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-top: 0.2rem;
}

/* ================================================================
   TESTING BOX
   ================================================================ */
.testing-box {
    border: 1px solid var(--accent);
    position: relative;
    overflow: hidden;
    background: var(--card);
}

.testing-box::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    border: 40px solid var(--accent);
    opacity: 0.04;
    border-radius: 50%;
}

/* ================================================================
   FORM
   ================================================================ */
.form-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
    color: var(--fg);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-bottom-color: var(--accent);
}

.form-input::placeholder {
    color: var(--fg-muted);
}

.form-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg-muted);
    margin-bottom: 0.3rem;
    display: block;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn-swiss {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.9rem 1.8rem;
    border: 1px solid var(--fg);
    color: var(--fg);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-swiss:hover {
    background: var(--fg);
    color: var(--bg);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.9rem 1.8rem;
    border: 1px solid var(--accent);
    color: #ffffff;
    background: var(--accent);
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.btn-accent:hover {
    opacity: 0.85;
}

/* ================================================================
   SOCIAL BUTTONS
   ================================================================ */
.social-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-sec);
    transition: all 0.2s ease;
}

.social-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ================================================================
   CONTACT INFO — LARGER VALUES
   ================================================================ */
.contact-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--fg-muted);
    display: block;
}

.contact-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
    transition: color 0.2s ease;
}

a:hover .contact-value {
    color: var(--accent);
}

/* ================================================================
   TOAST
   ================================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--fg);
    color: var(--bg);
    padding: 0.8rem 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s ease;
    border-left: 3px solid var(--accent);
    font-family: inherit;
}

[dir="rtl"] .toast {
    border-left: none;
    border-right: 3px solid var(--accent);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ================================================================
   REVEAL ANIMATION
   ================================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.4s; }

/* ================================================================
   MOBILE MENU
   ================================================================ */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

.mobile-menu.open {
    clip-path: inset(0 0 0 0);
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fg);
    transition: color 0.2s ease;
}

.mobile-menu a:hover {
    color: var(--accent);
}

/* ================================================================
   PULSE DOT
   ================================================================ */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.4); }
}

/* ================================================================
   BACK TO TOP
   ================================================================ */
#backToTop {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 36px;
    height: 36px;
    background: var(--fg);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 50;
    cursor: pointer;
    border: none;
}

#backToTop.show {
    opacity: 1;
    transform: translateY(0);
}

#backToTop:hover {
    background: var(--accent);
}

[dir="rtl"] #backToTop {
    left: auto;
    right: 2rem;
}

/* ================================================================
   DIVIDER
   ================================================================ */
.divider {
    height: 1px;
    max-width: 80%;
    margin: 0 auto;
    background: var(--border);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-grid .hero-photo-col {
        order: -1;
    }

    .proj-grid {
        grid-template-columns: 1fr !important;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .knowledge-grid {
        grid-template-columns: 1fr !important;
    }

    .testi-grid {
        grid-template-columns: 1fr !important;
    }

    .exp-role {
        font-size: 1.15rem;
    }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
