/* ========================================
   EMAD ALI — DESIGN SYSTEM
   ======================================== */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-light: #171717;

  --text: #f5f5f5;
  --muted: #999999;

  --border: #242424;
  --border-light: #303030;

  --max-width: 1200px;
  --radius: 16px;
}


/* ========================================
   RESET
   ======================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Inter",
    "Segoe UI",
    sans-serif;

  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  display: block;
}


/* ========================================
   NAVIGATION
   ======================================== */

header {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;

  z-index: 100;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);

  background: rgba(10, 10, 10, 0.82);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

nav {
  width: min(100% - 48px, var(--max-width));

  height: 76px;

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav > a {
  font-size: 14px;
  font-weight: 700;

  letter-spacing: 0.08em;

  transition: opacity 0.2s ease;
}

nav > a:hover {
  opacity: 0.7;
}

nav div {
  display: flex;
  align-items: center;

  gap: 32px;
}

nav div a {
  position: relative;

  color: var(--muted);

  font-size: 14px;

  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

nav div a:hover {
  color: var(--text);
}


/* ========================================
   GENERAL SECTIONS
   ======================================== */

section {
  width: min(100% - 48px, var(--max-width));

  margin: 0 auto;

  padding: 150px 0;

  scroll-margin-top: 76px;
}

section > p:first-child {
  margin-bottom: 18px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  letter-spacing: -0.04em;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h2 {
  font-size: clamp(42px, 5vw, 68px);

  line-height: 1;

  font-weight: 600;
}


/* ========================================
   HERO
   ======================================== */

#hero {
  min-height: 100vh;

  padding-top: 220px;
  padding-bottom: 120px;

  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: flex-start;
}

#hero > p:first-child {
  margin-bottom: 24px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.16em;
}

#hero h1 {
  max-width: 980px;

  font-size: clamp(54px, 8vw, 104px);

  line-height: 0.95;

  font-weight: 600;

  letter-spacing: -0.055em;
}

#hero > p:nth-of-type(2) {
  max-width: 650px;

  margin-top: 36px;

  color: var(--muted);

  font-size: 19px;

  line-height: 1.7;
}

#hero > a {
  display: inline-flex;
  align-items: center;

  margin-top: 42px;

  padding: 15px 24px;

  background: var(--text);
  color: var(--bg);

  border-radius: 999px;

  font-size: 14px;
  font-weight: 700;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

#hero > a:hover {
  transform: translateY(-2px);

  opacity: 0.9;
}

#hero > a:active {
  transform: translateY(0);
}


/* ========================================
   SECTION DIVIDERS
   ======================================== */

#services,
#work,
#approach,
#about,
#contact {
  border-top: 1px solid var(--border);
}


/* ========================================
   SERVICES
   ======================================== */

#services {
  padding-top: 130px;
}

#services h2 {
  margin-bottom: 70px;
}

.service-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.service-grid article {
  min-height: 330px;

  padding: 32px;

  border-right: 1px solid var(--border);

  display: flex;
  flex-direction: column;

  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}

.service-grid article:last-child {
  border-right: none;
}

.service-grid article:hover {
  background: rgba(255, 255, 255, 0.015);
}

.service-grid article > span {
  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.12em;
}

.service-grid h3 {
  margin-top: auto;

  font-size: 28px;

  line-height: 1.1;

  font-weight: 500;
}

.service-grid p {
  max-width: 300px;

  margin-top: 18px;

  color: var(--muted);

  font-size: 15px;

  line-height: 1.7;
}


/* ========================================
   WORK / PROJECTS
   ======================================== */

#work {
  padding-top: 130px;
}

#work h2 {
  margin-bottom: 70px;
}

.project-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;
}

.project-grid article {
  min-height: 360px;

  padding: 32px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  display: flex;
  flex-direction: column;

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.project-grid article:hover {
  transform: translateY(-5px);

  background: var(--surface-light);

  border-color: var(--border-light);
}

.project-grid article > span {
  color: var(--muted);

  font-size: 11px;
  font-weight: 700;

  letter-spacing: 0.14em;
}

.project-grid h3 {
  margin-top: auto;

  font-size: 28px;

  line-height: 1.1;

  font-weight: 500;
}

.project-grid p {
  max-width: 330px;

  margin-top: 18px;

  color: var(--muted);

  font-size: 15px;

  line-height: 1.7;
}


/* ========================================
   APPROACH
   ======================================== */

#approach {
  padding-top: 140px;
  padding-bottom: 140px;
}

#approach h2 {
  max-width: 900px;

  margin-bottom: 70px;
}

.approach-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  border-top: 1px solid var(--border);

  border-bottom: 1px solid var(--border);
}

.approach-grid article {
  min-height: 280px;

  padding: 32px;

  border-right: 1px solid var(--border);

  display: flex;
  flex-direction: column;
}

