/* ===========================================
   المطورة شادن — Portfolio Stylesheet
   Aesthetic: Clean Editorial Light + Teal Professional
   =========================================== */

:root {
    /* Core palette - brand teal #1e9b9b, crisp cool-white canvas */
    --bg: #ffffff;
    --bg-elev: #f1f8f8;
    --bg-card: #e5f2f1;
    --ink: #17221f;
    --ink-dim: #4c5c59;
    --ink-mute: #5e716e;

    --teal: #1e9b9b;
    --teal-deep: #146e6e;
    --teal-glow: rgba(30, 155, 155, 0.22);

    /* Borders are neutral ink-based, not brand-tinted */
    --line: rgba(23, 34, 31, 0.10);
    --line-strong: rgba(23, 34, 31, 0.18);

    /* Typography */
    --font-display: 'ThmanyahSerifDisplay', serif;
    --font-body: 'ThmanyahSans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Scale */
    --container: 1280px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);

    /* Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===== Fonts: Thmanyah (self-hosted) ===== */
@font-face {
    font-family: 'ThmanyahSans';
    src: url("/assets/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Light.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahsans/otf/thmanyahsans-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSans';
    src: url("/assets/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Regular.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahsans/otf/thmanyahsans-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSans';
    src: url("/assets/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Medium.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahsans/otf/thmanyahsans-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSans';
    src: url("/assets/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Bold.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahsans/otf/thmanyahsans-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSans';
    src: url("/assets/thmanyah typeface/thmanyahsans/woff2/thmanyahsans-Black.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahsans/otf/thmanyahsans-Black.otf") format("opentype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ThmanyahSerifDisplay';
    src: url("/assets/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Light.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahserifdisplay/otf/thmanyahserifdisplay-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSerifDisplay';
    src: url("/assets/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Regular.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahserifdisplay/otf/thmanyahserifdisplay-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSerifDisplay';
    src: url("/assets/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Medium.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahserifdisplay/otf/thmanyahserifdisplay-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSerifDisplay';
    src: url("/assets/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Bold.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahserifdisplay/otf/thmanyahserifdisplay-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'ThmanyahSerifDisplay';
    src: url("/assets/thmanyah typeface/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Black.woff2") format("woff2"),
         url("/assets/thmanyah typeface/thmanyahserifdisplay/otf/thmanyahserifdisplay-Black.otf") format("opentype");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scrollbar-color: var(--teal-deep) var(--bg); scrollbar-width: thin; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

/* Visible keyboard focus (brand color, follows rounded corners automatically) */
:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

/* SR-only for SEO content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Container ===== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
}

/* ===== Noise texture overlay ===== */
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.025;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

/* ===== Page loader ===== */
body:not(.is-loaded) { overflow: hidden; }

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    background: var(--teal-deep);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
    /* safety net: auto-dismiss even if JS never fires */
    animation: loader-fallback-hide 0s linear 3.5s forwards;
}
body.is-loaded .page-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
@keyframes loader-fallback-hide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.page-loader-inner {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}
.page-loader-logo {
    width: 60px;
    height: auto;
    opacity: 0;
    animation: loader-logo-in 0.9s var(--ease-out) 0.15s forwards;
}
@keyframes loader-logo-in {
    from { opacity: 0; transform: scale(0.85); filter: blur(6px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.page-loader-bar {
    width: 160px;
    height: 2px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}
.page-loader-bar span {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 100px;
    background: #ffffff;
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: transform 0.2s linear;
}

.page-loader-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.65);
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .page-loader-logo { animation: none; opacity: 1; }
}

/* ===== Scroll progress ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 70;
    background: var(--teal);
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: transform 0.12s linear;
    pointer-events: none;
}

/* Native scrollbar brightens while the user is actively scrolling */
html.is-scrolling { scrollbar-color: var(--teal) var(--bg); }
html.is-scrolling ::-webkit-scrollbar-thumb { background: var(--teal); }

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 50;
    padding: 1.25rem 0;
    transition: padding 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.nav.is-scrolled {
    padding: 0.875rem 0;
    background: rgba(250, 249, 245, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 60; /* must stay above .nav-mobile (49) or the toggle/X button gets painted underneath it and looks unclosable */
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    transition: opacity 0.3s;
}
.nav-logo:hover { opacity: 0.7; }
.nav-logo-mark { height: 34px; width: auto; }
.nav-logo-text { font-family: var(--font-body); font-weight: 700; }

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-links a {
    font-size: 0.95rem;
    color: var(--ink-dim);
    transition: color 0.3s;
    position: relative;
    padding: 0.25rem 0;
}
.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 0;
    height: 1px;
    background: var(--teal-deep);
    transition: width 0.3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
    background: var(--teal);
    color: #ffffff !important;
    padding: 0.55rem 1.25rem !important;
    border-radius: 100px;
    font-weight: 600;
    transition: all 0.3s var(--ease-out);
}
.nav-cta:hover {
    background: var(--teal-deep);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-toggle span {
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    transition: all 0.3s var(--ease-out);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
    position: fixed;
    top: 0;
    inset-inline: 0;
    background: var(--bg);
    padding: 5rem var(--gutter) 2.5rem;
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease-out);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 49;
    box-shadow: 0 20px 40px rgba(23, 34, 31, 0.08);
}
.nav-mobile.is-open { transform: translateY(0); }
.nav-mobile a {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--ink);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh; /* real visible viewport on mobile, avoids content clipped under browser chrome */
    display: flex;
    align-items: center;
    padding: 8rem 0 6rem;
    overflow-x: hidden;
    isolation: isolate;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, black 0%, transparent 70%);
    z-index: -1;
    opacity: 0.7;
}

.hero-content {
    z-index: 1;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 100px;
    background: var(--bg-elev);
    margin-bottom: 2.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-dim);
}
.hero-tag-dot {
    width: 8px;
    height: 8px;
    background: #22b07a;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 176, 122, 0.5);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 1.2;
    font-weight: 500;
    margin-bottom: 1.75rem;
    max-width: 18ch;
}
.hero-title-line {
    display: block;
}
.hero-title-accent {
    color: var(--teal);
    font-style: italic;
    font-weight: 400;
}

.hero-sub {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: var(--ink-dim);
    max-width: 52ch;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.875rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}
.btn svg { transition: transform 0.4s var(--ease-out); }
.btn:hover svg { transform: translateX(-4px); }
[dir="rtl"] .btn:hover svg { transform: translateX(4px); }

.btn-primary {
    background: var(--ink);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--teal);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-ghost {
    border: 1px solid var(--line-strong);
    color: var(--ink);
    background: transparent;
}
.btn-ghost:hover {
    border-color: var(--teal);
    color: var(--teal-deep);
    background: var(--bg-elev);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.hero-meta-num {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}
.hero-meta-label {
    font-size: 0.85rem;
    color: var(--ink-mute);
}
.hero-meta-divider {
    width: 1px;
    height: 36px;
    background: var(--line);
}

.hero-scroll {
    position: absolute;
    bottom: 1.5rem;
    inset-inline-end: var(--gutter);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--ink-mute);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    z-index: 1;
}
.hero-scroll-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, var(--ink-mute), transparent);
    position: relative;
    overflow: hidden;
}
.hero-scroll-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--teal), transparent);
    animation: scroll-line 2s ease-in-out infinite;
}
@keyframes scroll-line {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 600px) {
    .hero-scroll { display: none; }
    .hero-meta { gap: 1rem; }
    .hero-meta-divider { height: 28px; }
    .hero-meta-num { font-size: 1.5rem; }
}
@media (max-height: 700px) {
    .hero { padding: 7rem 0 4rem; }
    .hero-actions { margin-bottom: 2rem; }
}

/* ===== Section heads ===== */
.section-head {
    margin-bottom: 4rem;
}
.section-num {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--teal-deep);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 500;
    line-height: 1;
    color: var(--ink);
}

/* ===== About ===== */
.about {
    padding: 8rem 0;
    border-top: 1px solid var(--line);
    position: relative;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: start;
}
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
}

