/* ============================================================
   Mahmoud Alyosify — Choose Your CV
   Restyled to share the parent site's design system (tokens
   mirrored from ../css/theme.css) rather than a standalone theme.
   ============================================================ */

/* Fonts are loaded via <link> in index.html (parallel with the page,
   unlike @import which would block on this file first). */

:root {
  --void:      #05070f;
  --navy:      #0b1030;
  --indigo:    #2a1f6b;
  --violet:    #6b3fd4;
  --magenta:   #b14bd8;
  --amber:     #f0a13a;
  --coral:     #e86a4d;
  --beam:      #eaf4ff;
  --teal:      #3ad0c8;

  --bg:            var(--void);
  --bg-panel:      #0e1330;
  --bg-glass:      rgba(20, 26, 66, 0.55);

  --line:          rgba(234, 244, 255, 0.08);
  --line-strong:   rgba(234, 244, 255, 0.16);
  --line-glow:     rgba(107, 63, 212, 0.45);

  --ink:           #f2f5ff;
  --ink-soft:      #a8b2d8;
  --ink-mute:      #6b769e;

  --beam-gradient:   linear-gradient(100deg, var(--violet) 0%, var(--magenta) 42%, var(--amber) 70%, #ffffff 100%);
  --panel-gradient:  linear-gradient(150deg, rgba(42, 31, 107, 0.30) 0%, rgba(11, 16, 48, 0.55) 100%);

  --glow-violet: 0 0 48px rgba(107, 63, 212, 0.35);
  --glow-amber:  0 0 48px rgba(240, 161, 58, 0.28);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.6);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --fs-hero:  clamp(2.25rem, 6vw, 3.75rem);
  --fs-h2:    clamp(1.5rem, 3vw, 2.1rem);
  --fs-lead:  clamp(1rem, 1.4vw, 1.15rem);
  --fs-sm:    0.875rem;
  --fs-xs:    0.78rem;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --page-max: 1160px;
  --page-px:  clamp(20px, 5vw, 56px);

  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-full: 999px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s var(--ease-soft);
  --t-mid:  0.35s var(--ease-out);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

::selection { background: var(--violet); color: var(--beam); }

:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--violet), var(--magenta));
  border-radius: var(--r-full);
  border: 2px solid var(--void);
}

h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }

.beam-text {
  background: var(--beam-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Buttons (mirrors ../css/theme.css .btn) ─────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 13px 26px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-mid), border-color var(--t-mid), color var(--t-mid);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  color: var(--void);
  background: var(--beam-gradient);
  background-size: 200% 100%;
  box-shadow: var(--glow-violet);
}
.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: var(--glow-amber), 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(234, 244, 255, 0.03);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--magenta);
  color: var(--beam);
  box-shadow: var(--glow-violet);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   BACKGROUND — canvas particles + aurora blobs
   ══════════════════════════════════════════════════════════ */
#bg-canvas { position: fixed; inset: 0; z-index: -2; opacity: 0.7; }

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  will-change: transform;
}
.blob-a { width: 46vw; height: 46vw; top: -14vw; left: -10vw; background: var(--violet); animation: drift-a 22s var(--ease-soft) infinite alternate; }
.blob-b { width: 38vw; height: 38vw; bottom: -12vw; right: -8vw; background: var(--magenta); animation: drift-b 26s var(--ease-soft) infinite alternate; }
.blob-c { width: 30vw; height: 30vw; top: 40%; left: 55%; background: var(--amber); opacity: 0.16; animation: drift-c 30s var(--ease-soft) infinite alternate; }

@keyframes drift-a { to { transform: translate(6vw, 8vw) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-5vw, -6vw) scale(1.08); } }
@keyframes drift-c { to { transform: translate(-4vw, 5vw) scale(0.95); } }

/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) var(--page-px);
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(240, 161, 58, 0.45));
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; }
.brand-text span { font-size: var(--fs-xs); color: var(--ink-mute); }

