/* =========================================================
   Ali Malik – One-page portfolio
   Pure HTML + CSS. Font: Inter
   ========================================================= */

:root {
  --blue: #1d4ed8;
  --blue-600: #2563eb;
  --blue-50: #eff4ff;
  --blue-100: #dbe7ff;
  --navy: #0b1b3f;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e5eaf3;
  --bg: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(30, 64, 175, .06);
  --radius: 12px;
  --container: 1180px;
  --header-h: 62px;
}

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

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

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

/* Icons (stroke based, inherits currentColor) */
.icon {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 2px; border-radius: 6px; }

/* =========================  BUTTONS  ========================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font: 600 .9375rem/1 "Inter", sans-serif;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.btn .icon { font-size: 1.1em; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(29, 78, 216, .28); }
.btn-primary:hover { background: #1e40af; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.btn-sm { padding: 10px 18px; font-size: .8125rem; border-radius: 6px; }
.btn-primary.btn-sm { box-shadow: none; }
.btn-outline.btn-pill { border-radius: 999px; color: var(--blue); border-color: var(--blue); box-shadow: none; padding: 12px 22px; gap: 8px; }
.btn-outline.btn-pill:hover { background: var(--blue); color: #fff; }

/* =========================  HEADER  ========================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
}
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 42px; height: 32px; }
.brand-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }

.nav-menu { display: flex; align-items: center; gap: 56px; flex: 1; justify-content: flex-end; }
.nav-links { display: flex; align-items: center; gap: 34px; margin-inline: auto; }
.nav-links a {
  position: relative; display: block;
  font-size: .8125rem; font-weight: 500; color: var(--ink);
  padding: 21px 0;
  transition: color .15s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--blue); transform: scaleX(0); transition: transform .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--blue); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-cta { white-space: nowrap; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; cursor: pointer; font-size: 26px; color: var(--ink); padding: 6px; }
.nav-burger .icon-close { display: none; }

/* =========================  HERO  ========================= */
.hero { position: relative; overflow: hidden; background: #fff; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 80% at 92% 22%, #dbe7ff 0%, rgba(219, 231, 255, 0) 62%),
    radial-gradient(40% 50% at 100% 0%, #c7d9ff 0%, rgba(199, 217, 255, 0) 70%);
}
.hero-bg::after {
  content: ""; position: absolute; right: -6%; top: -8%; width: 52%; height: 118%;
  background: linear-gradient(160deg, #e3ecff 0%, #f1f6ff 60%, rgba(255, 255, 255, 0) 100%);
  border-radius: 46% 54% 40% 60% / 38% 52% 48% 62%;
  opacity: .9;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 24px;
  min-height: 460px;
  padding-top: 36px;
}
.hero-copy { align-self: center; padding-block: 28px 44px; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--blue-50); color: var(--ink);
  border-radius: 999px; padding: 7px 16px 7px 12px;
  font-size: .8125rem; font-weight: 500;
}
.badge .icon { color: var(--blue); font-size: 15px; }

.hero h1 {
  margin-top: 20px;
  font-size: clamp(2.25rem, 4.4vw, 3.4rem);
  line-height: 1.12; font-weight: 800; letter-spacing: -.025em;
  color: var(--ink);
}
.hero h1 .accent { color: var(--blue-600); }
@media (min-width: 961px) { .hero h1 .accent { white-space: nowrap; } }
.lead { margin-top: 18px; max-width: 460px; font-size: .9375rem; line-height: 1.65; color: var(--ink); }

.hero-media { position: relative; align-self: center; justify-self: center; width: 100%; max-width: 440px; padding-block: 36px; }
.hero-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 14px; }
.hero-skills li {
  flex: 0 0 calc((100% - 42px) / 4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 1 / 1.08;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 26px rgba(30, 64, 175, .12);
  font-size: .6875rem; font-weight: 500; color: var(--ink); text-align: center; line-height: 1.2;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-skills li:nth-child(even) { translate: 0 12px; }
.hero-skills li:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(30, 64, 175, .18); }
.hero-skills img { width: 74%; max-width: 78px; height: auto; aspect-ratio: 1; object-fit: contain; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }



/* =========================  SECTIONS  ========================= */
.section { padding: 44px 0 20px; }
.section-tight { padding: 28px 0 20px; }

.section-head { text-align: center; margin-bottom: 22px; }
.section-head h2 {
  display: inline-flex; align-items: center; gap: 22px;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.section-head h2::before, .section-head h2::after {
  content: ""; width: 42px; height: 2px; background: var(--blue-600); border-radius: 2px;
}
.section-head h2::before { opacity: .85; }
.section-head p { margin-top: 4px; font-size: .875rem; color: var(--ink); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* =========================  PROJECTS  ========================= */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project { display: flex; gap: 16px; padding: 10px; transition: transform .2s ease, box-shadow .2s ease; }
.project:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(30, 64, 175, .12); }

.thumb { flex: none; width: 160px; height: 110px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f8fafc; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.project-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 4px 6px 2px 0; }
.project-body h3 { display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 700; color: var(--ink); }
.project-body h3 a { color: var(--blue); display: inline-flex; font-size: 12px; }
.project-body p { margin-top: 6px; font-size: .8125rem; line-height: 1.5; color: var(--text); max-width: 250px; }

.project-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--blue-50); color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: .6875rem; font-weight: 500; }

