/* =========================================================================
   Mohammad Azzam — portfolio
   Palette + stripe motif drawn from the Karel Martens stationery project.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Familjen+Grotesk:ital,wght@0,400..700;1,400..700&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..600&family=Space+Mono:wght@400;700&display=swap');

/* ---------- tokens ---------- */
:root {
  --ink:        #101B33;
  --ink-2:      #17253F;
  --ink-3:      #0A1224;
  --brick:      #C8452B;
  --brick-lt:   #E4674A;
  --brick-dp:   #A83620;
  --paper:      #F0EAE0;
  --paper-mute: #ADA598;
  --slate:      #5A6072;
  --rule:       rgba(240, 234, 224, .14);
  --rule-dark:  rgba(16, 27, 51, .16);

  --bg: var(--ink);
  --fg: var(--paper);
  --fg-mute: var(--paper-mute);
  --edge: var(--rule);

  --display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --text:    'Newsreader', Georgia, 'Times New Roman', serif;
  --mono:    'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-mega:  clamp(2.75rem, 11.5vw, 9rem);
  --fs-h1:    clamp(2rem, 5.6vw, 4.25rem);
  --fs-h2:    clamp(1.65rem, 3.4vw, 2.6rem);
  --fs-h3:    clamp(1.15rem, 1.9vw, 1.45rem);
  --fs-lead:  clamp(1.1rem, 1.55vw, 1.4rem);
  --fs-body:  clamp(1rem, 1.05vw, 1.075rem);
  --fs-label: .72rem;

  --s-1: .5rem;  --s-2: 1rem;   --s-3: 1.5rem; --s-4: 2rem;
  --s-5: 3rem;   --s-6: 4rem;   --s-7: 6rem;   --s-8: 8rem;

  --wrap: 78rem;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 240ms;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 2px solid var(--brick-lt);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--paper); color: var(--ink);
  padding: var(--s-2) var(--s-3); z-index: 200;
  font-family: var(--mono); font-size: var(--fs-label);
}
.skip:focus { left: var(--s-2); top: var(--s-2); }

/* ---------- layout primitives ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
@media (min-width: 48rem) { .wrap { width: min(100% - 5rem, var(--wrap)); } }

.band { padding-block: var(--s-7); position: relative; }
@media (min-width: 48rem) { .band { padding-block: var(--s-8); } }

/* light "interior page" sections — a printed book alternates cover and stock */
.band--paper {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-mute: var(--slate);
  --edge: var(--rule-dark);
  background: var(--bg);
  color: var(--fg);
}

.label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.label::after {
  content: ''; flex: 1; height: 1px; background: var(--edge);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  max-width: 34ch;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) clamp(1.25rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: transform var(--dur) var(--ease);
}
.nav[data-hidden='true'] { transform: translateY(-100%); }

.nav__mark {
  font-family: var(--display);
  font-weight: 700; font-size: .95rem;
  letter-spacing: .02em; text-decoration: none;
  color: var(--paper);
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 44px;
}
.nav__mark .dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--brick); flex: none;
}
.nav__mark .short { display: none; }

.nav__links { display: flex; gap: clamp(.75rem, 2.2vw, 1.75rem); align-items: center; }
.nav__links a {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--paper-mute);
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 .1rem;
  transition: color var(--dur) var(--ease);
  position: relative;
}
.nav__links a:hover, .nav__links a[aria-current='page'] { color: var(--paper); }
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .6rem;
  height: 1px; background: var(--brick);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__links a:hover::after, .nav__links a[aria-current='page']::after { transform: scaleX(1); }

/* Narrow screens: shorten the wordmark to initials rather than dropping the
   section links — they're the only way into the page's sections. */
