/* MD Animation Studio — landing page
   Arabic-first, RTL, dark cinematic surface. */

.md-page *, .md-page *::before, .md-page *::after { box-sizing: border-box; }

@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-400-arabic.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-400-latin.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-500-arabic.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-500-latin.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-600-arabic.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: 'MD Plex';
    src: url('./fonts/plex-600-latin.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
    font-family: 'MD Kufi';
    src: url('./fonts/kufi-700-arabic.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: 'MD Kufi';
    src: url('./fonts/kufi-700-latin.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}

:root {
    --md-bg: #0b0e1f;
    --md-panel: #131830;
    --md-ink: #f6f4ef;
    --md-muted: #a9aec4;
    --md-dim: #7f86a0;
    --md-teal: #45c9b8;
    --md-orange: #ff7a3d;
    --md-line: rgba(255, 255, 255, 0.11);
}

html, body, #root { margin: 0; min-height: 100%; }
body { background: var(--md-bg); }
.file-card { background: var(--md-bg); color: var(--md-ink); }

.md-page {
    font-family: 'MD Plex', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--md-ink);
    display: flex;
    flex-direction: column;
}

.md-page a { color: inherit; }
.md-page :focus-visible { outline: 2px solid var(--md-teal); outline-offset: 3px; border-radius: 6px; }

/* Hero */
.md-hero {
    position: relative;
    margin: -24px calc(-1 * var(--file-pad-x)) 0;
    padding: 36px var(--file-pad-x) 44px;
    overflow: hidden;
    background: #06081a;
    isolation: isolate;
}
.md-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 45%;
    opacity: 0.34;
    z-index: -2;
}
.md-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(6, 8, 26, 0.92) 0%, rgba(6, 8, 26, 0.55) 34%, rgba(11, 14, 31, 0.96) 88%, var(--md-bg) 100%),
        linear-gradient(90deg, rgba(6, 8, 26, 0.9) 0%, rgba(6, 8, 26, 0.1) 70%);
}
.md-hero-inner { max-width: 640px; }

.md-brand { display: flex; align-items: center; gap: 12px; }
.md-logo { width: 52px; height: 52px; border-radius: 50%; display: block; }
.md-brand-name { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: 0.01em; }
.md-brand-sub { margin: 2px 0 0; color: var(--md-muted); font-size: 12.5px; }

.md-h1 {
    font-family: 'MD Kufi', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 7.4vw, 54px);
    line-height: 1.32;
    margin: 22px 0 0;
    text-wrap: balance;
}
.md-lede {
    color: var(--md-muted);
    font-size: 15.5px;
    line-height: 1.85;
    margin: 16px 0 0;
    max-width: 58ch;
}

.md-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.md-btn-primary { background: var(--md-teal); color: #032420; }
.md-btn-primary:hover { background: #5cd9c9; }
.md-btn-ghost { border: 1px solid rgba(255, 255, 255, 0.28); color: var(--md-ink); }
.md-btn-ghost:hover { border-color: rgba(255, 255, 255, 0.6); }
.md-btn-icon { display: inline-flex; }
.md-btn-wide { width: 100%; }

.md-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px 18px;
    margin: 30px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--md-line);
}
.md-stats dt { color: var(--md-dim); font-size: 12px; }
.md-stats dd { margin: 4px 0 0; font-weight: 600; font-size: 14.5px; }

/* Sections */
.md-section {
    padding-block: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--md-line);
}
.md-section:first-of-type { border-top: 0; }

.md-eyebrow { margin: 0; color: var(--md-teal); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.md-h2 {
    font-family: 'MD Kufi', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(21px, 4.6vw, 30px);
    line-height: 1.45;
    margin: 10px 0 22px;
    text-wrap: balance;
}
.md-body { color: var(--md-muted); font-size: 15px; line-height: 1.85; margin: 0 0 22px; max-width: 68ch; }
.md-note { color: var(--md-dim); font-size: 12.5px; line-height: 1.8; margin: 16px 0 0; }

/* Services */
.md-services { display: grid; grid-template-columns: 1fr; }
.md-service {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 14px;
    padding: 16px 0;
    border-top: 1px solid var(--md-line);
}
.md-service-n {
    grid-row: span 2;
    color: var(--md-orange);
    font-weight: 600;
    font-size: 12.5px;
    line-height: 22px;
    letter-spacing: 0.04em;
}
.md-service-name { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.6; }
.md-service-line { margin: 4px 0 0; color: var(--md-muted); font-size: 13.5px; line-height: 1.75; }

/* Work */
.md-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.md-chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--md-line);
    background: transparent;
    color: var(--md-muted);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.md-chip:hover { color: var(--md-ink); border-color: rgba(255, 255, 255, 0.32); }