.about-lead {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 400;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 2rem;
}
.about-lead strong {
    font-weight: 600;
    color: var(--teal-deep);
}
.about-body {
    font-size: 1.05rem;
    color: var(--ink-dim);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    max-width: 60ch;
}

.about-stack {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--line);
}
.stack-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-mute);
    margin-bottom: 1rem;
}
.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.stack-list li {
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-dim);
    background: var(--bg-elev);
    transition: all 0.3s;
}
.stack-list li:hover {
    border-color: var(--teal);
    color: var(--teal-deep);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.about-card {
    position: sticky;
    top: 6rem;
}
.about-card-frame {
    position: relative;
    padding: 2.5rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    overflow: hidden;
}

.about-card-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--teal);
}
.about-card-corner-tl { top: -1px; inset-inline-start: -1px; border-bottom: none; border-inline-end: none; }
.about-card-corner-tr { top: -1px; inset-inline-end: -1px; border-bottom: none; border-inline-start: none; }
.about-card-corner-bl { bottom: -1px; inset-inline-start: -1px; border-top: none; border-inline-end: none; }
.about-card-corner-br { bottom: -1px; inset-inline-end: -1px; border-top: none; border-inline-start: none; }

.about-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
    gap: 1rem;
}
.about-card-row:last-child { border-bottom: none; }
.about-card-key {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-mute);
}
.about-card-val {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 500;
    text-align: end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.status-dot {
    width: 8px;
    height: 8px;
    background: #22b07a;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 176, 122, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

/* ===== Services ===== */
.services {
    padding: 8rem 0;
    border-top: 1px solid var(--line);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .services-grid { grid-template-columns: 1fr; }
}

.service {
    padding: 2.75rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}
.service::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 2px;
    background: var(--teal);
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: transform 0.4s var(--ease-out);
}
.service:hover {
    border-color: var(--line-strong);
    background: var(--bg-card);
    transform: translateY(-4px);
}
.service:hover::before {
    transform: scaleX(1);
}

.service-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--teal-deep);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}
.service-title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--ink);
}
.service-desc {
    color: var(--ink-dim);
    line-height: 1.75;
    margin-bottom: 1.75rem;
}
.service-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.service-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--ink-dim);
    padding-top: 0.625rem;
    border-top: 1px dashed var(--line);
}
.service-list li::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--teal);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== Projects ===== */
.projects {
    padding: 8rem 0;
    border-top: 1px solid var(--line);
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .projects-list { grid-template-columns: 1fr; }
}

