/* omarwsadek.com — no external fonts or requests (GDPR friendly) */
:root {
  --bg: #0b0e13;
  --bg-2: #11151c;
  --card: #141922;
  --line: #232a35;
  --text: #e8e6e1;
  --muted: #9aa3ad;
  --accent: #5fd4c4;
  --accent-ink: #04201c;
  --red: #e0707a;
  --green: #7fcf8f;
  --blue: #6fa8ff;
  --amber: #e7b464;
  --radius: 18px;
  --max: 1120px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4ef;
    --bg-2: #efece5;
    --card: #ffffff;
    --line: #e2ddd3;
    --text: #16181d;
    --muted: #5d6570;
    --accent: #0f8f80;
    --accent-ink: #ffffff;
    --red: #c4444f;
    --green: #2f9a4a;
    --blue: #2f6fd6;
    --amber: #b7791f;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - var(--max)) / 2));
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.brand-mark { width: 26px; height: 26px; color: var(--text); }
.nav nav { display: flex; align-items: center; gap: 4px; }
.nav nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 15px; transition: color .2s, background .2s; }
.nav nav a:hover { color: var(--text); background: var(--bg-2); }
.nav nav a.nav-cta { color: var(--text); border: 1px solid var(--line); margin-left: 6px; }
@media (max-width: 640px) {
  .nav nav a:not(.nav-cta) { display: none; }
  .brand span { font-size: 15px; }
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { border-color: var(--line); background: color-mix(in srgb, var(--bg) 60%, transparent); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { padding: 15px 26px; font-size: 16px; }

/* HERO */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: center;
  padding: 120px max(16px, calc((100% - var(--max)) / 2)) 80px;
  overflow: hidden; isolation: isolate;
}
#tracts { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 85%, transparent) 38%, transparent 70%),
    linear-gradient(0deg, var(--bg) 0%, transparent 25%);
}
.hero-inner { max-width: 660px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero h1 { font-size: clamp(42px, 7vw, 82px); }
.hero h1 em { font-style: italic; color: var(--muted); }
.lede { margin-top: 26px; font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-caption { position: absolute; right: max(16px, calc((100% - var(--max)) / 2)); bottom: 28px; font: 12px var(--mono); color: var(--muted); opacity: .7; }
@media (max-width: 640px) { .hero-caption { left: 16px; right: auto; } .hero::after { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 60%); } }

/* SECTIONS */
.section { max-width: var(--max); margin: 0 auto; padding: 110px 16px; }
@media (min-width: 1152px) { .section { padding-left: 0; padding-right: 0; } }
.section-head { max-width: 720px; margin-bottom: 48px; }
.kicker { display: flex; align-items: center; gap: 12px; font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 18px; }
.kicker span { color: var(--accent); }
.kicker::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--line); }
.section h2 { font-size: clamp(30px, 4.2vw, 48px); }
.section-sub { margin-top: 14px; color: var(--muted); font-size: 18px; }

/* FOCUS */
.focus-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .focus-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-card {
  position: relative; padding: 28px 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.c-red { --c: var(--red); } .c-green { --c: var(--green); } .c-blue { --c: var(--blue); } .c-amber { --c: var(--amber); }
.sprite { position: absolute; }
.focus-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .8; }
.focus-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.focus-card svg { width: 44px; height: 44px; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 22px; }
.focus-card h3 { font-size: 24px; margin-bottom: 10px; }
.focus-card p { color: var(--muted); font-size: 15.5px; }

