/* =====================================================================
   Mosab — Portfolio (static prototype)
   v2 — aligned to the cleaner Claude Design version.
   Apple-style, contained cards, #FFA219 on action buttons only.
   ===================================================================== */

/* ----------  Tokens  ---------- */
:root, [data-theme="dark"] {
  --bg: #08080a;
  --card: #161619;
  --card2: #202024;
  --card-hover: #26262b;
  --text: #f5f5f7;
  --muted: #8a8a91;
  --faint: #6a6a70;
  --border: rgba(255, 255, 255, 0.10);
  --hair: rgba(255, 255, 255, 0.06);
  --accent: #ffa219;
  --accent-hover: #ffb347;
  --accent-ink: #1c1305;
  --shadow: 0 24px 60px -26px rgba(0, 0, 0, 0.7);
  --header-bg: color-mix(in srgb, var(--bg) 68%, transparent);
  --glow: radial-gradient(closest-side, rgba(255, 162, 25, 0.14), transparent 72%);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff;
  --card: #f1f1f4;
  --card2: #e6e6ea;
  --card-hover: #e9e9ee;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --border: rgba(0, 0, 0, 0.10);
  --hair: rgba(0, 0, 0, 0.05);
  --accent: #ffa219;
  --accent-hover: #f59300;
  --accent-ink: #3a2600;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.20);
  --header-bg: color-mix(in srgb, var(--bg) 70%, transparent);
  --glow: radial-gradient(closest-side, rgba(255, 162, 25, 0.18), transparent 72%);
  color-scheme: light;
}

/* ----------  Reset / base  ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-top: 60px;
  transition: background 0.5s ease, color 0.5s ease;
}
img, svg { display: block; max-width: 100%; }
svg[viewBox="0 0 24 24"] { width: 1em; height: 1em; flex: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Brand mark — provided logo as a theme-adaptive mask */
.logo-mark {
  display: block; flex: none;
  background-color: currentColor;
  -webkit-mask: url(../img/logo.png) center / contain no-repeat;
  mask: url(../img/logo.png) center / contain no-repeat;
}

/* ----------  Typography  ---------- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.display { font-size: clamp(46px, 8vw, 92px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }
.h-page { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.02em; line-height: 1.04; }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.5; }
.muted { color: var(--muted); }

/* ----------  Layout  ---------- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.wrap-wide { max-width: 1240px; }
.wrap-narrow { max-width: 1140px; }
.page { padding-top: 40px; padding-bottom: 40px; }
.page-pad { padding-top: 96px; padding-bottom: 44px; }
main { display: block; }

/* ----------  Buttons  ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border-radius: 980px; padding: 11px 20px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-lg { font-size: 16px; padding: 14px 24px; }
.btn-outline {
  border: 1px solid var(--border); color: var(--text); font-weight: 500; padding: 8px 16px; font-size: 14px;
}
.btn-outline:hover { background: var(--card); }
.back { margin-bottom: 36px; }
.back svg { width: 15px; height: 15px; }
.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15px; color: var(--text); }
.link-arrow .arw { transition: transform 0.25s ease; }
.link-arrow:hover .arw { transform: translateX(4px); }

/* ----------  Header  ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 80; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background 0.5s ease, border-color 0.5s ease;
}
.hdr-logo { display: inline-flex; align-items: center; padding: 6px; color: var(--text); }
.hdr-logo .logo-mark { width: 24px; height: 26px; }
.hdr-logo:hover { opacity: 0.7; }
.hdr-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; color: var(--text);
  display: grid; place-items: center; transition: background 0.2s ease;
}
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .i-menu svg { width: 22px; height: 22px; }
/* theme toggle shows the icon/label for the CURRENT theme */
[data-theme="dark"] .i-moon, [data-theme="dark"] .t-light { display: none; }
[data-theme="light"] .i-sun, [data-theme="light"] .t-dark { display: none; }

/* ----------  Menu  ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.menu {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(400px, 88vw); z-index: 100;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.25);
  transform: translateX(100%); transition: transform 0.46s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; padding: 76px 34px 34px; overflow-y: auto;
}
.menu-open .menu { transform: translateX(0); }
.menu-open .scrim { opacity: 1; pointer-events: auto; }
.menu-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; color: var(--text); display: grid; place-items: center; transition: background 0.2s; }
.menu-close:hover { background: var(--card2); }
.menu-close svg { width: 20px; height: 20px; }
.menu-nav { display: flex; flex-direction: column; gap: 2px; }
.menu-nav a { font-size: 27px; font-weight: 600; letter-spacing: -0.01em; padding: 9px 0; color: var(--text); transition: opacity 0.2s ease; }
.menu-nav a:hover { opacity: 0.55; }
.menu-nav a[aria-current="page"] { color: var(--accent); }
.menu-div { height: 1px; background: var(--border); margin: 16px 0; }
.menu-nav.sub a { font-size: 18px; font-weight: 500; color: var(--muted); padding: 7px 0; }
.menu-nav.sub a:hover { color: var(--text); opacity: 1; }
.menu-nav.sub a[aria-current="page"] { color: var(--accent); }
.menu-foot { margin-top: auto; padding-top: 24px; margin-top: auto; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.menu-foot .lbl { color: var(--muted); font-size: 13px; padding-top: 20px; }
.menu-appearance { margin-top: 20px; border: 1px solid var(--border); background: var(--card2); color: var(--text); border-radius: 980px; padding: 8px 16px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.menu-appearance:hover { background: var(--card-hover); }
.menu-social { display: flex; gap: 10px; margin-top: 22px; }

/* Round social icon links (about / say-hi / menu) */
.soc { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); color: var(--text); display: grid; place-items: center; transition: background 0.2s ease, transform 0.2s ease; }
.soc:hover { background: var(--card); transform: translateY(-2px); }
.soc svg { width: 19px; height: 19px; }

