/*
 * qasimtariq.com - static portfolio
 * Light theme with red accent, following the layout of the previous site.
 * No frameworks: plain CSS, system of tokens below.
 */

:root {
  --accent: #f72b1c;
  --accent-dark: #d81f11;
  --accent-soft: rgba(247, 43, 28, .92);
  --text: #666;
  --text-strong: #4a4a4a;
  --muted: #888;
  --bg: #fff;
  --surface: #eee;
  --border: #ddd;
  --line: #eff0f0;
  --shadow: 0 0 7px rgba(0, 0, 0, .3);
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.77, .2, .05, 1);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-head); line-height: 1.2; }
p { margin: 0 0 1rem; }
button { font: inherit; }

.open-sans { font-family: var(--font-body); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 3000;
  padding: 10px 20px;
  border-radius: 26px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid rgba(247, 43, 28, .45); outline-offset: 3px; }

.icon {
  width: 1em; height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

/* keep content clear of the fixed right-hand icon menu */
@media (min-width: 992px) and (max-width: 1350px) {
  .container { max-width: calc(100% - 195px); }
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  margin: 5px;
  padding: 0 40px;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: var(--accent);
  color: #fff;
  font: 500 15px/46px var(--font-head);
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .3s;
}
.btn:hover,
.btn:focus-visible { background: var(--accent-dark); color: #fff; }

.btn-label { position: relative; display: block; transition: transform .3s; }

.btn .icon {
  position: absolute;
  top: 50%; right: 22px;
  width: 16px; height: 16px;
  margin-top: -8px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .3s, transform .3s;
}

@media (min-width: 992px) {
  .btn:hover .btn-label,
  .btn:focus-visible .btn-label { transform: translateX(-10px); }
  .btn:hover .icon,
  .btn:focus-visible .icon { opacity: 1; transform: translateX(0); }
}

@media (max-width: 991px) {
  .btn { padding: 0 28px; }
  .btn .icon { display: none; }
}

/* ---------- Navigation ---------- */

.menu-toggle { display: none; }

.icon-menu { list-style: none; margin: 0; padding: 0; }

.icon-menu a {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none;
}

@media (min-width: 992px) {
  .site-nav {
    position: fixed;
    top: 100px; right: 30px;
    z-index: 30;
    display: flex;
    align-items: center;
    height: calc(100vh - 200px);
  }

  .icon-menu li { margin: 20px 0; }

  .icon-menu a {
    justify-content: center;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    transition: background-color .3s, color .3s;
  }
  .icon-menu a .icon { position: relative; z-index: 1; width: 19px; height: 19px; }

  /* label pill that slides out to the left on hover */
  .icon-menu a .label {
    position: absolute;
    top: 0; right: 0;
    z-index: -1;
    height: 50px;
    padding: 0 25px 0 30px;
    border-radius: 30px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    line-height: 50px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, right .3s, border-radius .3s;
  }

  .icon-menu a:hover,
  .icon-menu a:focus-visible,
  .icon-menu a[aria-current="page"] { background: var(--accent); color: #fff; }

  .icon-menu a:hover .label,
  .icon-menu a:focus-visible .label { opacity: 1; right: 27px; border-radius: 30px 0 0 30px; }
}

@media (max-width: 991px) {
  .menu-toggle {
    position: fixed;
    top: 30px; right: 30px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 54px; height: 54px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 23px; height: 2px;
    border-radius: 3px;
    background: var(--text);
    transition: transform .45s var(--ease), opacity .3s;
  }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1100;
    padding-top: 110px;
    overflow-y: auto;
    background: var(--surface);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .5s var(--ease), visibility 0s .5s;
  }
  .menu-open .site-nav {
    visibility: visible;
    transform: none;
    transition: transform .5s var(--ease);
  }
  .menu-open { overflow: hidden; }

  .icon-menu li { position: relative; padding: 0 30px; }
  .icon-menu li + li::before {
    content: '';
    position: absolute;
    top: 0; left: 30px; right: 30px;
    height: 1px;
    background: var(--border);
  }
  .icon-menu a {
    gap: 22px;
    padding: 14px 0;
    color: var(--text);
    font-size: 26px;
    font-weight: 400;
    text-transform: uppercase;
  }
  .icon-menu a .icon { width: 26px; height: 26px; }
  .icon-menu a:hover,
  .icon-menu a[aria-current="page"] { color: var(--accent); }
  .icon-menu a[aria-current="page"] .label { font-weight: 600; }
}

@media (max-width: 576px) {
  .menu-toggle { top: 5px; right: 10px; width: 49px; height: 49px; border: 0; }
  .home .menu-toggle { top: 25px; right: 25px; }
  .icon-menu li { padding: 0 25px; }
  .icon-menu li + li::before { left: 25px; right: 25px; }
  .icon-menu a { font-size: 18px; gap: 16px; }
  .icon-menu a .icon { width: 20px; height: 20px; }
}

/* ---------- Page entrance animation ---------- */

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: none; }
}
.reveal { animation: slide-up .9s cubic-bezier(.2, .8, .2, 1) .1s both; }