@media (max-width: 34rem) {
  .nav { padding-inline: 1rem; }
  .nav__mark { font-size: 1rem; }
  .nav__mark .full { display: none; }
  .nav__mark .short { display: inline; }
  .nav__links { gap: .7rem; }
  .nav__links a { font-size: .64rem; letter-spacing: .06em; }
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--s-8) + 2rem) var(--s-6);
  position: relative;
}
.hero__name {
  font-size: var(--fs-mega);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .86;
  text-transform: uppercase;
  margin: 0;
}
.hero__name span { display: block; }
.hero__meta {
  display: grid; gap: var(--s-4);
  grid-template-columns: 1fr;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .hero__meta { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-5); align-items: start; }
}
.hero__blurb { font-size: var(--fs-lead); line-height: 1.5; max-width: 38ch; }
.hero__blurb em { color: var(--brick-lt); font-style: italic; }
.hero__fact dt {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-mute); margin-bottom: .4rem;
}
.hero__fact dd { margin: 0 0 var(--s-3); font-size: 1rem; }
.hero__fact dd:last-child { margin-bottom: 0; }

/* ---------- work index ---------- */
.work { display: grid; gap: 1px; background: var(--edge); border-block: 1px solid var(--edge); }
.work__item {
  background: var(--ink);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  text-decoration: none; color: inherit;
  position: relative;
  transition: background var(--dur) var(--ease);
}
@media (min-width: 56rem) {
  .work__item {
    grid-template-columns: 4.5rem minmax(0, 1.25fr) minmax(0, 1fr) 12rem;
    gap: var(--s-4);
    align-items: center;
    padding: var(--s-3) 0;
  }
}
.work__item:hover, .work__item:focus-visible { background: var(--ink-2); }
.work__num {
  font-family: var(--mono); font-size: var(--fs-label);
  color: var(--brick-lt); letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.work__title {
  font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 600; letter-spacing: -.03em; line-height: 1.05;
}
.work__desc { color: var(--paper-mute); font-size: .98rem; line-height: 1.5; max-width: 42ch; }
.work__tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.work__tag {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper-mute);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .28rem .6rem;
}
.work__thumb {
  display: none;
  position: absolute; right: 0; top: 50%;
  width: 15rem; aspect-ratio: 4 / 3;
  transform: translate(1.5rem, -50%) scale(.95);
  opacity: 0; pointer-events: none;
  border: 1px solid var(--rule);
  object-fit: cover;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 3;
}
/* Posters are portrait; a 4:3 box would crop them to an unreadable slab.
   Narrower and taller keeps the sheet intact at the same thumbnail height. */
.work__thumb--portrait { width: 8rem; aspect-ratio: 5 / 7; }

@media (min-width: 68rem) {
  .work__thumb { display: block; }
  .work__item:hover .work__thumb,
  .work__item:focus-visible .work__thumb { opacity: 1; transform: translate(0, -50%) scale(1); }
}

/* ---------- studio / CAC feature ---------- */
/* minmax(0, …) throughout: a bare 1fr floors at the content's min-content
   width, so a wide image refuses to shrink and blows out its column. */
.feature { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 56rem) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); }
}
.feature__media { border: 1px solid var(--edge); background: var(--ink-3); }
.feature__media img { width: auto; max-width: 100%; max-height: 72svh; margin-inline: auto; }
.feature__stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--s-3); margin-top: var(--s-4);
  padding-top: var(--s-4); border-top: 1px solid var(--edge);
}
.feature__stat dt {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-mute);
}
.feature__stat dd {
  margin: .3rem 0 0; font-family: var(--display);
  font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em;
}

/* ---------- about ---------- */
.about { display: grid; gap: var(--s-5); }
@media (min-width: 56rem) {
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: var(--s-6); }
}
.about__body { max-width: 62ch; font-size: 1.075rem; }
.about__body p + p { margin-top: 1.1em; }
.about__lede {
  font-size: var(--fs-lead); line-height: 1.45;
  font-style: italic; color: var(--fg);
  border-left: 2px solid var(--brick); padding-left: var(--s-3);
  margin-bottom: var(--s-4);
}

