/* ==========================================================================
   Arshad Ali — Portfolio
   Hand-written, dependency-free CSS. No frameworks, no runtime compilers.
   ========================================================================== */

/* ---- Self-hosted fonts (subset: Latin only, 4 weights) ---- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/poppins-800.woff2") format("woff2");
}

/* ---- Design tokens ---- */
:root {
  --bg: #0d1117;
  --bg1:rgb(252, 252, 252)7;
  --bg-section: #111820;
  --bg-block: #161d27;
  --text: #e2e8f0;
  --text1: #353535c9;
  --text-muted: #8b9ab3;
  --primary: #2e9de4;
  --primary-light: #5bb8f5;
  --border: #1e3a52;
  --shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --max-w: 1200px;
  --font: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html.light {
  --bg: #f5f7fa;
  --bg-section: #eef1f6;
  --bg-block: #ffffff;
  --text: #1a202c;
  --text-muted: #5b6472;
  --primary: #1770b5;
  --primary-light: #2e9de4;
  --border: #d3dfec;
  --shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.08);
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 700; margin: 0; line-height: 1.25; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 6rem 0;
}
.section--alt { background: var(--bg-section); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .5rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}
.section-sub {
  color: var(--text-muted);
  margin-top: .75rem;
}
.visually-hidden {
  position: absolute;
  left: -9999px;
}

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 8px;
  z-index: 100;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.brand img { width: 32px; height: auto; }
.nav-controls { display: flex; align-items: center; gap: .75rem; }
.nav-links {
  display: none;
  list-style: none;
  gap: 1.75rem;
  font-weight: 600;
  font-size: .95rem;
}
.nav-links a {
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }
@media (min-width: 860px) {
  .nav-links { display: flex; }
  .menu-toggle { display: none; }
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-block);
  color: var(--text);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 15px; height: 15px; }

.menu-toggle {
  border: none;
  background: none;
  color: var(--text);
  padding: 4px;
  line-height: 0;
}
.menu-toggle svg { width: 26px; height: 26px; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0 12px;
  z-index: 49;
  min-width: 200px;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; padding: .5rem 0; }
.mobile-menu a {
  display: block;
  padding: .65rem 1.5rem;
  font-weight: 600;
}
.mobile-menu a:hover { color: var(--primary); background: var(--bg-section); }

.header-spacer { height: 72px; }

/* ---- Hero ---- */
.hero {
  padding: 7rem 0 5rem;
}
.hero-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 3rem;
  align-items: center;
}
.hero-portrait {
  width: 400px;
  height: 400px;
  border-radius: 42% 58% 65% 35% / 55% 45% 55% 45%;
  overflow: hidden;
  border: 3px solid var(--primary);
  flex-shrink: 0;
  animation: morph 10s ease-in-out infinite;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
@keyframes morph {
  0%, 100% { border-radius: 42% 58% 65% 35% / 55% 45% 55% 45%; }
  50% { border-radius: 60% 40% 35% 65% / 40% 60% 40% 60%; }
}
.hero-copy { text-align: center; max-width: 560px; }
.hero-copy h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  margin-bottom: 1rem;
}
.hero-copy h1 span { color: var(--primary); }
.hero-copy p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}
.hero-actions {
  display: flex;
  gap: .9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1.5px solid var(--primary);
  transition: transform .15s ease, background-color .2s, color .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--primary); transform: translateY(-2px); }

.social-row {
  display: flex;
  gap: 1.1rem;
  justify-content: center;
}
.social-row a {
  color: var(--text-muted);
  transition: color .2s, transform .2s;
}
.social-row a:hover { color: var(--primary); transform: translateY(-2px); }
.social-row svg { width: 26px; height: 26px; }

@media (min-width: 860px) {
  .hero-inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .hero-copy { text-align: left; max-width: 600px; }
  .hero-actions, .social-row { justify-content: flex-start; }
  .hero-portrait { width: 500px; height: 500px; }
}

/* ---- About ---- */
.about-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}
.about-photo {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.about-photo img { aspect-ratio: 4/3; object-fit: cover; }
.about-body { max-width: 500px; text-align: center; }
.about-body h3 { font-size: 1.4rem; margin-bottom: .75rem; }
.about-body p { color: var(--text-muted); }
@media (min-width: 860px) {
  .about-grid { flex-direction: row; align-items: flex-start; text-align: left; }
  .about-body { text-align: left; }
  .about-body .section-head-local { text-align: left; }
}

/* ---- Cards / grid ---- */
.grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-media { aspect-ratio: 16/9; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-body h3 { font-size: 1.15rem; }
.card-body p { color: var(--text-muted); font-size: .95rem; }

/* ---- Skills ---- */
.skill-group { margin-bottom: 2.25rem; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h3 {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
  padding: .55rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  display: block;
  width: max-content;
  margin-inline: auto;
}
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}
.tag-list li {
  border: 1.5px solid var(--border);
  background: var(--bg-block);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .88rem;
  transition: border-color .2s, color .2s;
}
.tag-list li:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Timeline (experience/education) ---- */
.subsection { margin-bottom: 4rem; }
.subsection:last-child { margin-bottom: 0; }
.subsection > h3 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 2rem;
}
.timeline-card {
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: .3rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  width: max-content;
}
.timeline-card h4 { font-size: 1.2rem; }
.timeline-card .org {
  color: var(--primary);
  font-weight: 600;
  font-size: .92rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.timeline-card .org:hover { color: var(--primary-light); }
.timeline-card p, .timeline-card li { color: var(--text-muted); font-size: .93rem; }
.timeline-card ul { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.timeline-card .cert-link {
  color: var(--primary);
  font-weight: 600;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  width: max-content;
}
.timeline-card .cert-link:hover { color: var(--primary-light); }

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .contact-grid { grid-template-columns: 1.1fr .9fr; align-items: start; }
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.form-row { display: flex; flex-direction: column; gap: .4rem; }
.form-row label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.form-row input,
.form-row textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .7rem .9rem;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.contact-form button {
  align-self: flex-start;
}
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-weight: 600;
  transition: border-color .2s, color .2s, transform .2s;
}
.contact-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.contact-link svg { width: 26px; height: 26px; flex-shrink: 0; }

/* ---- Footer ---- */
.site-footer {
  background: var(--text1);
  color: var(--bg1);
  padding: 3.5rem 0 1.5rem;
}
.footer-top {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-brand { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.footer-social { display: flex; gap: 1rem; margin-top: .75rem; }
.footer-social a { color: rgba(12, 12, 12, 0.815); }
html.light .footer-social a { color: rgba(0,0,0,.4); }
.footer-social a:hover { color: var(--primary); }
.footer-social svg { width: 22px; height: 22px; }
.footer-nav h4 {
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .06em;
  margin-bottom: .9rem;
  opacity: .7;
}
.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; font-size: .92rem; }
.footer-nav a { opacity: .75; }
.footer-nav a:hover { opacity: 1; color: var(--primary); }
@media (min-width: 700px) {
  .footer-top { flex-direction: row; justify-content: space-between; }
}
.footer-bottom {
  text-align: center;
  font-size: .82rem;
  opacity: .6;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.25rem;
}

/* ---- Utility ---- */
.no-js-hide { display: none; }