/* ---------- Home ---------- */

.home .color-block {
  position: fixed;
  top: -50%; left: -83%;
  z-index: 0;
  width: 100%; height: 200%;
  background: var(--accent);
  transform: rotate(-15deg);
}

.home-photo {
  position: fixed;
  top: 30px; left: 30px;
  z-index: 5;
  width: calc(33.333vw - 30px);
  height: calc(100vh - 60px);
  border-radius: 15px;
  background: #fff url("../img/qasim-tariq.jpg") center / contain no-repeat;
  box-shadow: var(--shadow);
}

.home-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.home-details { width: 100%; padding: 60px 15px; }

@media (min-width: 992px) {
  .home-details { width: 66.667vw; margin-left: 33.333vw; padding: 40px 100px 40px 30px; }
}

.home-inner { max-width: 550px; margin: 0 auto; }

.home h1 {
  margin: 18px 0 10px;
  color: var(--accent);
  font-size: 45px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}
.home h1 span { color: var(--text); font-weight: 600; }

.home-details p {
  margin: 10px 0 23px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 32px;
}

.home-buttons { margin-left: -5px; }

.main-img-mobile { display: none; }

@media (min-width: 1600px) {
  .home-inner { max-width: 600px; }
}

@media (min-width: 992px) and (max-width: 1100px) {
  .home-inner { max-width: 450px; }
}

@media (max-width: 991px) {
  .home .color-block,
  .home-photo { display: none; }

  .home-main { padding: 25px; }
  .home-details { padding: 30px 0; }
  .home-inner { text-align: center; }
  .home-buttons { margin-left: 0; }

  .main-img-mobile {
    display: block;
    width: 270px; height: 270px;
    margin: 0 auto 10px;
  }

  .home h1 { margin: 16px 0 13px; font-size: 38px; }
  .home-details p { font-size: 15px; line-height: 30px; }
}

@media (max-width: 767px) {
  .home-details p { font-size: 14px; line-height: 28px; }
}

@media (max-width: 576px) {
  .main-img-mobile { width: 230px; height: 230px; }
  .home h1 { font-size: 29px; }
  .btn { font-size: 14px; }
}

/* ---------- Page title (About / Portfolio / Contact) ---------- */

.title-section {
  position: relative;
  padding: 80px 15px;
  text-align: center;
}
.title-section h1 {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 56px;
  font-weight: 900;
  text-transform: uppercase;
}
.title-section h1 span { color: var(--accent); }

.title-bg {
  position: absolute;
  top: 50%; left: 0; right: 0;
  color: rgba(30, 37, 48, .07);
  font-size: 110px;
  font-weight: 800;
  letter-spacing: 10px;
  line-height: .7;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
}

.main-content { padding-bottom: 85px; }

.custom-title {
  padding-bottom: 22px;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .title-section h1 { font-size: 44px; }
  .title-bg { font-size: 80px; }
}