.md-chip[aria-pressed='true'] { background: var(--md-teal); border-color: var(--md-teal); color: #032420; font-weight: 600; }

.md-work-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.md-card {
    display: flex;
    flex-direction: column;
    background: var(--md-panel);
    border: 1px solid var(--md-line);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.md-card:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }
.md-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #070a17; }
.md-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.md-card:hover .md-card-media img { transform: scale(1.04); }
.md-card-body { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px 15px; }
.md-card-client { font-weight: 600; font-size: 15px; line-height: 1.5; }
.md-card-title { color: var(--md-muted); font-size: 13px; line-height: 1.65; }
.md-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 12px; }
.md-tag { color: var(--md-teal); }
.md-duration { color: var(--md-dim); font-variant-numeric: tabular-nums; }

/* Clients */
.md-clients { display: grid; grid-template-columns: 1fr; gap: 26px; }
.md-client-country { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--md-orange); letter-spacing: 0.02em; }
.md-client-list { list-style: none; margin: 0; padding: 0; }
.md-client-list li { padding: 9px 0; border-bottom: 1px solid var(--md-line); font-size: 14px; line-height: 1.6; color: var(--md-muted); }

/* Process */
.md-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 18px; }
.md-step { padding-top: 14px; border-top: 1px solid var(--md-line); }
.md-step-n { color: var(--md-teal); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em; }
.md-step-name { margin: 6px 0 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
.md-step-line { margin: 6px 0 0; color: var(--md-muted); font-size: 13.5px; line-height: 1.75; }

/* About */
.md-reasons { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 26px; }
.md-reason { padding-top: 14px; border-top: 1px solid var(--md-line); }
.md-reason-name { margin: 0; font-size: 15px; font-weight: 600; }
.md-reason-line { margin: 5px 0 0; color: var(--md-muted); font-size: 13.5px; line-height: 1.75; }

.md-vision { display: grid; grid-template-columns: 1fr; gap: 18px; }
.md-vision > div { border-inline-start: 2px solid var(--md-teal); padding-inline-start: 16px; }
.md-vision-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--md-teal); }
.md-vision-text { margin: 6px 0 0; color: var(--md-muted); font-size: 14px; line-height: 1.8; }

/* Contact */
.md-contact {
    margin-top: 48px;
    padding: 26px 20px 28px;
    border: 1px solid rgba(69, 201, 184, 0.28);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(69, 201, 184, 0.09), rgba(19, 24, 48, 0.2));
}
.md-offices { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 24px; }
.md-office-name { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.md-office-line { margin: 0 0 6px; color: var(--md-muted); font-size: 13.5px; line-height: 1.7; }
.md-office-line a { color: var(--md-teal); text-decoration: none; }
.md-office-line a:hover { text-decoration: underline; }

.md-page .md-closing { margin-top: 36px; color: var(--md-dim); font-size: 12px; line-height: 1.8; }

@media (min-width: 640px) {
    .md-hero { margin-top: -36px; padding: 48px var(--file-pad-x) 56px; }
    .md-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
    .md-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
    .md-reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
    .md-vision { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-offices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-btn-wide { width: auto; }
    .md-section { padding-block: 48px 0; margin-top: 48px; }
}

@media (min-width: 900px) {
    .md-work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md-clients { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
    .md-contact { padding: 32px 28px 34px; }
}

/* ---- standalone shell (replaces the hosted viewer frame) ---- */
:root { --file-pad-x: 24px; }
html { background: var(--md-bg); }
.site {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
    background: var(--md-bg);
}
@media (min-width: 768px) {
    .site { padding: 36px; }
}
.md-card[hidden] { display: none; }
.md-page .md-closing { margin-top: 36px; color: var(--md-dim); font-size: 12px; line-height: 1.8; }