/* PROJECTS */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .projects { grid-template-columns: 1fr; } }
.project {
  display: flex; flex-direction: column; gap: 12px;
  padding: 30px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
}
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill { font: 600 12px/1 var(--mono); padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.pill-live { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill-research { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.tag { font: 12px var(--mono); color: var(--muted); }
.project h3 { font-size: 28px; margin-top: 4px; }
.project > p { color: var(--muted); }
.project-link { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 15px; width: fit-content; }
.project-link:hover { text-decoration: underline; }
.project-visual { margin-top: auto; padding-top: 12px; }

.visual-atlas { display: flex; gap: 10px; height: 120px; margin-top: auto; }
.visual-atlas span {
  flex: 1; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.visual-atlas span::after {
  content: ""; position: absolute; inset: 18% 22%; border-radius: 48% 52% 46% 54% / 55% 55% 45% 45%;
  border: 2px solid color-mix(in srgb, var(--muted) 50%, transparent);
  background: radial-gradient(circle at 38% 46%, color-mix(in srgb, var(--red) 55%, transparent) 0 12%, transparent 13%),
              radial-gradient(circle at 62% 56%, color-mix(in srgb, var(--blue) 50%, transparent) 0 10%, transparent 11%);
}
.visual-atlas span:nth-child(2)::after { inset: 22% 16%; border-radius: 50%; }
.visual-atlas span:nth-child(3)::after { inset: 16% 26%; border-radius: 50% 50% 42% 42%; }

.visual-chat { display: grid; gap: 8px; font-size: 14px; }
.visual-chat p { padding: 10px 14px; border-radius: 14px; max-width: 92%; }
.visual-chat .q { background: var(--bg-2); border: 1px solid var(--line); justify-self: end; }
.visual-chat .a { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.visual-chat .a span { display: block; margin-top: 6px; font: 12px var(--mono); color: var(--accent); }

.visual-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.visual-stats div { padding: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.visual-stats strong { display: block; font: 600 26px var(--mono); color: var(--text); }
.visual-stats small { color: var(--muted); font-size: 13px; }

.visual-steps { display: flex; align-items: center; gap: 8px; font: 13px var(--mono); }
.visual-steps span { flex: 1; text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); position: relative; }
.visual-steps span:first-child { border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); color: var(--blue); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 36px; } }
.about-body { display: grid; gap: 20px; }
.about-body p { color: var(--muted); font-size: 18px; }
.about-body .about-lead { font-family: var(--serif); font-size: clamp(24px, 2.8vw, 32px); line-height: 1.3; color: var(--text); }
.about-lead strong { font-weight: 500; font-style: italic; color: var(--accent); }
.about-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.about-list li {
  display: grid; gap: 2px; padding: 16px 20px 16px 22px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--c);
  transition: transform .2s, border-color .2s;
}
.about-list li:hover { transform: translateX(4px); }
.about-list strong { font-weight: 600; font-size: 16px; }
.about-list span { color: var(--muted); font-size: 14.5px; }

/* CONNECT */
.connect { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0; }
.connect .kicker { justify-content: center; }
.connect .kicker::after { display: none; }
.connect .section-sub { margin-bottom: 32px; }

/* FOOTER */
.footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
@media (min-width: 1152px) { .footer { padding-left: 0; padding-right: 0; } }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   MOTION LAYER
   ============================================================ */
:root { --ease: cubic-bezier(.22, .8, .22, 1); --ease-in-out: cubic-bezier(.65, 0, .35, 1); }

/* Scroll progress */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green), var(--blue), var(--accent));
}

/* Nav active indicator */
.nav nav a { position: relative; }
.nav nav a.active { color: var(--text); }
.nav nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1.5px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.nav nav a.active::after, .nav nav a:not(.nav-cta):hover::after { transform: scaleX(1); }

