/* ============================================================
   Moawiya Thaher — app portfolio
   Minimal monochrome. Light mode only (no dark theme).
   No build step, no dependencies.
   ============================================================ */

:root {
    /* Light mode only — locked regardless of the device's dark setting. */
    color-scheme: light;

    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #5f5f5f;
    --faint: #9a9a9a;
    --border: #e6e6e6;
    --surface: #fafafa;
    --surface-2: #f2f2f2;
    --max: 860px;
    --radius: 16px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

a { color: inherit; }

/* ---------- Sticky top nav ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.01em;
}
.nav-mark {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: #000;
    position: relative;
    flex: 0 0 auto;
}
.nav-mark::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid #fff;
    border-radius: 2px;
}
.nav-links { display: flex; gap: 22px; }
.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--fg); }

/* ---------- Logo mark (pure CSS, mirrors the brand) ---------- */

.logo {
    width: 108px;
    height: 108px;
    background: #000;
    border-radius: 10px;
    position: relative;
    flex: 0 0 auto;
}
.logo::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1.5px solid #fff;
    border-radius: 6px;
}
.logo-text {
    position: absolute;
    left: 15px;
    bottom: 14px;
    color: #fff;
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.02em;
    font-size: 14px;
    text-align: left;
}
.logo-text sup {
    font-size: 0.42em;
    vertical-align: top;
    top: -0.1em;
    position: relative;
}

/* ---------- Hero ---------- */

header.hero { padding: 60px 0 54px; }
.hero-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.eyebrow {
    margin-top: 28px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero h1 {
    font-size: clamp(34px, 6.6vw, 58px);
    font-weight: 800;
    letter-spacing: -0.038em;
    line-height: 1.03;
    margin-top: 14px;
    max-width: 22ch;
}
.hero .tagline {
    font-size: clamp(16px, 2.4vw, 19px);
    color: var(--muted);
    margin-top: 20px;
    max-width: 60ch;
}
.hero .tagline strong { color: var(--fg); font-weight: 600; }
.hero .tagline em { font-style: italic; color: var(--fg); }
.hero .hero-tags { margin-top: 24px; }

/* CTAs */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 20px;
    border-radius: 999px;
    font-weight: 600; font-size: 15px;
    text-decoration: none;
    border: 1px solid var(--fg);
    transition: transform 0.15s ease;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--fg); transform: translateY(-2px); }

/* Stats strip — app impact, not a résumé */
.stats {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 40px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.stats li { display: flex; flex-direction: column; gap: 2px; text-align: center; min-width: 0; }
.stat-n { font-size: clamp(22px, 4vw, 30px); font-weight: 800; letter-spacing: -0.03em; }
.stat-l { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Sections ---------- */

section { padding: 44px 0; border-top: 1px solid var(--border); scroll-margin-top: 70px; }
section > h2 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 24px;
}

/* ---------- Tags (pills) ---------- */

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
    font-size: 12.5px; font-weight: 500;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}
.tags.small { margin-top: 12px; }
.tags.small li { font-size: 11.5px; padding: 3px 9px; }

/* ---------- App cards ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.app {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    /* opacity is animated by the scroll-reveal (slow); border/transform stay
       snappy for hover. */
    transition: opacity 0.5s ease, border-color 0.15s ease, transform 0.15s ease;
    min-width: 0;
}
.app:hover { border-color: var(--fg); transform: translateY(-2px); }
.app-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.app-logo {
    width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto;
    object-fit: cover; border: 1px solid var(--border);
}
/* For full logos with a wordmark (not square app icons): show the whole
   logo on a white tile instead of cropping it to fill. */
