/* custom.css — theme tokens, visual refresh, language switcher, RTL overrides.
   Loaded after main.css (generated bundle) so it can win without editing it. */

/* ============ 1. Design tokens ============ */
:root {
    --bg: #0b0f19;
    --bg-alt: #0f1524;
    --surface: #131a2a;
    --surface-2: #182036;
    --border: rgba(245, 166, 35, 0.16);
    --text: #e7ebf3;
    --text-muted: #94a1b8;
    --accent: #f5a623;
    --accent-hover: #ffbb47;
    --accent-muted: rgba(245, 166, 35, 0.14);
    --radius: 1rem;
    --shadow: 0 1.6rem 3.6rem rgba(0, 0, 0, 0.35);
    --font-heading: "Sora", "SF Pro Display", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============ 2. Base overrides ============ */
body {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6,
.hero-text-wrapper h1,
.hero-text-wrapper h3,
.header .inner h3 {
    font-family: var(--font-heading);
}

.hero-wrapper {
    background: transparent !important;
}

.hero-text-wrapper h1 {
    color: var(--text) !important;
    letter-spacing: -0.02em;
}

.hero-text-wrapper h3 {
    color: var(--accent) !important;
    letter-spacing: 0.04em;
}

.hero-text-wrapper .hi,
.hero-text-wrapper .info {
    color: var(--text-muted) !important;
}

/* the bundle clips this wrapper (overflow:hidden) which cuts off the CTA */
.hero-text-wrapper {
    overflow: visible !important;
}
.hero-text-wrapper a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--accent) !important;
    color: #17110a !important;
    box-shadow: 0 1.2rem 2.4rem rgba(245, 166, 35, 0.25) !important;
}
.hero-text-wrapper a:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-3px);
    box-shadow: 0 1.6rem 3.2rem rgba(245, 166, 35, 0.4) !important;
}

.header .inner h3 {
    color: var(--text) !important;
    letter-spacing: -0.01em;
}

.line,
.line1,
.line3 {
    background: var(--accent) !important;
}

.layer {
    background: var(--accent) !important;
    opacity: 0.06 !important;
    filter: blur(4rem);
}

.random-moving-divs > div {
    background: var(--accent) !important;
    opacity: 0.05 !important;
    filter: blur(6rem);
}

/* nav */
.navbar,
.mobile-nav {
    background: rgba(11, 15, 25, 0.85) !important;
    backdrop-filter: blur(12px);
}
/* the sticky plugin sets a fixed pixel width measured at load — keep the bar full-width */
.main-nav {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}
.nav-link {
    color: var(--text) !important;
    font-family: var(--font-body);
}
.nav-link.active,
.nav-link:hover {
    color: var(--accent) !important;
}
/* the bundle styles the last nav item as a mint pill (was "Contact Me",
   now the language dropdown sits there) — neutralize it */
.nav-item:last-of-type,
.mobile-nav .nav-list-item:last-of-type {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
a.case-studies {
    color: var(--accent) !important;
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 0.6rem 1.6rem !important;
}
a.case-studies:hover {
    background: var(--accent) !important;
    color: #17110a !important;
}

/* section rhythm: the bundle uses 20–25rem gaps, far too airy */
.about-section,
.workflow-section {
    margin-bottom: 12rem !important;
}
.contact-section {
    margin-bottom: 10rem !important;
}
.header .inner span:first-of-type {
    color: var(--accent) !important;
}

/* hero: ambient glow behind the portrait */
.hero-image-wrapper {
    position: relative;
}
.hero-image-wrapper::before {
    content: "";
    position: absolute;
    inset: -12%;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.16), transparent 65%);
    z-index: -1;
}