.approach-grid article:last-child {
  border-right: none;
}

.approach-grid article > span {
  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  letter-spacing: 0.12em;
}

.approach-grid h3 {
  margin-top: auto;

  font-size: 28px;

  line-height: 1.1;

  font-weight: 500;
}

.approach-grid p {
  max-width: 300px;

  margin-top: 18px;

  color: var(--muted);

  font-size: 15px;

  line-height: 1.7;
}


/* ========================================
   ABOUT
   ======================================== */

#about {
  padding-top: 160px;

  padding-bottom: 160px;
}

#about h2 {
  max-width: 1050px;

  margin-bottom: 52px;

  font-size: clamp(44px, 6vw, 82px);

  line-height: 0.98;
}

.about-text {
  max-width: 760px;

  color: var(--muted);

  font-size: 19px;

  line-height: 1.75;
}


/* ========================================
   CONTACT
   ======================================== */

#contact {
  padding-top: 160px;

  padding-bottom: 170px;
}

#contact h2 {
  max-width: 900px;

  margin-bottom: 32px;

  font-size: clamp(48px, 7vw, 88px);
}

#contact > p:nth-of-type(2) {
  max-width: 600px;

  margin-bottom: 12px;

  color: var(--muted);

  font-size: 18px;
}

#contact > a {
  display: inline-block;

  font-size: 18px;

  font-weight: 500;

  border-bottom: 1px solid var(--muted);

  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

#contact > a:hover {
  color: var(--muted);

  border-color: var(--text);
}


/* ========================================
   FOOTER
   ======================================== */

footer {
  width: min(100% - 48px, var(--max-width));

  margin: 0 auto;

  padding: 40px 0;

  border-top: 1px solid var(--border);

  color: var(--muted);

  font-size: 13px;
}


/* ========================================
   ACCESSIBILITY
   ======================================== */

a:focus-visible {
  outline: 2px solid var(--text);

  outline-offset: 5px;

  border-radius: 4px;
}


/* ========================================
   RESPONSIVE — TABLET
   ======================================== */

@media (max-width: 900px) {

  .service-grid,
  .project-grid,
  .approach-grid {
    grid-template-columns: 1fr;
  }

  .service-grid article,
  .approach-grid article {
    min-height: 280px;

    border-right: none;

    border-bottom: 1px solid var(--border);
  }

  .service-grid article:last-child,
  .approach-grid article:last-child {
    border-bottom: none;
  }

  .project-grid {
    gap: 12px;
  }

  .project-grid article {
    min-height: 300px;
  }

}


/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */

@media (max-width: 700px) {

  nav {
    width: min(100% - 32px, var(--max-width));

    height: 68px;
  }

  nav div {
    display: none;
  }

  section {
    width: min(100% - 32px, var(--max-width));

    padding: 100px 0;

    scroll-margin-top: 68px;
  }


  /* HERO */

  #hero {
    min-height: 100svh;

    padding-top: 150px;

    padding-bottom: 80px;
  }

  #hero > p:first-child {
    margin-bottom: 20px;

    font-size: 11px;
  }

  #hero h1 {
    font-size: clamp(48px, 15vw, 72px);

    line-height: 0.94;
  }

  #hero > p:nth-of-type(2) {
    margin-top: 28px;

    font-size: 17px;

    line-height: 1.65;
  }

  #hero > a {
    margin-top: 32px;

    padding: 14px 21px;
  }


  /* SERVICES */

  #services,
  #work {
    padding-top: 100px;
  }

  #services h2,
  #work h2,
  #approach h2 {
    margin-bottom: 50px;
  }

  .service-grid article {
    min-height: 260px;

    padding: 26px;
  }

  .service-grid h3,
  .project-grid h3,
  .approach-grid h3 {
    font-size: 25px;
  }


  /* PROJECTS */

  .project-grid article {
    min-height: 300px;

    padding: 26px;
  }


  /* APPROACH */

  #approach {
    padding-top: 100px;

    padding-bottom: 100px;
  }

  .approach-grid article {
    min-height: 250px;

    padding: 26px;
  }


  /* ABOUT */

  #about {
    padding-top: 110px;

    padding-bottom: 110px;
  }

  #about h2 {
    margin-bottom: 36px;

    font-size: clamp(42px, 12vw, 64px);
  }

  .about-text {
    font-size: 17px;

    line-height: 1.7;
  }


  /* CONTACT */

  #contact {
    padding-top: 110px;

    padding-bottom: 120px;
  }

  #contact h2 {
    font-size: clamp(44px, 13vw, 68px);
  }

  #contact > p:nth-of-type(2),
  #contact > a {
    font-size: 17px;
  }


  /* FOOTER */

  footer {
    width: min(100% - 32px, var(--max-width));

    padding: 32px 0;
  }

}


/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;

    animation-duration: 0.01ms !important;

    animation-iteration-count: 1 !important;
  }

}