@media (max-width: 576px) {
  .title-section {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 14px 25px 13px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: left;
    animation: none;
  }
  .title-section h1 { font-size: 26px; line-height: 32px; }
  .title-bg { display: none; }
  .main-content { padding-top: 95px; padding-bottom: 50px; }
  .main-content > .container { padding: 0 25px; }
  .custom-title { font-size: 21px; }
}

/* ---------- About ---------- */

.about-grid { display: grid; gap: 50px; }

@media (min-width: 992px) {
  .about-grid { grid-template-columns: 5fr 7fr; gap: 30px; }
}
@media (min-width: 1200px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}

.story p { font-family: var(--font-body); }

.about-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
}
.about-list .title { color: var(--accent); font-size: 17px; font-weight: 700; }
.about-list .value { font-weight: 600; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 30px;
}

.box-stats {
  padding: 20px 30px 25px 40px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.box-stats .num {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-size: 50px;
  font-weight: 700;
  line-height: 1.2;
}
.box-stats .num::after {
  content: '+';
  position: absolute;
  top: 2px; right: -24px;
  font-size: 33px;
  font-weight: 300;
}

.box-stats p {
  position: relative;
  margin: 0;
  padding-left: 45px;
  font-family: var(--font-body);
  text-transform: uppercase;
}
.box-stats p::before {
  content: '';
  position: absolute;
  top: 13px; left: 0;
  width: 30px; height: 1px;
  background: #777;
}
.box-stats p span { display: block; }

@media (max-width: 576px) {
  .stats { gap: 20px 15px; }
  .box-stats { padding: 15px 20px 20px 22px; }
  .box-stats .num { font-size: 40px; }
  .box-stats p { padding-left: 0; font-size: 13px; }
  .box-stats p::before { display: none; }
}

/* ---------- Portfolio ---------- */

.portfolio .main-content { padding-bottom: 60px; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .3s, box-shadow .3s;
}
.project-card img {
  width: 100%;
  aspect-ratio: 1000 / 563;
  object-fit: cover;
  transition: transform .5s;
}

.project-card .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 15px;
  background: var(--accent-soft);
  color: #fff;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(101%);
  transition: opacity .35s, transform .35s;
}
.project-card .overlay small {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 1px;
  opacity: .9;
}

.project-card:hover .overlay,
.project-card:focus-visible .overlay { opacity: 1; transform: none; }
.project-card:hover img { transform: scale(1.04); }

.project-caption { display: none; }

@media (max-width: 991px), (hover: none) {
  .project-card .overlay { display: none; }
  .project-caption {
    display: block;
    padding: 10px 14px 12px;
    border-top: 2px solid var(--line);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
  }
}

