/* Marawan & Youssef portfolio. One stylesheet for the website pages; play.css adds the game UI. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/geist.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('/assets/fonts/geist-mono.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Pixelify Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/pixelify-sans.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f2f4f9;
  --surface: #fbfcfe;
  --surface-2: #e7ebf4;
  --ink: #141a2e;
  --muted: #4f5874;
  --line: #d3d9e8;
  --shadow: #c5cde0;
  --accent: #f3b33d;
  --accent-hi: #ffca5c;
  --accent-lo: #a8741a;
  --accent-ink: #291c02;
  --btn2: #dde3f0;
  --btn2-hi: #e9edf6;
  --btn2-lo: #9aa4bf;
  --online: #1f9d5c;
  --outline: #141a2e;
  --vouch: #5b54e0;
  --mizan: #16827a;
  --flows: #2f9e6a;
  --pixel: 'Pixelify Sans', 'Courier New', monospace;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --wrap: 1180px;
  --step: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1222;
    --surface: #161a30;
    --surface-2: #1d2240;
    --ink: #eef0fa;
    --muted: #a6adca;
    --line: #2b3154;
    --shadow: #070913;
    --accent: #f5bf48;
    --accent-hi: #ffd574;
    --accent-lo: #9c6c16;
    --btn2: #2a3057;
    --btn2-hi: #343b69;
    --btn2-lo: #151931;
    --online: #4ade80;
    --outline: #070913;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.pixelated { image-rendering: pixelated; }

/* ---------- Type ---------- */
.display { font-family: var(--pixel); font-weight: 600; letter-spacing: -0.01em; }
h1.display { font-size: clamp(42px, 6vw, 74px); line-height: 1.02; }
h2.display { font-size: clamp(32px, 4vw, 46px); line-height: 1.05; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 58ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dot { width: 10px; height: 10px; background: var(--online); box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 25%, transparent); }
@media (prefers-reduced-motion: no-preference) { .dot { animation: blink 2.4s steps(2, jump-none) infinite; } }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- Pixel buttons ---------- */
.btn {
  --face: var(--accent); --face-hi: var(--accent-hi); --depth: var(--accent-lo); --label: var(--accent-ink);
  position: relative; display: inline-block; padding: 0 0 6px; border: 0; background: none;
  font: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn.alt { --face: var(--btn2); --face-hi: var(--btn2-hi); --depth: var(--btn2-lo); --label: var(--ink); }
.btn .depth { position: absolute; inset: 6px 0 0; background: var(--depth); clip-path: var(--step); }
.btn .face {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 20px 13px;
  background: var(--face); color: var(--label); clip-path: var(--step);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  font-family: var(--pixel); font-weight: 600; font-size: 19px; line-height: 1.15; white-space: nowrap;
  transition: transform 80ms steps(2), background-color 80ms steps(2);
}
.btn:hover .face { background: var(--face-hi); transform: translateY(-2px); }
.btn:active .face { transform: translateY(6px); box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.12); }
.btn.big .face { padding: 18px 28px 19px; font-size: clamp(22px, 2.4vw, 28px); gap: 14px; }
.btn.small .face { padding: 8px 14px 9px; font-size: 16px; gap: 8px; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .btn .face { transition: none; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; }

.chip { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.textlink { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-weight: 600; font-size: 21px; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 45px; height: 20px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links { display: none; } .brand span { display: none; } }

/* ---------- Reveal on scroll (content is visible without JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
section { scroll-margin-top: 76px; }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 44px); }

/* Hero */
.hero { padding-block: clamp(36px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero-copy .btn-row { margin-top: 6px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

.screen-frame {
  position: relative; display: block; width: 100%; padding: 10px; text-decoration: none;
  background: var(--outline); clip-path: var(--step); box-shadow: 0 0 0 0 transparent;
}
.screen-frame .viewport { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #1f5230; }
.screen-frame canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; }
.screen-frame .play-tag {
  position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #fff8e1; color: #1c1a2a; font-family: var(--pixel); font-weight: 600; font-size: 16px;
  box-shadow: 0 0 0 3px #1c1a2a;
}
.screen-frame:hover .play-tag { background: var(--accent-hi); }

/* Stack strip */
.stack { border-block: 1px solid var(--line); padding-block: 22px; }
.stack ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; }
.stack li { color: var(--muted); }
.stack svg { width: 30px; height: 30px; display: block; }
@media (max-width: 640px) { .stack ul { justify-content: center; } .stack svg { width: 26px; height: 26px; } }

/* Work bento */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.work { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.work.vouch { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: auto; }
.work.mizan { grid-column: 1 / span 6; }
.work.flows { grid-column: 7 / span 6; }
.work .shot { overflow: hidden; border-bottom: 2px solid var(--outline); padding: 16px 16px 0; display: flex; align-items: flex-end; }
.work.vouch .shot { border-bottom: 0; border-right: 2px solid var(--outline); padding: 22px 22px 0; }
.work.vouch .shot { background: color-mix(in srgb, var(--vouch) 30%, var(--surface)); }
.work.mizan .shot { background: color-mix(in srgb, var(--mizan) 30%, var(--surface)); }
.work.flows .shot { background: color-mix(in srgb, var(--flows) 30%, var(--surface)); }
.work .shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border: 2px solid var(--outline); border-bottom: 0; }
.work .body { display: grid; gap: 12px; align-content: start; padding: 20px 22px 22px; }
.work.vouch .body { align-content: center; padding: clamp(22px, 3vw, 36px); }
.work h3 { font-family: var(--pixel); font-weight: 600; font-size: 28px; line-height: 1.1; }
.work.vouch h3 { font-size: clamp(32px, 3.4vw, 40px); }
.work p { color: var(--muted); }
.work .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; }
.work .note { font-size: 14px; color: var(--muted); }
.work.mizan .shot { padding: 0; }
.work.mizan .shot img { border: 0; }
@media (max-width: 900px) {
  .work.vouch { grid-template-columns: minmax(0, 1fr); }
  .work.vouch .shot { border-right: 0; border-bottom: 2px solid var(--outline); padding: 16px 16px 0; }
  .work.mizan, .work.flows { grid-column: 1 / -1; }
}

/* Game banner */
.game-banner {
  margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch;
  background: var(--outline); color: #f4f2ff; border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow);
}
.game-banner .banner-copy { display: grid; gap: 18px; align-content: center; justify-items: start; padding: clamp(24px, 4vw, 44px); background: #1b1f3a; }
.game-banner h3 { font-family: var(--pixel); font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; }
.game-banner p { color: #c3c8e6; max-width: 44ch; }
.game-banner .banner-copy a:not(.btn) { color: #f4f2ff; }
.game-banner .viewport { position: relative; min-height: 260px; overflow: hidden; background: #1f5230; }
.game-banner canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: pixelated; }
@media (max-width: 800px) { .game-banner { grid-template-columns: minmax(0, 1fr); } .game-banner .viewport { min-height: 220px; order: -1; } }

/* Team */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.person .avatar { width: 128px; padding: 14px 16px 0; background: linear-gradient(#8fd0ff 0 62%, #5dab56 62%); border: 2px solid var(--outline); box-shadow: 4px 4px 0 var(--shadow); }
.person .avatar canvas { width: 96px; height: 150px; image-rendering: pixelated; }
.person .info { display: grid; gap: 8px; }
.person h3 { font-size: 22px; font-weight: 600; }
.person .role { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.person p { color: var(--muted); }
.edu { margin-top: 36px; display: flex; gap: 10px; align-items: center; color: var(--muted); }
@media (max-width: 860px) { .team { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .person { grid-template-columns: minmax(0, 1fr); } }

/* Services */
.services { display: grid; }
.service { display: grid; grid-template-columns: 56px minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 20px 28px; padding-block: 28px; border-top: 2px solid var(--line); align-items: start; }
.service:last-child { border-bottom: 2px solid var(--line); }
.service .glyph { width: 48px; height: 48px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); clip-path: var(--step); }
.service .glyph svg { width: 26px; height: 26px; }
.service h3 { font-family: var(--pixel); font-weight: 600; font-size: 26px; line-height: 1.15; }
.service .text { display: grid; gap: 10px; color: var(--muted); }
.service .proof { font-size: 15px; color: var(--ink); }
@media (max-width: 760px) { .service { grid-template-columns: 48px minmax(0, 1fr); } .service .text { grid-column: 2; } }

/* Remote facts */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fact { display: grid; gap: 12px; align-content: start; padding: 22px; background: var(--surface); border: 2px solid var(--line); }
.fact svg { width: 28px; height: 28px; color: var(--ink); }
.fact h3 { font-size: 18px; font-weight: 600; }
.fact p { color: var(--muted); font-size: 16px; }
@media (max-width: 980px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Contact */
.contact { background: var(--surface-2); border-block: 2px solid var(--line); }
.contact-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact-card { display: grid; gap: 16px; padding: 26px; background: var(--surface); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); }
.contact-card header { display: flex; gap: 14px; align-items: center; }
.contact-card header canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.contact-card h3 { font-size: 21px; font-weight: 600; }
.contact-card .addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); font-size: 14.5px; color: var(--muted); word-break: break-all; }
.copy { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 500 13px var(--sans); cursor: pointer; }
.copy:hover { border-color: var(--ink); }
@media (max-width: 760px) { .contact-cards { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.footer { padding-block: 36px 48px; color: var(--muted); font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- Case studies page ---------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) 24px; }
.page-head .wrap { display: grid; gap: 18px; justify-items: start; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; }
.jump a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--outline); background: var(--surface); text-decoration: none; font-weight: 600; }
.jump a:hover { background: var(--surface-2); }
.jump i { width: 12px; height: 12px; display: inline-block; }

.case { padding-block: clamp(48px, 7vw, 88px); border-top: 2px solid var(--line); }
.case .wrap { display: grid; gap: 32px; }
.case-head { display: grid; gap: 14px; }
.case-head .tag { display: inline-flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.case-head .tag i { width: 12px; height: 12px; display: inline-block; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border: 2px solid var(--outline); background: var(--surface); }
.meta div { padding: 16px 18px; border-left: 2px solid var(--line); }
.meta div:first-child { border-left: 0; }
.meta dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 15.5px; }
@media (max-width: 860px) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meta div:nth-child(3) { border-left: 0; } .meta div:nth-child(n + 3) { border-top: 2px solid var(--line); } }
@media (max-width: 480px) { .meta { grid-template-columns: minmax(0, 1fr); } .meta div { border-left: 0; } .meta div + div { border-top: 2px solid var(--line); } }

.case-video { margin: 0; border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); background: #000; }
.case-video video { width: 100%; aspect-ratio: 16 / 9; }
.case-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 48px; }
.case-body section { display: grid; gap: 10px; align-content: start; }
.case-body h3 { font-family: var(--pixel); font-weight: 600; font-size: 24px; }
.case-body p, .case-body li { color: var(--muted); }
.case-body ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.case-body li::marker { color: var(--accent-lo); }
@media (max-width: 820px) { .case-body { grid-template-columns: minmax(0, 1fr); } }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shots figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.shots button { padding: 0; border: 2px solid var(--outline); background: var(--surface-2); cursor: zoom-in; }
.shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.shots figcaption { font-size: 14px; color: var(--muted); }
.case-links { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }

/* Lightbox */
.lightbox { width: min(1200px, 96vw); max-height: 94vh; padding: 0; border: 2px solid var(--outline); background: var(--surface); color: var(--ink); }
.lightbox::backdrop { background: rgba(8, 10, 22, 0.78); }
.lightbox figure { margin: 0; display: grid; }
.lightbox img { width: 100%; max-height: calc(94vh - 72px); object-fit: contain; background: var(--surface-2); }
.lightbox figcaption { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 15px; color: var(--muted); }
.lightbox .nav-btns { display: flex; gap: 8px; }
.lightbox button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--outline); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.lightbox button svg { width: 20px; height: 20px; }
