/* =========================================================
   Yazan Khaled Ghedan — QA Engineer Portfolio
   Design system: "QA console" — precise, systematic, verified
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Dark theme (default) */
  --bg:          #0b1220;
  --bg-alt:      #0e1626;
  --surface:     #121c30;
  --surface-2:   #17223a;
  --border:      rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:        #e7ecf5;
  --text-soft:   #b3c0d6;
  --muted:       #7d8ba6;

  --accent:      #35d0ba;   /* verification teal */
  --accent-soft: rgba(53, 208, 186, 0.14);
  --accent-line: rgba(53, 208, 186, 0.35);
  --signal:      #f7b955;   /* amber — reserved for "current" role only */
  --signal-soft: rgba(247, 185, 85, 0.14);

  --shadow:      0 18px 40px -24px rgba(0, 0, 0, 0.75);
  --shadow-sm:   0 8px 22px -16px rgba(0, 0, 0, 0.7);

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1120px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 68px;
}

[data-theme="light"] {
  --bg:          #f5f7fb;
  --bg-alt:      #eef2f8;
  --surface:     #ffffff;
  --surface-2:   #f3f6fb;
  --border:      rgba(14, 23, 38, 0.10);
  --border-strong: rgba(14, 23, 38, 0.18);

  --text:        #0e1726;
  --text-soft:   #33415a;
  --muted:       #5a6a83;

  --accent:      #0c9a86;
  --accent-soft: rgba(12, 154, 134, 0.12);
  --accent-line: rgba(12, 154, 134, 0.30);
  --signal:      #b8791a;
  --signal-soft: rgba(184, 121, 26, 0.12);

  --shadow:      0 18px 40px -28px rgba(20, 40, 80, 0.35);
  --shadow-sm:   0 8px 22px -18px rgba(20, 40, 80, 0.30);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* Accessibility: skip link + focus */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #06231e; padding: .55rem 1rem;
  border-radius: 8px; font-weight: 600; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  --pad-y: .72rem;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: var(--pad-y) 1.15rem;
  border-radius: 999px;
  font-weight: 600; font-size: .94rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--sm { --pad-y: .5rem; font-size: .85rem; padding-inline: .9rem; }
.btn--full { justify-content: center; width: 100%; }
.btn--primary {
  background: var(--accent); color: #06231e; border-color: transparent;
}
[data-theme="light"] .btn--primary { color: #ffffff; }
.btn--primary:hover { box-shadow: 0 14px 30px -14px var(--accent); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand__mark {
  font-family: var(--font-mono); font-weight: 700; font-size: .95rem;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
}
.brand__name { font-family: var(--font-display); letter-spacing: -0.01em; }

.nav__links { display: flex; gap: 1.4rem; }
.nav__links a {
  font-size: .92rem; color: var(--text-soft); font-weight: 500;
  position: relative; padding: .3rem 0; transition: color .2s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after, .nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: .6rem; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .2s ease, transform .18s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Hamburger */
.menu-btn { display: none; flex-direction: column; gap: 5px; width: 40px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center; }
.menu-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu panel */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 90;
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.mobile-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu nav { display: flex; flex-direction: column; gap: .3rem; padding: 1rem var(--gutter) 1.6rem; }
.mobile-menu a { padding: .75rem .4rem; font-weight: 500; color: var(--text-soft); border-bottom: 1px solid var(--border); }
.mobile-menu a.btn { margin-top: .8rem; border-bottom: none; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5.5rem); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 82% 8%, var(--accent-soft), transparent 60%),
    radial-gradient(50% 50% at 8% 100%, var(--signal-soft), transparent 55%);
  pointer-events: none;
}
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em;
  color: var(--muted); margin-bottom: 1.1rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.hero__title { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 700; }
.hero__title-accent { color: var(--accent); }
.hero__lead { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--text); margin-top: 1.3rem; max-width: 34ch; font-weight: 500; }
.hero__sub { color: var(--muted); margin-top: 1rem; max-width: 46ch; font-size: 1rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* Console signature */
.console {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; font-family: var(--font-mono);
}
.console__bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .7rem .9rem; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.console__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.console__dot:nth-child(1) { background: #ff5f57; }
.console__dot:nth-child(2) { background: #febc2e; }
.console__dot:nth-child(3) { background: #28c840; }
.console__file { margin-left: auto; font-size: .78rem; color: var(--muted); }
.console__body { padding: 1.1rem 1.2rem 1.3rem; font-size: .9rem; }
.console__cmd { color: var(--text-soft); margin-bottom: .9rem; }
.console__cmd .prompt { color: var(--accent); margin-right: .5rem; }
.console__lines li {
  display: flex; align-items: center; gap: .6rem;
  padding: .32rem 0; color: var(--text);
  opacity: 0; transform: translateX(-6px);
}
.console__lines li.show { opacity: 1; transform: translateX(0); transition: opacity .3s ease, transform .3s ease; }
.console__lines .tick { color: var(--accent); font-weight: 700; }
.console__lines .pass {
  margin-left: auto; font-size: .72rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: .1rem .45rem;
}
.console__summary {
  margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--border-strong);
  color: var(--muted); font-size: .82rem; opacity: 0; transition: opacity .4s ease;
}
.console__summary.show { opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--alt { background: var(--bg-alt); }
.section__eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: .85rem; letter-spacing: .02em; margin-bottom: .7rem; }
.section__title { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 600; max-width: 20ch; margin-bottom: 2.4rem; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.about__text p { color: var(--text-soft); font-size: 1.06rem; }
.about__text p + p { margin-top: 1.1rem; }
.about__facts {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem 1.2rem; box-shadow: var(--shadow-sm);
}
.about__facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.about__facts li:last-child { border-bottom: none; }
.fact__label { color: var(--muted); font-family: var(--font-mono); font-size: .82rem; }
.fact__value { font-weight: 600; text-align: right; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: .5rem; padding-left: 1.8rem; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: 1.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: calc(-1.8rem - 7px); top: .35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.tl-item--current .tl-node {
  background: var(--signal); border-color: var(--signal);
  box-shadow: 0 0 0 5px var(--signal-soft);
}
.tl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, border-color .2s ease;
}
.tl-card:hover { transform: translateX(3px); border-color: var(--border-strong); }
.tl-item--current .tl-card { border-color: var(--signal-soft); }
.tl-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tl-role { font-size: 1.25rem; font-weight: 600; }
.tl-meta { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.tl-desc { color: var(--text-soft); margin-top: .6rem; }

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  padding: .2rem .6rem; border-radius: 999px;
}
.badge--live { background: var(--signal-soft); color: var(--signal); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--signal-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }

.dev-highlights {
  margin-top: 2rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm);
}
.dev-highlights__label { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); margin-bottom: 1rem; }
.dev-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1.6rem; }
.dev-list li { color: var(--text-soft); position: relative; padding-left: 1.1rem; font-size: .98rem; }
.dev-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.dev-list strong { color: var(--text); font-weight: 600; }

/* ---------- Skills ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.skill-card__title { font-size: 1.1rem; font-weight: 600; display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1rem; }
.skill-card__idx { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .3rem .65rem; border-radius: 8px;
}
.tag--accent { color: var(--accent) !important; background: var(--accent-soft) !important; border-color: var(--accent-line) !important; font-weight: 600; }

/* ---------- Projects ---------- */
.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.project-card__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.project-card__no { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--border-strong); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.chip { font-family: var(--font-mono); font-size: .68rem; font-weight: 600; padding: .2rem .5rem; border-radius: 6px; letter-spacing: .01em; }
.chip--auto { background: var(--accent-soft); color: var(--accent); }
.chip--manual { background: var(--signal-soft); color: var(--signal); }
.chip--api { background: rgba(129, 140, 248, .16); color: #a5b0f8; }
[data-theme="light"] .chip--api { background: rgba(79, 70, 229, .12); color: #4f46e5; }
.project-card__title { font-size: 1.3rem; font-weight: 600; }
.project-card__date { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.project-card__desc { color: var(--text-soft); margin-top: .8rem; font-size: .96rem; flex: 1; }
.project-card__stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.project-card__stack li { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); border: 1px solid var(--border); padding: .18rem .5rem; border-radius: 6px; }

/* ---------- Education ---------- */
.edu__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.edu-card--degree { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 55%); }
.edu-card__kind { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.edu-card__title { font-size: 1.15rem; font-weight: 600; margin-top: .6rem; }
.edu-card__org { color: var(--text-soft); margin-top: .4rem; font-size: .95rem; }
.edu-card__meta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* ---------- Contact ---------- */
.contact__lead { color: var(--text-soft); max-width: 52ch; margin-top: -1.4rem; margin-bottom: 2rem; font-size: 1.06rem; }
.contact__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.contact-card {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.contact-card__label { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.contact-card__value { font-weight: 600; font-size: 1.02rem; word-break: break-word; }
.contact__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 2.4rem 0; background: var(--bg-alt); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; }
.footer__name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.footer__note { color: var(--muted); font-family: var(--font-mono); font-size: .82rem; }
.footer__social { margin-left: auto; display: flex; gap: 1.1rem; }
.footer__social a { color: var(--text-soft); font-size: .9rem; transition: color .2s ease; }
.footer__social a:hover { color: var(--accent); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: #06231e; border: none;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
[data-theme="light"] .to-top { color: #fff; }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Scroll reveal ---------- */
.reveal, .section__eyebrow, .section__title,
.about__grid, .timeline, .dev-highlights,
.skill-card, .project-card, .edu-card, .contact-card, .contact__cta {
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.in-view { opacity: 1 !important; transform: none !important; }

/* Stagger children */
.skill-card:nth-child(2), .project-card:nth-child(2), .edu-card:nth-child(2), .contact-card:nth-child(2) { transition-delay: .07s; }
.skill-card:nth-child(3), .project-card:nth-child(3), .edu-card:nth-child(3), .contact-card:nth-child(3) { transition-delay: .14s; }
.skill-card:nth-child(4) { transition-delay: .07s; }
.skill-card:nth-child(5) { transition-delay: .14s; }
.skill-card:nth-child(6) { transition-delay: .21s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .menu-btn { display: flex; }
  .btn--sm { display: none; }        /* CV button lives in mobile menu instead */
  .hero__grid { grid-template-columns: 1fr; }
  .console { order: 2; max-width: 480px; }
  .about__grid { grid-template-columns: 1fr; }
  .skills__grid, .projects__grid, .edu__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .skills__grid, .projects__grid, .edu__grid, .contact__grid, .dev-list { grid-template-columns: 1fr; }
  .footer__social { margin-left: 0; width: 100%; }
  .hero__lead, .hero__sub { max-width: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .section__eyebrow, .section__title, .about__grid, .timeline,
  .dev-highlights, .skill-card, .project-card, .edu-card, .contact-card,
  .contact__cta, .console__lines li, .console__summary { opacity: 1; transform: none; }
}