@media (max-width: 991px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .portfolio-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* Project viewer (native <dialog>) */

.project-modal {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.project-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-modal::backdrop { background: rgba(0, 0, 0, .72); }

.pm-card {
  position: relative;
  width: min(660px, calc(100% - 180px));
  max-height: calc(100% - 60px);
  overflow-y: auto;
  padding: 30px;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  animation: pm-in .35s ease both;
}

@keyframes pm-in {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.pm-title {
  padding: 6px 0 18px;
  font-size: 33px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.pm-title a { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }

.pm-image img {
  width: 100%;
  border: 1px solid var(--surface);
  border-radius: 5px;
}

.pm-meta {
  display: inline-block;
  margin: 20px 0 0;
  padding: 1px 12px;
  border-radius: 20px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.pm-desc { margin: 12px 0 0; font-family: var(--font-body); }
.pm-actions { margin-top: 20px; text-align: center; }

.pm-btn {
  position: fixed;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: background-color .3s;
}
.pm-btn:hover,
.pm-btn:focus-visible { background: var(--accent); }
.pm-btn .icon { width: 26px; height: 26px; }
.pm-close { top: 30px; right: 30px; }
.pm-prev { top: 50%; left: 30px; margin-top: -26px; }
.pm-next { top: 50%; right: 30px; margin-top: -26px; }

.pm-count {
  position: fixed;
  top: 44px; left: 0; right: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
  pointer-events: none;
}

.modal-open { overflow: hidden; }
.modal-open .site-nav,
.modal-open .menu-toggle { visibility: hidden; }

.pm-bar { display: none; }

@media (max-width: 991px) {
  .project-modal[open] { display: block; }
  .project-modal::backdrop { background: #fff; }
  .pm-card {
    width: 100%; height: 100%;
    max-height: none;
    padding: 110px 30px 30px;
    border-radius: 0;
    animation: none;
  }
  .pm-card > * { max-width: 720px; margin-left: auto; margin-right: auto; }
  .pm-card .pm-meta { display: table; margin-left: 0; }
  .pm-bar {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1;
    height: 90px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .pm-btn { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
  .pm-btn:hover { color: #fff; }
  .pm-close { top: 19px; right: auto; left: 50%; margin-left: -26px; }
  .pm-prev { top: 19px; left: 30px; margin-top: 0; }
  .pm-next { top: 19px; right: 30px; margin-top: 0; }
  .pm-count { display: none; }
}

@media (max-width: 576px) {
  .pm-card { padding: 85px 22px 25px; }
  .pm-bar { height: 64px; }
  .pm-btn { width: 42px; height: 42px; }
  .pm-btn .icon { width: 22px; height: 22px; }
  .pm-close { top: 11px; margin-left: -21px; }
  .pm-prev { top: 11px; left: 20px; }
  .pm-next { top: 11px; right: 20px; }
  .pm-title { font-size: 25px; }
}

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 40px; }

@media (min-width: 992px) {
  .contact-grid { grid-template-columns: 1fr 2fr; gap: 30px; }
}

.contact-intro > p { font-family: var(--font-body); }

.contact-item {
  position: relative;
  margin: 0 0 1rem;
  padding: 5px 0 0 50px;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 21px;
  overflow-wrap: anywhere;
}
.contact-item .icon {
  position: absolute;
  top: 7px; left: 0;
  width: 32px; height: 32px;
  color: var(--accent);
  stroke-width: 1.6;
}
.contact-item .k {
  display: block;
  font-weight: 400;
  text-transform: uppercase;
  opacity: .8;
}
.contact-item a { color: var(--text); text-decoration: none; }
.contact-item a:hover { color: var(--accent); text-decoration: underline; }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color .3s, color .3s;
}
.social a:hover,
.social a:focus-visible { background: var(--accent); color: #fff; }
.social .icon { width: 17px; height: 17px; }
.social .icon.fill { fill: currentColor; stroke: none; }

.contactform .fields { display: grid; gap: 0 30px; }
@media (min-width: 768px) {
  .contactform .fields { grid-template-columns: repeat(3, 1fr); }
}

.contactform input,
.contactform textarea {
  display: block;
  width: 100%;
  margin-bottom: 30px;
  padding: 11px 26px;
  border: 1px solid var(--border);
  border-radius: 30px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: 400 15px/1.6 var(--font-body);
  transition: border-color .3s;
}
.contactform textarea {
  height: 160px;
  margin-bottom: 20px;
  padding: 12px 26px;
  resize: vertical;
}
.contactform input:focus,
.contactform textarea:focus { border-color: var(--accent); }
.contactform ::placeholder { color: #999; text-transform: uppercase; }

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
}
.form-message {
  margin: 14px 0 0;
  padding: 12px 20px;
  border-radius: 30px;
  background: #e8f6ec;
  color: #1e7b3a;
  font-family: var(--font-body);
  font-size: 14px;
}
.form-message a { color: inherit; font-weight: 600; }

.map {
  margin-top: 50px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface);
}
.map iframe { display: block; width: 100%; height: 450px; border: 0; }

@media (max-width: 576px) {
  .map { margin-top: 30px; }
  .map iframe { height: 320px; }
}

/* ---------- 404 ---------- */

.error-page .main-content { text-align: center; }
.error-page .main-content p { font-family: var(--font-body); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
