/* ==========================================================================
   Anas El Aadil — home page
   Built from Figma: Desktop 363:631 / Tablet 363:672 / Mobile 363:713
   ========================================================================== */

:root {
  /* Colour */
  --ink: #000000;
  --muted: #767676;
  --bg: #ffffff;

  /* Type */
  --font-sans: "Aktiv Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-display: 37px;
  --fs-section: 24px;
  --fs-hero: 64px;
  --fs-lead: 20px;
  --fs-nav: 20px;
  --fs-body: 16px;
  --ls-loose: -0.03em;  /* Figma -3%  */
  --ls-tight: -0.05em;  /* Figma -5%  */

  /* Layout */
  --gutter: 15px;
  --nav-h: 46px;
  --strip-gap: 20px;
  /* The design's own breakpoints top out at "Desktop ≥ 1280px" and every
     component-level max-width (case-study text, footer columns, etc.) was
     tuned around that width — beyond it, content stays capped and centred
     rather than stretching edge to edge on wide monitors. */
  --max-width: 1280px;
}

/* --------------------------------------------------------------- Reset -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, p { margin: 0; }

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

a:focus-visible,
button:focus-visible,
.strip:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 10px 15px;
}
.skip-link:focus { left: 0; }

/* Shared shells ---------------------------------------------------------- */

.section {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.inset {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.rule {
  width: 100%;
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--ink);
}

.text-link {
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.1;
  letter-spacing: var(--ls-loose);
  white-space: nowrap;
}
.text-link:hover { color: var(--ink); }

/* ------------------------------------------------------------------ Nav -- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nav__bar {
  display: flex;
  align-items: center;
  min-height: var(--nav-h);
}

.nav__brand {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 12px 20px 10px 0;
  border-bottom: 1px solid var(--ink);
  align-self: stretch;
}

.nav__logo-link { display: block; }

.nav__logo--wordmark { display: none; }

.nav__logo--monogram { width: 70px; height: auto; }

.nav__links {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 0 10px 20px;
  border-bottom: 1px solid var(--ink);
  align-self: stretch;
}

.nav__toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-nav);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
}

/* Mobile: menu collapses under the bar */
.nav__list {
  display: none;
  flex-direction: column;
  gap: 26px;
  padding: 15px 0;
  font-size: var(--fs-nav);
  line-height: 1;
  letter-spacing: var(--ls-tight);
}

.nav.is-open .nav__list { display: flex; }

/* ----------------------------------------------------------------- Hero -- */

.hero__frame {
  /* Figma puts the image 65px below the frame top, with the 46px nav
     overlapping. The nav is sticky here, so it occupies that 46px in flow. */
  padding-top: calc(65px - var(--nav-h));
  padding-bottom: 10px;
}

.hero__frame img {
  width: 100%;
  max-width: 363px;
  aspect-ratio: 363 / 360;
  object-fit: cover;
}

/* ---------------------------------------------------------------- Intro -- */

.intro { padding-top: 40px; }

.intro__content {
  padding-top: 10px;
  padding-bottom: 150px;
  border-bottom: 1px solid var(--ink);
}

.intro__text {
  max-width: 345px;
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-loose);
}

/* ----------------------------------------------------------------- Work -- */

.work {
  padding-top: 20px;
  padding-bottom: 40px;
}

.work__label {
  font-size: var(--fs-section);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
  margin-bottom: 10px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 50px;
}

/* Horizontal image strip.
   In Figma the third image is clipped by the frame edge; on the web that
   becomes a looping marquee so the clipped image stays visible without
   requiring a manual scroll. The track renders each project's images twice
   (see index.ejs) so translateX(-50%) loops seamlessly back to the start. */
.strip {
  overflow: hidden;
  scrollbar-width: none;
}

.strip__track {
  display: flex;
  align-items: center;
  gap: var(--strip-gap);
  width: max-content;
  animation: strip-marquee 24s linear infinite;
}

.strip:hover .strip__track,
.strip:focus-within .strip__track {
  animation-play-state: paused;
}

@keyframes strip-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.strip__track img {
  width: 285.25px;
  height: auto;
  aspect-ratio: 461.25 / 446;
  object-fit: cover;
}

.project__meta {
  display: flex;
  flex-direction: column;
  gap: 32px;
  font-size: var(--fs-body);
  letter-spacing: var(--ls-loose);
}

.project__title {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-weight: 600;
  line-height: 1;
}

.project__eyebrow {
  color: var(--muted);
  white-space: nowrap;
}