/* ---------- capabilities ---------- */
.caps { display: grid; gap: var(--s-5); }
@media (min-width: 44rem) { .caps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .caps { grid-template-columns: repeat(4, 1fr); gap: var(--s-4); } }
.caps__col h3 {
  font-size: var(--fs-h3); margin-bottom: var(--s-2);
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--edge);
}
.caps__col ul { list-style: none; margin: 0; padding: 0; }
.caps__col li {
  padding: .38rem 0; font-size: .95rem; color: var(--fg-mute);
  display: flex; gap: .6rem; align-items: baseline;
}
.caps__col li::before {
  content: ''; width: .3rem; height: .3rem; flex: none;
  background: var(--brick); border-radius: 50%; transform: translateY(-.15rem);
}

/* ---------- contact ---------- */
.contact__list {
  max-width: 46rem;
  margin: 0;
  border-top: 1px solid var(--edge);
}
.contact__row {
  display: grid;
  gap: .15rem 2rem;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--edge);
}
@media (min-width: 40rem) {
  .contact__row { grid-template-columns: 13rem minmax(0, 1fr); align-items: baseline; }
}
.contact__row dt {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-mute);
}
.contact__row dd { margin: 0; }
.contact__link {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.9vw, 1.4rem);
  font-weight: 600; letter-spacing: -.015em;
  text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
  word-break: break-word;
  transition: color var(--dur) var(--ease);
}
.contact__link:hover { color: var(--brick-lt); }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-4);
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4);
  justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .08em; color: var(--paper-mute);
}

/* ---------- case study pages ---------- */
.case__head { padding-block: calc(var(--s-8) + 1rem) var(--s-5); }
.case__title { font-size: var(--fs-h1); text-transform: uppercase; letter-spacing: -.035em; }
.case__sub { font-size: var(--fs-lead); color: var(--fg-mute); max-width: 46ch; margin-top: var(--s-3); }
.case__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--s-3); margin-top: var(--s-5);
  padding-top: var(--s-4); border-top: 1px solid var(--edge);
}
.case__facts dt {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-mute);
  margin-bottom: .35rem;
}
.case__facts dd { margin: 0; font-size: .98rem; }

.prose { max-width: 64ch; }
.prose h2 { font-size: var(--fs-h2); margin-bottom: var(--s-3); }
.prose h3 { font-size: var(--fs-h3); margin: var(--s-4) 0 var(--s-2); }
.prose + .prose { margin-top: var(--s-5); }

.quote {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.6vw, 2.5rem);
  font-weight: 500; line-height: 1.15; letter-spacing: -.025em;
  max-width: 22ch; margin: 0;
  text-wrap: balance;
}
.quote cite {
  display: block; margin-top: var(--s-3);
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase;
  font-style: normal; color: var(--fg-mute);
}

.shots { display: grid; gap: var(--s-3); }
.shots--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .shots--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shots--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 48rem) { .shots--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.shot { border: 1px solid var(--edge); background: var(--ink-3); overflow: hidden; margin: 0; }
/* Cap the height so square and portrait artwork can't grow taller than the
   screen; wide spreads are unaffected. Letterboxing sits on the ink ground. */
.shot img {
  width: auto; max-width: 100%;
  max-height: 78svh;
  margin-inline: auto;
}
.shot figcaption {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .08em; color: var(--fg-mute);
  padding: .7rem .9rem; border-top: 1px solid var(--edge);
}

/* long-scroll brand document */
.scrolldoc { max-width: 60rem; margin-inline: auto; border: 1px solid var(--edge); background: #fff; }
.scrolldoc img { width: 100%; display: block; margin: 0; }

.backlink {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--fg-mute);
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}
.backlink:hover { color: var(--fg); gap: .8rem; }

.nextup {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: space-between; align-items: baseline;
  text-decoration: none; color: inherit;
  padding-block: var(--s-5);
  border-top: 1px solid var(--edge);
}
.nextup__title {
  font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 600; letter-spacing: -.03em;
  transition: color var(--dur) var(--ease);
}
.nextup:hover .nextup__title { color: var(--brick-lt); }

/* ---------- motion ----------
   Reveal is opt-in: the script sets .js on <html>, so if it never runs the
   content is simply visible rather than stuck at opacity 0. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
