:root {
    --black: #0a0a0a;
    --white: #f7f7f7;
    --accent: #484949;
    --accent-selection: #212121ad;
    --bg: var(--white);
    --surface: var(--white);
    --border: var(--black);
    --text: var(--black);
    --text-invert: var(--white);
    --radius: 10px;
    --font-body: "Bricolage Grotesque", sans-serif;
    --font-arabic: "Zain", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
    --dir: 1;
}

[dir="rtl"] {
    --dir: -1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*::selection {
    background: var(--black);
    color: var(--white);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

body.lang-ar,
html[lang="ar"] body {
    font-family: var(--font-arabic);
}

body.lang-ar .intro-brand,
body.lang-ar .brand,
body.lang-ar .brand-name,
html[lang="ar"] body .intro-brand,
html[lang="ar"] body .brand,
html[lang="ar"] body .brand-name {
    font-family: var(--font-arabic);

}

body.lang-ar .brand,
html[lang="ar"] body .brand {
    direction: rtl;
}

body.lang-ar .hero-greet,
body.lang-ar .editor-filename,
body.lang-ar .lang-switch,
body.lang-ar .mobile-lang-switch,
body.lang-ar .project-tag,
body.lang-ar .tag-chip {
    letter-spacing: 0;
}

.reveal-section {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

main,
header,
footer {
    position: relative;
    z-index: 1;
}

.section-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
}

h1,
h2,
h3 {
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: -0.01em;
}

body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3 {
    font-family: var(--font-arabic);
    letter-spacing: 0;
    font-weight: 700;
}

/* ============ INTRO LOADER ============ */
body.is-loading {
    overflow: hidden;
}

.intro-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro-brand {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(28px, 6vw, 44px);
    letter-spacing: -0.04em;
    color: var(--white);
    opacity: 0;
    transform: translateY(8px);
    animation: introIn 0.5s ease 0.15s forwards;
    direction: ltr;
    unicode-bidi: isolate;
}

@keyframes introIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .intro-loader {
        transition: none;
    }

    .intro-brand {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============ NAV ============ */
.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--black);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.04em;
    transition: all 0.2s ease;
    direction: ltr;
}


.brand-name {
    color: var(--white);
    display: inline-block;
    transition: all 0.2s ease;
}

.brand-name:hover {
    opacity: 0.8;
    scale: 0.991;
}

.accent-dot {
    color: var(--accent);
}

.tabs {
    position: relative;
    display: flex;
    gap: 4px;
    font-size: 0.82rem;
}

.tab {
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--white);
    opacity: 0.7;
    transition: opacity 0.2s ease;
    position: relative;
}

.tab:hover,
.tab.is-active {
    opacity: 1;
}

.nav-dot {
    position: absolute;
    bottom: -2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--white);
    opacity: 0;
    transition: left 0.35s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s ease;
    pointer-events: none;
}

.nav-dot.is-visible {
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Language switch ---- */
.lang-switch,
.mobile-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(247, 247, 247, 0.3);
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    direction: ltr;
}

.lang-switch:hover,
.mobile-lang-switch:hover {
    border-color: rgba(247, 247, 247, 0.7);
}

.lang-switch-option {
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.lang-switch-option.is-active {
    opacity: 1;
}

.lang-switch-divider {
    opacity: 0.35;
}

.mobile-lang-switch {
    margin: 14px 32px 18px;
    align-self: flex-start;
}

@media (min-width: 861px) {
    .mobile-lang-switch {
        display: none;
    }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(247, 247, 247, 0.3);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.nav-toggle-bar {
    width: 16px;
    height: 2px;
    background: var(--white);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    background: var(--black);
    border-top: 1px solid rgba(247, 247, 247, 0.12);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.is-open {
    max-height: 400px;
}

.mobile-link {
    padding: 14px 32px;
    color: var(--white);
    font-size: 0.95rem;
    opacity: 0.8;
    border-bottom: 1px solid rgba(247, 247, 247, 0.08);
    transition: opacity 0.15s ease;
}

.mobile-link:last-child {
    border-bottom: none;
}

.mobile-link:hover,
.mobile-link.is-active {
    opacity: 1;
}

@media (min-width: 861px) {

    .mobile-menu,
    .nav-toggle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu {
        transition: none;
    }
}

.cta-btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid transparent;
    display: inline-block;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: var(--white);
    color: var(--black);
    box-shadow: calc(2px * var(--dir)) 2px 0px var(--accent);
}

.cta-btn:hover {
    transform: translate(calc(-1px * var(--dir)), -1px);
    box-shadow: calc(3px * var(--dir)) 3px 0px var(--accent);
}

.cta-btn:active {
    transform: translate(calc(1px * var(--dir)), 1px);
    box-shadow: calc(1px * var(--dir)) 1px 0px var(--accent);
}

/* ============ HERO ============ */
.hero {
    position: relative;
    background: var(--white);
    color: var(--black);
    padding: 88px 32px 60px;
    overflow: hidden;
    isolation: isolate;
    min-height: 680px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        linear-gradient(to right, rgba(10, 10, 10, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(10, 10, 10, 0.10) 1px, transparent 1px);
    background-size: 32px 32px;
    --mx: 50%;
    --my: 42%;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--white) 85%);
    pointer-events: none;
    z-index: 1;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(51, 50, 50, 0.151), transparent 70%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero:hover::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce),
(pointer: coarse) {
    .hero::after {
        display: none;
    }
}

.hero-copy {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
}

.hero-copy h1 {
    font-size: clamp(2rem, 5vw, 76px);
    line-height: 1.08;
    max-width: 1200px;
    margin-bottom: 40px;
    color: var(--black);
}

body.lang-ar .hero-copy h1 {
    line-height: 1.35;
}

.hero-line {
    display: inline-block;
}

.hero-greet {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--black);
    opacity: 0.55;
    margin-bottom: 4px;
}