/* ----------  Hero banner + section head  ---------- */
.hero {
  position: relative; width: 100%; height: clamp(260px, 40vw, 460px);
  border: 1px solid var(--border); background: var(--card); border-radius: 26px;
  display: grid; place-items: center; overflow: hidden;
}
.hero.short { height: clamp(240px, 34vw, 400px); }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--glow); }
.hero img { position: relative; max-width: 74%; max-height: 84%; width: auto; object-fit: contain; }
.head { margin: 52px 0 34px; }
.head .lead { max-width: 640px; margin-top: 16px; }

/* ----------  Grids  ---------- */
.grid { display: grid; }
.g2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.g3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.g5 { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.home-cols { grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ----------  Generic card  ---------- */
.card {
  border: 1px solid var(--border); background: var(--card); border-radius: 22px;
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1), border-color 0.3s ease;
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--text) 20%, transparent); }

/* ----------  Home numbered cards  ---------- */
.hero-home { text-align: center; padding: 118px 0 26px; }
.hcard {
  display: flex; flex-direction: column; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); border-radius: 28px;
  padding: 32px 30px; min-height: 60vh; overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.6, 0.2, 1), border-color 0.3s ease;
}
.hcard:hover { transform: translateY(-7px); border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.hcard .num { font-size: 12px; color: var(--muted); letter-spacing: 0.16em; }
.hcard h2 { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -0.02em; margin-top: 8px; }
.hcard p { color: var(--muted); font-size: 17px; line-height: 1.5; margin-top: 12px; max-width: 280px; }
.hcard .media { margin-top: 28px; flex: 1; min-height: 220px; display: grid; place-items: center; overflow: hidden; }
.hcard .media img { max-width: 92%; max-height: 100%; object-fit: contain; transition: transform 0.5s ease; }
.hcard:hover .media img { transform: translateY(-6px) scale(1.02); }

/* ----------  Portfolio (brand) cards  ---------- */
.bcard { position: relative; overflow: hidden; cursor: pointer; border: 1px solid var(--border); background: var(--card); border-radius: 20px; aspect-ratio: 4 / 5; }
.bcard .zoom { width: 100%; height: 100%; transition: transform 0.55s cubic-bezier(0.2, 0.6, 0.2, 1); }
.bcard .zoom img { width: 100%; height: 100%; object-fit: cover; }
.bcard:hover .zoom { transform: scale(1.05); }
.bcard .ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; opacity: 0; transition: opacity 0.35s ease; background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0) 62%); }
.bcard:hover .ov { opacity: 1; }
.bcard .ov .name { color: #fff; font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.bcard .ov .cat { color: rgba(255,255,255,0.68); font-size: 14px; margin-top: 3px; }
.bcard .ov .cta { margin-top: 14px; color: var(--accent); font-weight: 600; font-size: 14px; }

/* ----------  Project cards  ---------- */
.pcard { display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; cursor: pointer; }
.pcard .media { width: 100%; height: clamp(200px, 26vw, 320px); background: var(--card2); overflow: hidden; }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 28px 28px 30px; }
.pcard h2 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.01em; }
.pcard p { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 12px 0 22px; max-width: 460px; }

/* ----------  Course cards  ---------- */
.ccard { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; cursor: pointer; }
.ccard .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--card2); overflow: hidden; }
.ccard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ccard .badge { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 980px; }
.ccard .body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.ccard h2 { font-size: 20px; letter-spacing: -0.01em; }
.ccard p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 8px 0 18px; flex: 1; }
.ccard .btn { align-self: flex-start; }