/* ============ 3. About ============ */
.about-text-div .text {
    border-left: 2px solid var(--accent-muted);
    padding-left: 2rem;
}
[dir="rtl"] .about-text-div .text {
    border-left: none;
    border-right: 2px solid var(--accent-muted);
    padding-left: 0;
    padding-right: 2rem;
}
.about-text-div .text p {
    color: var(--text-muted) !important;
}
.about-text-div .text em {
    color: var(--accent);
    font-style: normal;
}
/* mint L-frame around the photo -> amber */
.about-section .image-div:after {
    border-top-color: var(--accent) !important;
    border-left-color: var(--accent) !important;
}
/* "See more" mint pill -> amber outline */
.about-section .about-text-div a {
    background: transparent !important;
    border: 1px solid var(--accent);
    box-shadow: none !important;
}
.about-section .about-text-div a span {
    color: var(--accent);
}
.about-section .about-text-div a:hover {
    background: var(--accent) !important;
}
.about-section .about-text-div a:hover span {
    color: #17110a;
}

/* ============ 4. Experience timeline ============ */
.experience-section {
    max-width: 90rem;
    margin: 0 auto 12rem;
}
.timeline {
    position: relative;
    margin-top: 4rem;
    padding-left: 3rem;
}
[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 3rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 0.6rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: linear-gradient(var(--accent), transparent);
}
[dir="rtl"] .timeline::before {
    left: auto;
    right: 0.6rem;
}
.timeline-item {
    position: relative;
    padding-bottom: 3.6rem;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -3rem;
    top: 0.3rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}
[dir="rtl"] .timeline-item::before {
    left: auto;
    right: -3rem;
}
.timeline-item .period {
    display: inline-block;
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.timeline-item .role {
    font-family: var(--font-heading);
    color: var(--text);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
}
.timeline-item .company {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin: 0 0 0.8rem;
}
.timeline-item .desc {
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1.6;
    max-width: 60rem;
}
/* ============ 6. Work flow (numbered connected timeline) ============ */
.cards-wrapper {
    counter-reset: flow-step;
    position: relative;
}
.cards-wrapper .card {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    box-shadow: var(--shadow) !important;
    border-radius: var(--radius) !important;
    position: relative;
}
.cards-wrapper .card::after {
    counter-increment: flow-step;
    content: counter(flow-step);
    position: absolute;
    top: -1rem;
    right: -1rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: var(--accent);
    color: #17110a;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
[dir="rtl"] .cards-wrapper .card::after {
    right: auto;
    left: -1rem;
}
.cards-wrapper .card h6,
.cards-wrapper .card p {
    color: var(--text) !important;
}
.cards-wrapper .card p {
    color: var(--text-muted) !important;
}
/* the bundle turns cards mint on hover — keep them on-theme instead */
.workflow-section .cards-wrapper .card:hover {
    background: var(--surface-2) !important;
}

/* ============ 7. Contact ============ */
.contact-form input,
.contact-form textarea {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}
.contact-image-div {
    background: var(--accent-muted) !important;
    border: 1px solid var(--border);
    color: var(--accent);
}
.contact-image-div svg {
    width: 2.2rem;
    height: 2.2rem;
}
.contact-info a {
    color: var(--text) !important;
}
.contact-form input.send {
    background: var(--accent) !important;
    color: #17110a !important;
    border: none !important;
    font-weight: 600;
    cursor: pointer;
}
.contact-form input.send:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px);
}

/* ============ 8. Footer ============ */
footer {
    background: var(--bg-alt) !important;
    color: var(--text-muted) !important;
}

/* ============ 9. Language switcher ============ */
.lang-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 1.5rem;
}
[dir="rtl"] .lang-dropdown {
    margin-left: 0;
    margin-right: 1.5rem;
}
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.lang-toggle:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
}
.lang-toggle .lang-caret {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}
.lang-dropdown.open .lang-toggle .lang-caret {
    transform: rotate(180deg);
}
.lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 9rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    box-shadow: var(--shadow);
    padding: 0.4rem;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1000;
}
[dir="rtl"] .lang-menu {
    left: auto;
    right: 0;
}
.lang-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-menu li {
    list-style: none;
}
.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.7rem;
    border-radius: 0.4rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}