body.lang-ar .hero-greet {
    font-family: var(--font-arabic);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    animation-play-state: paused;
}

body.intro-done .hero-actions {
    animation-play-state: running;
}


.hero-btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--black);
    display: inline-block;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
    white-space: nowrap;
    background: var(--white);
    color: var(--black);
    box-shadow: calc(3px * var(--dir)) 3px 0px var(--black);
}

.hero-btn:hover {
    background: var(--black);
    color: var(--white);
    box-shadow: calc(1px * var(--dir)) 1px 0px var(--black);
    transform: translate(calc(2px * var(--dir)), 2px);
}

.hero-btn:active {
    transform: translate(calc(3px * var(--dir)), 3px);
    box-shadow: 0px 0px 0px var(--black);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-actions {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============ ABOUT ============ */
.about {
    padding: 90px 0;
    border-top: 1px solid var(--border);
}

.about-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
    align-items: start;
}

.about h2 {
    font-size: 40px;
    margin-bottom: 22px;
}

.about-lede {
    font-size: 1.05rem;
    color: var(--text);
    max-width: 56ch;
    margin-bottom: 18px;
}

.about-lede strong {
    font-weight: 700;
}

.about-facts {
    list-style: none;
    margin-top: 28px;
    border-top: 1px solid var(--border);
}

.about-facts li {
    display: flex;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.about-facts li span:first-child {
    flex: 0 0 140px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding-top: 2px;
}

body.lang-ar .about-facts li span:first-child {
    text-transform: none;
    letter-spacing: 0;
}

.about-photo {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.photo-frame {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 3/4;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    background: repeating-linear-gradient(135deg, rgba(10, 10, 10, 0.04) 0 2px, transparent 2px 14px);
    box-shadow: calc(4px * var(--dir)) 4px 0px var(--black);
    direction: ltr;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: -120px;
    border-radius: var(--radius);
}

.date {
    display: inline-block;
    margin-top: 12px;
    margin-right: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    color: var(--text);
    text-align: right;
}

@media (max-width: 860px) {
    .about {
        padding: 72px 0;
    }

    .about-inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .about h2 {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .about-lede {
        font-size: 1rem;
        max-width: none;
    }

    .about-photo {
        order: -1;
        align-items: center;
    }

    .photo-frame {
        max-width: 260px;
        width: min(100%, 260px);
    }

    .photo-frame img {
        object-position: -89px;
    }

    .date {
        width: min(100%, 260px);
        margin: 10px auto 0;
        font-size: 0.72rem;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .about {
        padding: 60px 0;
    }

    .about h2 {
        font-size: 28px;
    }

    .about-facts {
        margin-top: 22px;
    }

    .about-facts li {
        flex-direction: column;
        gap: 4px;
        padding: 12px 0;
    }

    .about-facts li span:first-child {
        flex: none;
        padding-top: 0;
    }

    .photo-frame {
        max-width: 220px;
        width: min(100%, 220px);
    }

    .photo-frame img {
        object-position: -75px;
    }

    .date {
        width: min(100%, 220px);
        margin: 10px auto 0;
        font-size: 0.68rem;
        letter-spacing: 0.14em;
    }
}

/* ============ SKILLS ============ */
.skills {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.skills h2,
.contact h2 {
    font-size: 42px;
    margin-bottom: 10px;
}

.section-sub {
    color: var(--text-muted);
    max-width: 56ch;
    margin-bottom: 36px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    direction: ltr;
    justify-content: flex-start;
}

body.lang-ar .chip-row {
    justify-content: flex-end;
}

.chip {
    position: relative;
    display: inline-block;
    font-family: var(--font-body);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: var(--black);
    background: linear-gradient(90deg, var(--black) 0%, var(--black) 60%, rgba(10, 10, 10, 0.4) 85%, rgba(10, 10, 10, 0.05) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.2s ease, opacity 0.5s ease, translate 0.5s ease;
    margin-right: 20px;
    opacity: 0;
    translate: 0 16px;
}

.skills.is-visible .chip {
    opacity: 1;
    translate: 0 0;
}

.chip:nth-child(1) {
    transition-delay: 0.05s;
}

.chip:nth-child(2) {
    transition-delay: 0.1s;
}

.chip:nth-child(3) {
    transition-delay: 0.15s;
}

.chip:nth-child(4) {
    transition-delay: 0.2s;
}

.chip:nth-child(5) {
    transition-delay: 0.25s;
}

.chip:nth-child(6) {
    transition-delay: 0.3s;
}

.chip:nth-child(7) {
    transition-delay: 0.35s;
}

.chip:nth-child(8) {
    transition-delay: 0.4s;
}

.chip:nth-child(9) {
    transition-delay: 0.45s;
}

@media (prefers-reduced-motion: reduce) {
    .chip {
        opacity: 1;
        translate: 0 0;
        transition-delay: 0s;
    }
}

.chip:hover {
    transform: none;
}

.cta-link {
    font-family: var(--font-body);
    font-size: 18px;
    margin-top: 30px;
    background: var(--black);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid var(--black);
    box-shadow: calc(3px * var(--dir)) 3px 0px var(--accent);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, color 0.2s ease;
}

body.lang-ar .cta-link {
    font-family: var(--font-arabic);
}

.cta-link:hover {
    background: var(--white);
    color: var(--black);
    box-shadow: calc(1px * var(--dir)) 1px 0px var(--accent);
    transform: translate(calc(2px * var(--dir)), 2px);
}

.cta-link span:last-child {
    display: inline-block;
    transition: margin-left 0.2s ease, margin-right 0.2s ease;
    font-size: 16px;
    margin-left: 2px;
}

.cta-link:hover span:last-child {
    margin-left: 6px;
}

body.lang-ar .cta-link span:last-child {
    display: inline-block;
    transform: scaleX(-1);
    margin-left: 0;
    margin-right: 2px;
}

body.lang-ar .cta-link:hover span:last-child {
    margin-right: 6px;
}

/* ============ PROJECTS PAGE ============ */
.projects-hero {
    padding: 70px 0 20px;
}

.projects-hero h1 {
    font-size: clamp(2rem, 5vw, 52px);
    line-height: 1.1;
    margin-bottom: 18px;
    max-width: 720px;
}

body.lang-ar .projects-hero h1 {
    line-height: 1.3;
}

.projects {
    padding: 40px 0 90px;
}

/* ---- Editorial project list ---- */
.project-list {
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 36px 24px;
    margin: 0 -24px;
    border-bottom: 1px solid var(--border);
    position: relative;
    color: var(--text);
    background-color: transparent;
    transition: background-color 0.35s ease, color 0.35s ease, opacity 0.25s ease;
}

.project-row::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    bottom: 50%;
    width: 3px;
    background: var(--white);
    transition: top 0.35s ease, bottom 0.35s ease;
}

.project-row:hover,
.project-row:focus-visible {
    background-color: var(--black);
    color: var(--white);
}

.project-row:hover::before,
.project-row:focus-visible::before {
    top: 18%;
    bottom: 18%;
}

.project-list:hover .project-row:not(:hover) {
    opacity: 0.45;
}

.project-row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.project-row-title {
    font-size: clamp(1.4rem, 3.4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: transform 0.25s ease;
}

.project-row:hover .project-row-title,
.project-row:focus-visible .project-row-title {
    transform: translateX(calc(14px * var(--dir)));
}

.project-row-desc {
    margin-top: 8px;
    margin-bottom: 8px;
    max-width: 46ch;
    font-size: 0.92rem;
    color: inherit;
    opacity: 0.7;
}

.project-row-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.project-row-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
    white-space: nowrap;
    border: 1px solid currentColor;
    padding: 5px 10px;
    border-radius: 20px;
    transition: border-color 0.35s ease;
}

body.lang-ar .project-row-tag {
    text-transform: none;
    letter-spacing: 0;
}

.project-row-arrow {
    flex: 0 0 auto;
    font-size: 1.4rem;
    transition: transform 0.25s ease;
}

.project-row:hover .project-row-arrow,
.project-row:focus-visible .project-row-arrow {
    transform: translate(calc(4px * var(--dir)), -4px);
}

body.lang-ar .project-row-arrow {
    display: inline-block;
    transform: scaleX(-1);
}

body.lang-ar .project-row:hover .project-row-arrow,
body.lang-ar .project-row:focus-visible .project-row-arrow {
    transform: scaleX(-1) translate(4px, -4px);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    font-size: 0.72rem;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    transition: border-color 0.35s ease;
}

@media (max-width: 700px) {
    .project-row {
        flex-wrap: wrap;
        padding: 26px 20px;
        margin: 0 -20px;
    }

    .project-row-main {
        flex: 1 1 100%;
    }

    .project-row-meta {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .project-row:hover .project-row-title,
    .project-row:focus-visible .project-row-title {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .project-row,
    .project-row-title,
    .project-row-arrow,
    .project-row::before {
        transition: none;
    }
}

/* ============ CONTACT ============ */
.contact {
    padding: 80px 0 100px;
    border-top: 1px solid var(--border);
}

.terminal {
    background: var(--black);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 640px;
    margin-bottom: 28px;
    box-shadow: 6px 6px 0px rgba(10, 10, 10, 0.2);
    direction: ltr;
    text-align: left;
}

.editor-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(247, 247, 247, 0.06);
    border-bottom: 1px solid rgba(247, 247, 247, 0.12);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(247, 247, 247, 0.85);
}

.dot.yellow {
    background: rgba(247, 247, 247, 0.55);
}

.dot.green {
    background: rgba(247, 247, 247, 0.3);
}

.editor-filename {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(247, 247, 247, 0.6);
}

.terminal-body {
    padding: 22px 26px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--text-invert);
}

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

body.lang-ar .terminal-body .out[data-i18n],
body.lang-ar .terminal-body .out span[data-i18n] {
    font-family: var(--font-arabic);
    unicode-bidi: isolate;
}

.prompt {
    color: var(--accent);
    margin-right: 8px;
    font-weight: 700;
}

.out {
    color: rgba(247, 247, 247, 0.8);
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.out a {
    color: var(--white);
    text-decoration: underline;
    text-decoration-color: var(--accent);
}

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

/* Terminal Typing Animation */
.typewriter {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid var(--accent);
    white-space: nowrap;
    max-width: fit-content;
    animation: typing 1.5s steps(10, end), blink-caret 0.75s step-end infinite;
}

.typewriter-second {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: fit-content;
    animation: typing 1.8s steps(12, end) 1.6s both;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent);
    }
}

.cursor-blink {
    display: inline-block;
    width: 8px;
    background: var(--accent);
    animation: cursorBlink 1.1s steps(1) infinite;
}

@keyframes cursorBlink {
    50% {
        background: transparent;
    }
}

.type-caret {
    display: inline-block;
    width: 7px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -2px;
    background: var(--accent);
    animation: cursorBlink 1s steps(1) infinite;
}

.out,
.final-prompt {
    transition: opacity 0.4s ease, translate 0.4s ease;
}

.out.pending {
    opacity: 0;
    translate: 0 6px;
}

.final-prompt.pending {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .type-caret {
        animation: none;
    }
}

.btn {
    font-family: var(--font-body);
    font-weight: 600;
    display: inline-block;
    border: 1px solid var(--black);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease, color 0.2s ease;
}

body.lang-ar .btn {
    font-family: var(--font-arabic);
}

.btn-primary {
    background: var(--black);
    color: var(--white);
    box-shadow: calc(3px * var(--dir)) 3px 0px var(--accent);
}

.btn-primary:hover {
    background: var(--white);
    color: var(--black);
    box-shadow: calc(1px * var(--dir)) 1px 0px var(--accent);
    transform: translate(calc(2px * var(--dir)), 2px);
}

.btn-large {
    padding: 14px 26px;
    font-size: 0.95rem;
}

/* ============ FOOTER ============ */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--text);
}

body.lang-ar .footer-inner {
    font-family: var(--font-arabic);
}

.back-top {
    color: var(--text);
    font-weight: 600;
}

.back-top:hover {
    color: var(--accent);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
    .tabs {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-inner {
        justify-content: space-between;
    }

    body.lang-ar .intro-brand,
    body.lang-ar .brand,
    body.lang-ar .brand-name,
    html[lang="ar"] body .intro-brand,
    html[lang="ar"] body .brand,
    html[lang="ar"] body .brand-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .section-inner {
        padding: 0 20px;
    }

    .hero {
        padding: 64px 20px 56px;
        min-height: auto;
    }

    .nav-inner {
        padding: 14px 20px;
        gap: 12px;
    }

    .brand {
        font-size: 22px;
    }

    .about-facts li {
        flex-direction: column;
        gap: 4px;
        padding: 12px 0;
    }

    .about-facts li span:first-child {
        flex: none;
    }

    .terminal-body {
        padding: 18px 18px;
        font-size: 0.78rem;
        line-height: 1.8;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Accessibility */
a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}