/* ----------  Shortcut cards (neutral card + colored icon tile) ---------- */
.scard { display: flex; flex-direction: column; gap: 16px; padding: 26px; border-radius: 22px; }
.scard .sicon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; }
.scard .sicon svg { width: 26px; height: 26px; color: #fff; }
.scard .s-body { flex: 1; }
.scard h2 { font-size: 21px; letter-spacing: -0.01em; }
.scard p { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 8px; }
.scard .btn { align-self: flex-start; }

/* ----------  Wallpaper cards  ---------- */
.wcard { position: relative; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; aspect-ratio: 9 / 16; background: var(--card); }
.wcard img { width: 100%; height: 100%; object-fit: cover; }
.wcard .save { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%) translateY(6px); background: var(--accent); color: var(--accent-ink); border-radius: 980px; padding: 8px 15px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.wcard .save svg { width: 13px; height: 13px; }
.wcard:hover .save { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----------  Blog cards  ---------- */
.blcard { display: flex; flex-direction: column; min-height: 230px; padding: 28px; border-radius: 22px; cursor: pointer; }
.blcard h2 { font-size: 23px; letter-spacing: -0.01em; line-height: 1.2; }
.blcard p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 12px 0 22px; flex: 1; }

/* ----------  About  ---------- */
.split2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; }
.about-photo { width: 100%; height: clamp(340px, 44vw, 520px); border: 1px solid var(--border); border-radius: 26px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 120% at 30% 20%, var(--card2), var(--bg)); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo .logo-mark { width: 66px; height: 72px; color: var(--faint); }
.about-info h1 { font-size: clamp(40px, 5.4vw, 64px); letter-spacing: -0.03em; line-height: 1; }
.about-info .role { color: var(--accent); font-size: 18px; font-weight: 600; margin-top: 12px; }
.about-info .bio { color: var(--muted); font-size: 18px; line-height: 1.6; margin-top: 20px; max-width: 480px; }
.about-socials { display: flex; gap: 12px; margin-top: 28px; }
.latest { margin-top: 72px; }
.latest-label { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mini-card { overflow: hidden; border-radius: 24px; cursor: pointer; }
.mini-card .media { width: 100%; height: clamp(180px, 24vw, 260px); background: var(--card2); overflow: hidden; }
.mini-card .media img { width: 100%; height: 100%; object-fit: cover; }
.mini-card .body { padding: 24px; }
.mini-card .kicker { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.mini-card h3 { font-size: 24px; letter-spacing: -0.01em; margin-top: 8px; }
.mini-card p { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 10px; }

/* ----------  Say Hi  ---------- */
.contact { max-width: 620px; margin-inline: auto; text-align: center; padding-top: 120px; }
.contact .lead { max-width: 460px; margin: 18px auto 0; }
.form { margin-top: 44px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.form input, .form textarea { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 14px; padding: 15px 18px; font-size: 16px; font-family: inherit; outline: none; transition: border-color 0.2s ease; width: 100%; }
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.form textarea { resize: vertical; min-height: 130px; }
.form .btn { margin-top: 6px; padding: 15px; }
.contact-socials { display: flex; justify-content: center; gap: 12px; margin-top: 40px; }
.contact-socials .soc { width: 46px; height: 46px; }

/* ----------  Detail: brand + project  ---------- */
.icon-frame { width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--border); border-radius: 26px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.icon-frame img, .icon-frame svg { width: 100%; height: 100%; object-fit: cover; }
.detail-eyebrow { display: block; font-size: 13px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.detail-info h1 { font-size: clamp(38px, 5vw, 60px); letter-spacing: -0.03em; line-height: 1; margin-top: 10px; }
.detail-info .desc { color: var(--muted); font-size: 18px; line-height: 1.6; margin: 20px 0 0; max-width: 470px; }
.detail-info .desc + .btn { margin-top: 30px; }

/* mixed horizontal + vertical gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 190px; grid-auto-flow: dense; gap: 14px; margin-top: 56px; }
.gallery .cell { overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: var(--card); }
.gallery .cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery .cell:hover img { transform: scale(1.04); }
.cell-tall { grid-row: span 2; }
.cell-wide { grid-column: span 2; }

/* ----------  Detail: course  ---------- */
.videos { margin-top: 48px; display: flex; flex-direction: column; gap: 40px; }
.video h2 { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 16px; }
.video .frame { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ----------  Detail: blog  ---------- */
.prose { max-width: 720px; margin-inline: auto; }
.prose h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.025em; line-height: 1.08; }
.prose .byline { color: var(--muted); font-size: 15px; margin: 16px 0 40px; }
.prose .body { font-size: 18px; line-height: 1.7; color: var(--text); }
.prose .body h2 { font-size: 25px; margin: 40px 0 14px; letter-spacing: -0.02em; }
.prose .body p { margin: 0 0 22px; color: var(--muted); }
.prose .body strong { color: var(--text); font-weight: 600; }

/* ----------  Footer  ---------- */
.foot { border-top: 1px solid var(--border); padding: 54px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 40px; }
.foot .logo-mark { width: 24px; height: 26px; color: var(--muted); }
.foot p { color: var(--muted); font-size: 13px; text-align: center; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

/* ----------  Reveal  ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.2,0.6,0.2,1), transform 0.7s cubic-bezier(0.2,0.6,0.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ----------  Responsive  ---------- */
@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .g5 { grid-template-columns: repeat(2, 1fr); }
  .g2 { grid-template-columns: 1fr; }
  .home-cols { grid-template-columns: 1fr; }
  .split2, .two-col { grid-template-columns: 1fr; }
  .hcard { min-height: 52vh; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .about-photo { max-height: 460px; }
}
@media (max-width: 560px) {
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .g4, .g5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 430px) {
  .g3, .g4 { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