.links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: .6875rem; font-weight: 500; white-space: nowrap; }
.links a { display: inline-flex; align-items: center; gap: 5px; }
.links .icon { font-size: 11px; }
.link-demo { color: var(--blue); }
.link-demo:hover { text-decoration: underline; }
.link-git { color: var(--ink); }
.link-git:hover { color: var(--blue); }

/* =========================  SKILLS  ========================= */
.skills-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.skill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 8px 14px;
  font-size: .8125rem; font-weight: 500; color: var(--ink); text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.skill:hover { transform: translateY(-3px); border-color: var(--blue-100); box-shadow: 0 12px 24px rgba(30, 64, 175, .12); }
.skill img { max-height: 128px; object-fit: contain; }

/* =========================  EXPERIENCE  ========================= */
.exp-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 32px; align-items: stretch; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 36px; justify-content: center; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 2px; background: var(--blue-100);
}
.timeline li {
  position: relative; display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: start;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -36px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 4px var(--blue-100);
}
.t-year { font-size: .9375rem; font-weight: 500; color: var(--ink); }
.t-body h3 { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.t-body p { margin-top: 4px; font-size: .8125rem; color: var(--text); }

.cta-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  padding: 24px 22px;
  background: linear-gradient(180deg, #eef3ff 0%, #e6eeff 100%);
  border-radius: 14px;
}
.cta-ico { font-size: 40px; color: var(--blue); stroke-width: 1.6; }
.cta-card h3 { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.cta-card p { font-size: .8125rem; color: var(--ink); max-width: 260px; }
.cta-card .btn { margin-top: 6px; }

/* =========================  ABOUT / CONTACT  ========================= */
.about-contact { margin-top: 36px; border-top: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, #fafcff 100%); position: relative; overflow: hidden; }
.about-contact::after {
  content: ""; position: absolute; right: -80px; bottom: -120px; width: 380px; height: 260px;
  background: #e8efff; border-radius: 50%; opacity: .7; pointer-events: none;
}
.ac-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; padding-block: 28px 30px; }
.ac-about { padding-right: 56px; border-right: 1px solid var(--line); }
.ac-contact { padding-left: 56px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.about-contact h2 { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.about-contact p { margin-top: 8px; font-size: .8125rem; line-height: 1.55; color: var(--ink); max-width: 380px; }

.socials { display: flex; gap: 18px; margin-top: 18px; }
.socials a { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ink); font-size: 22px; transition: color .15s, transform .15s; }
.socials a:hover { color: var(--blue); transform: translateY(-2px); }

.contact-list { margin-top: 12px; display: grid; gap: 8px; }
.contact-list li { display: flex; align-items: center; gap: 10px; font-size: .8125rem; color: var(--ink); }
.contact-list .icon { color: var(--blue); font-size: 16px; }
.contact-list a:hover { color: var(--blue); }

/* =========================  FOOTER  ========================= */
.site-footer { background: #fff; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 16px; }
.footer-brand { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer-brand .brand-name { font-size: 1.25rem; }
.footer-brand .brand-mark { width: 36px; height: 28px; }
.footer-brand small { font-size: .6875rem; color: var(--muted); }
.footer-links { display: flex; gap: 28px; font-size: .75rem; font-weight: 500; color: var(--ink); }
.footer-links a:hover { color: var(--blue); }

/* =========================  RESPONSIVE  ========================= */
@media (max-width: 1100px) {
  .nav-menu { gap: 28px; }
  .nav-links { gap: 24px; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  /* Mobile navigation (CSS only) */
  .nav-burger { display: block; order: 3; }
  .nav-menu {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(15, 23, 42, .08);
    padding: 8px 24px 20px;
    max-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
    transition: opacity .2s ease, max-height .25s ease;
  }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  .nav-links a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: .9375rem; }
  .nav-links a::after { display: none; }
  .nav-cta { margin-top: 16px; justify-content: center; padding: 13px 18px; }
  .nav-toggle:checked ~ .nav-menu { max-height: 480px; visibility: visible; opacity: 1; }
  .nav-toggle:checked ~ .nav-burger .icon-open { display: none; }
  .nav-toggle:checked ~ .nav-burger .icon-close { display: block; }
  .nav-toggle:focus-visible ~ .nav-burger { outline: 3px solid var(--blue-100); border-radius: 8px; }

  /* Hero */
  .hero-grid { grid-template-columns: 1fr; min-height: 0; padding-top: 24px; gap: 0; }
  .hero-copy { padding-bottom: 16px; }
    .lead { max-width: 560px; }

  /* Sections */
  .projects-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; gap: 24px; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
  .ac-grid { grid-template-columns: 1fr; gap: 28px; }
  .ac-about { padding-right: 0; border-right: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .ac-contact { padding-left: 0; }
}

@media (max-width: 640px) {
  .container { padding-inline: 18px; }
  .hero-actions .btn { flex: 1 1 auto; }
  
  .section-head h2 { font-size: 1.25rem; gap: 12px; }
  .section-head h2::before, .section-head h2::after { width: 24px; }

  .project { flex-direction: column; }
  .thumb { width: 100%; height: 160px; }
  .project-body { padding: 0 4px 4px; }
  .project-body p { max-width: none; }

  .skills-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 20px; flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .hero-skills li { flex-basis: calc((100% - 28px) / 3); }
  .hero-skills li:nth-child(even) { translate: none; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-foot { flex-direction: column; align-items: flex-start; }
  .links { flex-direction: row; gap: 16px; align-items: center; }
}

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