.project__names {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project__name { color: var(--ink); }
.project__discipline { color: var(--muted); }

.project__body {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
  max-width: 360px;
  line-height: 1.1;
}

/* -------------------------------------------------------------- Connect -- */

.connect { padding-bottom: 50px; }

/* Project and About nest this one level shallower than the home page. */
.connect--flush { padding-bottom: 0; }

.connect__content {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.connect__text {
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-loose);
}

/* --------------------------------------------------------------- Footer -- */

.footer {
  display: flex;
  flex-direction: column;
  gap: 19px;
  padding-top: 30px;
  padding-bottom: 15px;
}

.footer__content {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.footer__logo img { width: 115.594px; height: auto; }

.footer__text {
  display: flex;
  flex-direction: column;
  gap: 62px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer__heading,
.footer__list {
  font-size: var(--fs-nav);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__list a:hover { color: var(--muted); }

.footer__wordmark img { width: 100%; height: auto; }

/* ======================================================= Tablet ≥ 768px == */

@media (min-width: 768px) {

  .nav__list {
    display: flex;
    flex-direction: row;
    gap: 50px;
    padding: 0;
    align-items: flex-end;
  }

  .nav__toggle { display: none; }

  .intro { padding-top: 15px; }

  .intro__text { max-width: 770px; }

  .work {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .work__label {
    padding-bottom: 50px;
    margin-bottom: 10px;
  }

  .strip__track img { width: 461.25px; }

  .project__meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
  }

  .project__title { width: 341px; flex: 0 0 auto; }

  .project__body { width: 316px; flex: 0 0 auto; }

  .footer {
    gap: 127px;
    padding-bottom: 15px;
  }

  .footer__content {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  .footer__logo {
    flex: 1 0 0;
    min-width: 0;
    max-width: 625px;
  }

  .footer__text {
    flex-direction: row;
    justify-content: space-between;
    flex: 0 0 auto;
    width: 530px;
    gap: 0;
  }

  .footer__col { width: 227px; }
  .footer__col--social { width: 132px; }
}

/* ====================================================== Desktop ≥ 1280px == */

@media (min-width: 1280px) {

  .nav__logo--wordmark { display: block; width: 120.816px; height: auto; }
  .nav__logo--monogram { display: none; }

  .nav__brand { padding-bottom: 5px; }

  .nav__links { max-width: 615px; }

  .intro__text { max-width: 820px; }

  .footer__text { width: 616px; }
}

/* ---------------------------------------------------------- Preferences -- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .strip {
    scroll-behavior: auto;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .strip__track {
    animation: none;
    transform: none;
  }

  .strip__track img { scroll-snap-align: start; }
}


/* ==========================================================================
   MASTHEAD — oversized A.E.A mark. Project page (363:433) and About (363:108).
   Absent from both mobile frames, so it starts hidden.
   ========================================================================== */

.masthead { display: none; }

.masthead img {
  width: 324px;
  max-width: 100%;
  height: auto;
}

@media (min-width: 768px) {
  .masthead {
    display: block;
    padding-top: calc(65px - var(--nav-h));
    padding-bottom: 10px;
  }
}

/* ==========================================================================
   PROJECT PAGE — 363:431 / 363:497 / 363:563
   ========================================================================== */

.case-head { padding-block: 80px; }

.case-head__inner {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-block: 10px;
}

.case-head__title {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.case-head__name {
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
}

.case-head__body {
  display: flex;
  flex-direction: column;
  gap: 44px;
  font-size: var(--fs-lead);
  letter-spacing: var(--ls-tight);
}

.case-head__lead { line-height: 1.21; }

.case-head__services {
  width: 276px;
  max-width: 100%;
  color: var(--muted);
  line-height: 1.21;
}

.case-head__services li { margin-bottom: 4px; }
.case-head__services li:last-child { margin-bottom: 0; }

/* Image stack -------------------------------------------------------------- */

.case-media {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.case-media img {
  width: 100%;
  object-fit: cover;
}

.media-wide { aspect-ratio: 1250 / 590; }

.media-pair {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.media-pair img { aspect-ratio: 617.5 / 590; }

/* Two frames are set to Fit rather than Fill in Figma. */
.case-media .media-contain { object-fit: contain; }

/* Other projects ----------------------------------------------------------- */

.others {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding-top: 15px;
  padding-bottom: 80px;
}

.others__head {
  display: flex;
  flex-direction: column;
  gap: 29px;
}

.others__head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.others__title {
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
}

.others__nav {
  display: flex;
  flex-shrink: 0;
  gap: 20px;
}

.others__arrow {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-section);
  line-height: 1;
}

.others__arrow:hover { color: var(--muted); }

/* Horizontally scrolling carousel, snapped to one card at a time. Exactly
   three cards fit per view from 768px up; below that one card shows with a
   peek of the next to hint it scrolls. Prev/Next (see others-carousel.js)
   step by one card and hide themselves at either end of the scroll range. */
.others__grid {
  display: flex;
  flex-direction: row;
  gap: 15px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.others__grid::-webkit-scrollbar { display: none; }

.others__card {
  flex: 0 0 calc((100% - 15px) / 1.15);
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.others__card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media (min-width: 768px) {
  .case-head { padding-top: 15px; padding-bottom: 80px; }

  .media-pair { flex-direction: row; }
  .media-pair img { flex: 1 1 0; min-width: 0; }

  .others { gap: 104px; }

  .others__grid { gap: 14px; }

  .others__card { flex: 0 0 calc((100% - 2 * 14px) / 3); }
}

@media (min-width: 1280px) {
  .case-head { padding-top: 20px; padding-bottom: 160px; }

  .case-head__inner {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  .case-head__title { flex: 1 1 0; min-width: 0; }

  .case-head__body { flex: 1 1 0; min-width: 0; max-width: 720px; }

  /* Only the desktop frame sets this paragraph in italic — see README. */
  .case-head__lead { font-style: italic; }
}

/* ==========================================================================
   ABOUT PAGE — 363:106 / 363:147 / 363:188
   ========================================================================== */

.about-portrait {
  padding-top: 80px;
  padding-bottom: 48px;
}

.about-portrait img {
  width: 326px;
  max-width: 100%;
  aspect-ratio: 326 / 300;
  object-fit: cover;
}

.about-bio {
  padding-top: 3px;
  padding-bottom: 48px;
}

.about-bio__text {
  max-width: 345px;
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-loose);
}

.awards img {
  width: 100%;
  height: auto;
}

@media (min-width: 768px) {
  .about-portrait { padding-top: 15px; padding-bottom: 0; }

  .about-bio { padding-top: 15px; padding-bottom: 56px; }

  .about-bio__text { max-width: 770px; }
}

@media (min-width: 1280px) {
  .about-bio__text { max-width: 1080px; }
}

/* ==========================================================================
   CONTACT PAGE
   No Figma frame — built from the system: hairline rules, 64px head,
   underline-only form controls, same 768 / 1280 breakpoints.
   ========================================================================== */

.contact-head {
  padding-top: 80px;
  padding-bottom: 60px;
}

.contact-head__title {
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
  margin-bottom: 30px;
}

.contact-head__lead {
  max-width: 620px;
  font-size: var(--fs-lead);
  line-height: 1.21;
  letter-spacing: var(--ls-tight);
}

.contact-body {
  padding-bottom: 80px;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 62px;
  padding-block: 50px;
}

/* Form --------------------------------------------------------------------- */

.contact-form { width: 100%; }

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.field__label {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--ls-loose);
  color: var(--muted);
}

.field__control {
  width: 100%;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-lead);
  line-height: 1.21;
  letter-spacing: var(--ls-tight);
}

.field__control--area {
  resize: vertical;
  min-height: 140px;
}

/* Thicken via shadow rather than border-width so nothing reflows on focus. */
.field__control:focus {
  outline: none;
  box-shadow: 0 1px 0 var(--ink);
}

.field__control[aria-invalid="true"] {
  border-bottom-color: var(--muted);
}

.field__error {
  font-size: var(--fs-body);
  line-height: 1.1;
  letter-spacing: var(--ls-loose);
  color: var(--muted);
}

.form-submit {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-section);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
  text-decoration: underline;
  text-underline-position: from-font;
}

.form-submit:hover { color: var(--muted); }

.form-status:not(:empty) {
  margin-top: 30px;
  font-size: var(--fs-body);
  line-height: 1.1;
  letter-spacing: var(--ls-loose);
  color: var(--muted);
}

/* Details ------------------------------------------------------------------ */

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

/* Same treatment as the footer columns, kept separate so the two can diverge. */
.info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.info__heading,
.info__list {
  font-size: var(--fs-nav);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--ls-tight);
}

.info__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info__list li { color: var(--muted); }
.info__list a { color: var(--ink); }
.info__list a:hover { color: var(--muted); }

@media (min-width: 768px) {
  .contact-head {
    padding-top: 15px;
    padding-bottom: 80px;
  }

  .contact-details {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 50px 80px;
  }

  .info { flex: 0 0 auto; min-width: 200px; }
}

@media (min-width: 1280px) {
  .contact-head { padding-top: 20px; }

  .contact-body { padding-bottom: 120px; }

  .contact-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: 80px;
  }

  .contact-form {
    flex: 1 1 0;
    min-width: 0;
    max-width: 720px;
  }

  .contact-details {
    flex: 0 0 auto;
    flex-direction: column;
    width: 280px;
    gap: 50px;
  }
}