.lang-option:hover,
.lang-option:focus {
    background: var(--accent-muted);
    color: var(--text);
    text-decoration: none;
}
.lang-option.active {
    color: var(--accent);
    font-weight: 600;
}
.mobile-nav .lang-dropdown {
    margin: 1rem 0 0;
    display: block;
}
.mobile-nav .lang-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    margin-top: 0.5rem;
}
.mobile-nav .lang-dropdown.open .lang-menu {
    display: block;
}

/* ============ 10. Visual polish (hover/transition/icon badges) ============ */
a,
.card,
.contact-info,
.lang-toggle,
.lang-option {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 1.6rem 3.6rem rgba(0, 0, 0, 0.45) !important;
}

/* workflow icons are colorful SVG art — show them plainly, no badge disc */
.cards-wrapper .card img {
    width: 3.2rem !important;
    height: 3.2rem !important;
    object-fit: contain;
    transition: transform 0.25s ease;
}
.card:hover > img {
    transform: scale(1.12);
}

.contact-form input,
.contact-form textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-muted);
    outline: none;
}

.contact-info:hover {
    transform: translateX(4px);
}
[dir="rtl"] .contact-info:hover {
    transform: translateX(-4px);
}

/* ============ 11. Animations ============ */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}
@keyframes glow-pulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* hero entrance — keyframes win over the inline opacity/transform styles */
.hero-text-wrapper .hi   { animation: rise-in 0.7s ease backwards 0.05s; }
.hero-text-wrapper h1    { animation: rise-in 0.7s ease backwards 0.15s; }
.hero-text-wrapper h3    { animation: rise-in 0.7s ease backwards 0.3s; }
.hero-text-wrapper .info { animation: rise-in 0.7s ease backwards 0.45s; }
.hero-text-wrapper a     { animation: rise-in 0.7s ease backwards 0.6s; }
.hero-image-wrapper      { animation: rise-in 0.9s ease backwards 0.3s; }
.hero-image-wrapper img  { animation: float 6s ease-in-out infinite 1.2s; }
.hero-image-wrapper::before { animation: glow-pulse 5s ease-in-out infinite; }

/* scroll reveal — hidden state only applies once animate.js has run */
.anim-ready main [data-aos],
.anim-ready .timeline-item,
.anim-ready .cards-wrapper .card,
.anim-ready .contact-info,
.anim-ready .contact-form {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.anim-ready main .in-view,
.anim-ready .in-view {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* timeline dots pop as their entry reveals */
.timeline-item::before {
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}
.timeline-item.in-view::before {
    transform: scale(1);
}
html:not(.anim-ready) .timeline-item::before {
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .hero-text-wrapper .hi,
    .hero-text-wrapper h1,
    .hero-text-wrapper h3,
    .hero-text-wrapper .info,
    .hero-text-wrapper a,
    .hero-image-wrapper,
    .hero-image-wrapper img,
    .hero-image-wrapper::before {
        animation: none;
    }
    .anim-ready main [data-aos],
    .anim-ready .timeline-item,
    .anim-ready .cards-wrapper .card,
    .anim-ready .contact-info,
    .anim-ready .contact-form,
    .timeline-item::before {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============ 12. RTL layout overrides (Arabic) ============ */
[dir="rtl"] {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

[dir="rtl"] .about-section {
    direction: rtl;
}

[dir="rtl"] .contact-image-div {
    margin-right: 0;
    margin-left: 2.2rem;
}

[dir="rtl"] .contact-flex,
[dir="rtl"] .hero-wrapper {
    text-align: right;
}

[dir="rtl"] .card,
[dir="rtl"] .text p,
[dir="rtl"] .about-text-div {
    text-align: right;
}

[dir="rtl"] .mobile-nav .lang-dropdown,
[dir="rtl"] .navbar-nav {
    text-align: right;
}