.project {
    padding: 2.75rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
    cursor: default;
}
.project-link {
    display: block;
    color: inherit;
    cursor: pointer;
}
.project-feature {
    grid-column: 1 / -1;
    background: var(--bg-elev);
    padding: 0;
    border-color: var(--line-strong);
}
.project-feature .project-link {
    position: relative;
}
.project-feature-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch;
}
.project-feature-media {
    background: var(--bg-card);
    overflow: hidden;
    min-height: 320px;
}
.project-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s var(--ease-out);
}
.project-link:hover .project-feature-media img {
    transform: scale(1.03);
}
.project-feature-body {
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
@media (max-width: 900px) {
    .project-feature-grid { grid-template-columns: 1fr; }
    .project-feature-media { min-height: 220px; }
}

.project:hover {
    border-color: var(--teal);
    transform: translateY(-4px);
}
.project-feature:hover { border-color: var(--teal); }

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-mute);
}
.project-year {
    color: var(--teal-deep);
    font-weight: 500;
    letter-spacing: 0.05em;
}
.project-cat {
    padding-inline-start: 1rem;
    border-inline-start: 1px solid var(--line);
}

.project-name {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--ink);
}
.project-feature .project-name {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
}

.project-desc {
    color: var(--ink-dim);
    line-height: 1.75;
    margin-bottom: 1.75rem;
    max-width: 60ch;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}
.project-stack span {
    padding: 0.4rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-dim);
}

.project-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--teal-deep);
    font-weight: 600;
    font-size: 0.95rem;
    transition: gap 0.3s var(--ease-out);
}
.project-link:hover .project-action { gap: 0.875rem; }
.project-action svg { transition: transform 0.3s; }
.project-link:hover .project-action svg { transform: translateX(-4px); }
[dir="rtl"] .project-link:hover .project-action svg { transform: translateX(4px); }