.app-logo.contain { object-fit: contain; background: #fff; padding: 4px; }
.mono {
    width: 46px; height: 46px; flex: 0 0 auto;
    background: #000; color: #fff;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
    overflow: hidden;
}
.app-titles { min-width: 0; flex: 1 1 auto; }
.app-name {
    font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
    display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.app-name .ar { font-weight: 600; color: var(--muted); font-size: 14px; }
.app-badge {
    font-size: 11px; font-weight: 700;
    color: var(--bg); background: var(--fg);
    padding: 4px 9px; border-radius: 999px;
    white-space: nowrap; flex: 0 0 auto;
}
.app-desc { color: var(--muted); font-size: 14.5px; flex: 1 1 auto; }
.app-link {
    align-self: flex-start;
    margin-top: 14px;
    font-weight: 600; font-size: 14px; text-decoration: none;
    border-bottom: 1px solid currentColor; padding-bottom: 1px;
}

/* ---------- App showcases (with screenshot galleries) ---------- */

.showcase { padding: 36px 0; border-top: 1px solid var(--border); }
.showcase:first-of-type { border-top: none; padding-top: 4px; }

.sc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sc-head .app-logo, .sc-head .mono { width: 52px; height: 52px; }
.sc-head .mono { font-size: 19px; }
.sc-meta { flex: 1 1 300px; min-width: 0; }
.sc-meta .app-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sc-desc { color: var(--muted); font-size: 14.5px; margin-top: 5px; max-width: 62ch; }
.sc-meta .tags { margin-top: 12px; }
.sc-head .app-link { align-self: center; margin-top: 0; white-space: nowrap; }

/* Horizontal screenshot gallery */
.shots {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    padding: 6px 2px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 transparent;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-track { background: transparent; }
.shots::-webkit-scrollbar-thumb { background: #d8d8d8; border-radius: 99px; }
.shot {
    flex: 0 0 auto;
    height: 440px;
    width: auto;
    aspect-ratio: 416 / 900;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.10);
    scroll-snap-align: start;
    background: #fff;
    display: block;
}

/* "More apps" subheading */
.more-h {
    font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--faint);
    margin: 44px 0 18px;
}

/* ---------- Contact ---------- */

.contact-lead { color: var(--muted); margin-bottom: 18px; max-width: 60ch; }
.links { display: flex; flex-direction: column; gap: 2px; }
.link-row {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 4px;
    text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.15s ease;
}
.link-row:last-child { border-bottom: none; }
.link-row:hover { padding-left: 10px; }
.link-row .label { font-weight: 600; min-width: 92px; }
.link-row .value { color: var(--muted); font-size: 15px; word-break: break-all; }
.link-row .ext { margin-left: auto; color: var(--faint); }

/* ---------- Footer ---------- */

footer {
    padding: 48px 0 64px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--faint);
    font-size: 13px;
}
footer .sign { margin-bottom: 6px; }

/* ---------- Motion: scroll reveal + hero entrance ----------
   The hidden-until-revealed state is scoped to `.js` (set by an inline
   script in <head>), so if JavaScript is off, ALL content shows normally —
   nothing is ever permanently hidden. `prefers-reduced-motion` disables it.
   ----------------------------------------------------------- */

/* Slide-and-fade — for hero blocks, section headings, contact (no hover transform). */
.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: calc(var(--i, 0) * 80ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Fade-only — for app cards, so the reveal doesn't fight their hover lift. */
.js .app.reveal-fade { opacity: 0; }
.js .app.reveal-fade.is-visible { opacity: 1; }

/* Gentle perpetual float on the brand mark (composited on its own element,
   so it never conflicts with the hero-row's reveal transform). */
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@media (prefers-reduced-motion: no-preference) {
    .logo { animation: floaty 5s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
    .js .reveal,
    .js .app.reveal-fade { opacity: 1; transform: none; transition: none; }
    .logo { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .nav-links { gap: 18px; }
    .nav-links a { font-size: 14px; }
    header.hero { padding: 44px 0 40px; }
    .logo { width: 94px; height: 94px; }
    .logo-text { font-size: 12.5px; left: 13px; bottom: 11px; }
    .grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .stat-n { font-size: 24px; }
    .shot { height: 360px; }
    .sc-head .app-link { align-self: flex-start; }
}

@media (max-width: 380px) {
    .nav-brand span:not(.nav-mark) { display: none; }
    .stats { padding: 18px 14px; }
    .shot { height: 320px; }
}