.social-links { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.social-links a {
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.social-links a:hover { border-color: var(--line-glow); color: var(--ink); transform: translateY(-2px); }

/* ══════════════════════════════════════════════════════════
   MAIN / VIEWS
   ══════════════════════════════════════════════════════════ */
main {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 0 var(--page-px) var(--s-8);
}

.view[hidden] { display: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { padding-block: clamp(56px, 9vw, 96px) var(--s-7); text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: var(--s-4);
}
.eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  border-radius: var(--r-full);
  background: var(--beam-gradient);
}
.hero h1 { font-size: var(--fs-hero); margin-bottom: var(--s-4); }
.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: var(--amber);
  min-height: 1.6em;
  margin-bottom: var(--s-3);
}
.caret {
  display: inline-block;
  width: 2px; height: 1em;
  margin-inline-start: 3px;
  background: var(--amber);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { to { opacity: 0; } }
.hero-prompt { color: var(--ink-soft); max-width: 56ch; margin-inline: auto; font-size: var(--fs-lead); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  position: relative;
  max-width: 480px;
  margin: 0 auto var(--s-7);
}
.filter-icon {
  position: absolute;
  inset-inline-start: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-mute);
  pointer-events: none;
}
#role-filter {
  width: 100%;
  padding: 13px 18px 13px 46px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: rgba(5, 7, 15, 0.55);
  color: var(--ink);
  font-size: var(--fs-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
#role-filter::placeholder { color: var(--ink-mute); }
#role-filter:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(177, 75, 216, 0.16);
  background: rgba(5, 7, 15, 0.8);
}

/* ── Role groups / cards ──────────────────────────────────── */
.role-groups { display: grid; gap: var(--s-7); }
.role-group[hidden] { display: none; }
.group-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--s-4);
}

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); }

.role-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  text-align: start;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel-gradient);
  overflow: hidden;
  transition: border-color var(--t-mid), transform var(--t-mid), box-shadow var(--t-mid);
}
.role-card::before {
  content: '';
  position: absolute;
  inset-inline: 12%;
  top: -1px;
  height: 1px;
  background: var(--beam-gradient);
  opacity: 0;
  transition: opacity var(--t-mid);
}
.role-card:hover, .role-card:focus-visible {
  border-color: var(--line-glow);
  box-shadow: var(--shadow-md), var(--glow-violet);
  transform: translateY(-4px);
}
.role-card:hover::before, .role-card:focus-visible::before { opacity: 1; }

.role-icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(107, 63, 212, 0.12);
}
.role-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.role-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.role-audience { font-size: var(--fs-xs); color: var(--ink-soft); line-height: 1.55; }
.role-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--ink-mute);
  transition: transform var(--t-mid), color var(--t-mid);
}
.role-card:hover .role-arrow, .role-card:focus-visible .role-arrow { transform: translateX(4px); color: var(--amber); }

.featured-card {
  background: linear-gradient(150deg, rgba(240, 161, 58, 0.14) 0%, rgba(42, 31, 107, 0.4) 100%);
  border-color: rgba(240, 161, 58, 0.25);
}
.featured-card .role-icon { background: rgba(240, 161, 58, 0.16); }
.featured-card .role-title { font-size: 1.1rem; }

.no-results { text-align: center; color: var(--ink-mute); padding: var(--s-6) 0; }
.no-results span { color: var(--ink-soft); }

/* ══════════════════════════════════════════════════════════
   CV VIEW
   ══════════════════════════════════════════════════════════ */
#cv-view { padding-top: var(--s-6); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 9px 16px 9px 12px;
  margin-bottom: var(--s-6);
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.back-btn svg { width: 16px; height: 16px; }
.back-btn:hover { border-color: var(--magenta); color: var(--ink); transform: translateX(-3px); }

.cv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.cv-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(107, 63, 212, 0.12);
}
.cv-heading { flex: 1; min-width: 200px; }
.cv-heading h2 { font-size: var(--fs-h2); margin-bottom: 4px; }
.cv-heading p { color: var(--ink-soft); font-size: var(--fs-sm); }
.cv-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

.pdf-frame-wrap {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.pdf-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #e8685a; }
.dot-y { background: #e8b750; }
.dot-g { background: #4dc98f; }
.pdf-chrome-name {
  margin-inline-start: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}
#pdf-frame {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  border: 0;
  background: #fff;
}
.pdf-fallback {
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  border-top: 1px solid var(--line);
}
.pdf-fallback a { color: var(--amber); border-bottom: 1px solid rgba(240, 161, 58, 0.35); }
.pdf-fallback a:hover { color: var(--beam); border-bottom-color: var(--beam); }

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.site-footer {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: var(--s-6) var(--page-px);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}
.site-footer a { color: var(--ink-soft); transition: color var(--t-fast); }
.site-footer a:hover { color: var(--magenta); }

/* ══════════════════════════════════════════════════════════
   REVEAL — simple entrance stagger, disabled under reduced motion
   ══════════════════════════════════════════════════════════ */
.reveal { animation: reveal-in 0.6s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.role-card.reveal { animation-delay: calc(var(--d, 0) * 45ms); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .social-links { width: 100%; }
  .cv-actions { width: 100%; }
  .cv-actions .btn { flex: 1; }
  #pdf-frame { height: 70vh; }
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; opacity: 0.18; }
  .reveal { animation: none; opacity: 1; transform: none; }
}