/* Hero entrance */
.hero h1 .line { display: block; }
.motion .rise { opacity: 0; transform: translateY(26px); filter: blur(8px); animation: rise 1.1s var(--ease) forwards; }
.motion .d1 { animation-delay: .15s; } .motion .d2 { animation-delay: .3s; } .motion .d3 { animation-delay: .48s; }
.motion .d4 { animation-delay: .7s; } .motion .d5 { animation-delay: .88s; } .motion .d6 { animation-delay: 1.4s; }
@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }
.motion .hero h1 em {
  background: linear-gradient(100deg, var(--muted) 0%, var(--muted) 40%, var(--text) 50%, var(--muted) 60%, var(--muted) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1.1s var(--ease) .48s forwards, sheen 7s var(--ease-in-out) 2s infinite;
}
@keyframes sheen { 0% { background-position: 100% 0; } 45%, 100% { background-position: -50% 0; } }
.motion #tracts { opacity: 0; animation: fade 1.6s ease .1s forwards; }
@keyframes fade { to { opacity: 1; } }

/* Scroll cue */
.scroll-cue { position: absolute; left: 50%; bottom: 26px; width: 22px; height: 36px; margin-left: -11px; border: 1.5px solid var(--line); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); }
.motion .scroll-cue span { animation: cue 2s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(13px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 640px) { .scroll-cue { display: none; } }

/* Buttons: magnetic + shine */
.btn { position: relative; overflow: hidden; transform: translate(var(--tx, 0), var(--ty, 0)); transition: transform .35s var(--ease), background .25s, border-color .25s, box-shadow .35s; }
.btn:hover { transform: translate(var(--tx, 0), calc(var(--ty, 0px) - 1px)); }
.btn-primary:hover { box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
.btn-primary:hover::after { transform: translateX(120%) skewX(-20deg); transition: transform .8s var(--ease); }

/* Staggered reveals */
.motion .reveal-group > *:not(.wave), .motion .reveal-group .focus-card, .motion .reveal-group .about-list li {
  opacity: 0; transform: translateY(24px); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease), border-color .3s;
  transition-delay: calc(var(--i, 0) * 90ms);
}
.motion .reveal-group.in > *:not(.wave), .motion .reveal-group.in .focus-card, .motion .reveal-group.in .about-list li { opacity: 1; transform: none; filter: none; }
.motion .reveal-group.in .focus-card:hover { transform: translateY(-4px); transition-delay: 0s; }
.motion .reveal-group.in .about-list li:hover { transform: translateX(5px); transition-delay: 0s; }

/* Self-drawing icons */
.motion .focus-card svg * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-in-out); transition-delay: calc(var(--i, 0) * 120ms + .35s); }
.motion .in .focus-card svg * { stroke-dashoffset: 0; }

/* Pointer glow on cards */
.focus-card, .about-list li { position: relative; overflow: hidden; isolation: isolate; }
.focus-card::after, .about-list li::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c, var(--accent)) 16%, transparent), transparent 70%);
}
.focus-card:hover::after, .about-list li:hover::after { opacity: 1; }
.motion .focus-card:hover svg { animation: wiggle 1.2s var(--ease-in-out); }
@keyframes wiggle { 30% { transform: rotate(-6deg) scale(1.06); } 60% { transform: rotate(4deg) scale(1.03); } }

/* Breathing accent on the "Focus" bars */
.motion .focus-card::before { animation: breathe 4.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.1s); }
@keyframes breathe { 50% { opacity: .35; } }

/* Connect: EEG wave */
.connect { position: relative; isolation: isolate; }
.wave { position: absolute; left: 50%; width: 100vw; margin-left: -50vw; bottom: -6px; height: 150px; opacity: .8; z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.wave svg { width: 200%; height: 100%; overflow: visible; }
.wave path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wave .w1 { stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.wave .w2 { stroke: color-mix(in srgb, var(--blue) 30%, transparent); transform: translateY(26px); }
.wave .w3 { stroke: color-mix(in srgb, var(--red) 25%, transparent); transform: translateY(-30px); }
.motion .wave-track { animation: drift 28s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }
.connect h2, .connect .section-sub, .connect .kicker, .connect .btn { position: relative; }
.connect { padding-bottom: 190px; }

/* Pulse on the LinkedIn CTA */
.motion .connect .btn-primary { animation: halo 3.2s ease-out infinite 2s; }
@keyframes halo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 18px transparent; } }

/* Brand mark hover */
.brand-mark { transition: transform .6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .progress { display: none; }
  .wave-track { animation: none !important; }
}