/* ===== Process ===== */
.process {
    padding: 8rem 0;
    border-top: 1px solid var(--line);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    counter-reset: step;
    position: relative;
}
.process-steps::before {
    content: '';
    position: absolute;
    top: 22px;
    inset-inline: 0;
    height: 1px;
    background: linear-gradient(to inline-end, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
    z-index: 0;
}
@media (max-width: 768px) {
    .process-steps { grid-template-columns: 1fr; }
    .process-steps::before { display: none; }
}

.process-step {
    position: relative;
    z-index: 1;
}
.process-step-num {
    width: 44px;
    height: 44px;
    background: var(--bg);
    border: 1px solid var(--teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--teal-deep);
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: all 0.4s var(--ease-out);
}
.process-step:hover .process-step-num {
    background: var(--teal);
    color: #ffffff;
    transform: scale(1.1);
}
.process-step h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
    color: var(--ink);
}
.process-step p {
    color: var(--ink-dim);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact {
    padding: 8rem 0;
    border-top: 1px solid var(--line);
    position: relative;
}

.contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}
@media (max-width: 900px) {
    .contact-inner { grid-template-columns: 1fr; gap: 3rem; }
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    margin-top: 0.75rem;
}
.contact-title-accent {
    display: block;
    color: var(--teal);
    font-style: italic;
    font-weight: 400;
}
.contact-sub {
    color: var(--ink-dim);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 50ch;
}

.contact-channels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-channel {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: all 0.4s var(--ease-out);
}
.contact-channel:hover {
    background: var(--bg-card);
    border-color: var(--teal);
    transform: translateX(-4px);
}
[dir="rtl"] .contact-channel:hover { transform: translateX(4px); }

.contact-channel-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-deep);
    flex-shrink: 0;
    transition: all 0.4s var(--ease-out);
}
.contact-channel-icon svg { width: 22px; height: 22px; }
.contact-channel:hover .contact-channel-icon {
    background: var(--teal);
    color: #ffffff;
    border-color: var(--teal);
}

.contact-channel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.contact-channel-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-mute);
}
.contact-channel-value {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 500;
    word-break: break-word;
}
.contact-channel-arrow {
    color: var(--ink-mute);
    transition: all 0.3s;
    flex-shrink: 0;
}
.contact-channel:hover .contact-channel-arrow {
    color: var(--teal-deep);
    transform: translateX(-4px);
}
[dir="rtl"] .contact-channel:hover .contact-channel-arrow { transform: translateX(4px); }

/* ===== Footer (bold flat teal band) ===== */
.footer {
    padding: 4rem 0 2rem;
    background: var(--teal-deep);
    color: #ffffff;
}
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.footer-logo {
    height: 40px;
    width: auto;
}
.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}
.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}
.footer-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    transition: color 0.3s;
}
.footer-nav a:hover { color: #ffffff; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-domain {
    font-family: var(--font-mono);
    color: #ffffff;
    letter-spacing: 0.05em;
}

/* ===== Reveal animations ===== */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== Hero scroll parallax ===== */
.hero-content {
    will-change: transform, opacity;
}

/* ===== Active nav link (scroll spy) ===== */
.nav-links a.is-active:not(.nav-cta) { color: var(--ink); }
.nav-links a.is-active:not(.nav-cta)::after { width: 100%; }
.nav-mobile a.is-active { color: var(--teal-deep); }

/* ===== Back to top ===== */
.to-top {
    position: fixed;
    bottom: 1.75rem;
    inset-inline-end: 1.75rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ink);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), background 0.3s;
}
.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.to-top:hover { background: var(--teal); }
.to-top svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
    .to-top { bottom: 1.25rem; inset-inline-end: 1.25rem; width: 44px; height: 44px; }
}

/* ===== Selection ===== */
::selection {
    background: var(--teal);
    color: #ffffff;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--teal-deep);
    border-radius: 10px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ===== Tighter rhythm on small screens ===== */
@media (max-width: 640px) {
    .about, .services, .projects, .process, .contact { padding: 5rem 0; }
    .section-head { margin-bottom: 2.5rem; }
    .service, .project { padding: 2rem; }
    .project-feature-body { padding: 2.25rem; }
    .project-feature-media { min-height: 180px; }
    .footer-brand { align-items: center; }
    .footer-logo { height: 32px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
}
