/* Wael Chams — shared styles for every page.
   Page-specific styles live in each page template (src/pages/*.html). */

:root {
  --accent: #FF6B1A;
  --gx: clamp(40px, 8vw, 128px);          /* side margin */
  --hh: 104px;                            /* header height */
  --menu-size: clamp(19px, 1.68vw, 24px);
  --hover-size: clamp(34px, 3.7vw, 53px);
  --bg: #ffffff; --fg: #0a0a0a; --muted: #4a4f4c; --soft: #2f3431;
}
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif; }
a { color: #0a0a0a; text-decoration: none; }
a:hover { color: #0a0a0a; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Header (two layers: a blend layer for the white text, a top layer for links and the orange hover) ---------- */
.hdr { position: sticky; top: 0; height: var(--hh); box-sizing: border-box; padding: calc(var(--hh) - 58px) var(--gx) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; align-items: start;
  transition: transform .35s ease; }
.hdr.up { transform: translateY(-100%); }
.hdr-base { z-index: 10; pointer-events: none; mix-blend-mode: normal; }
.hdr-base.inv { mix-blend-mode: difference; }
.hdr-top { z-index: 11; margin-top: calc(var(--hh) * -1); pointer-events: none; }
.hdr-top a, .hdr-top button { pointer-events: auto; } /* clicks between the links reach the film underneath */
.mn { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--menu-size); line-height: 1; white-space: nowrap; }
.mn-brand { justify-self: start; font-weight: 600; letter-spacing: -0.035em; color: #ffffff; }
.hdr-top .mn-brand { color: transparent; }
.mn-item { font-weight: 500; letter-spacing: -0.02em; }
.nv { display: flex; align-items: center; justify-content: flex-end; gap: clamp(18px, 2.2vw, 36px); }
.ch { font-weight: 400; transition: color .4s ease; }
.hdr-base .ch { color: #ffffff; }
.hdr-base .ch.lit { color: transparent; }
.hdr-top .ch { color: transparent; }
.hdr-top .ch.lit { color: var(--accent); }

/* ---------- Phone menu ---------- */
.mb { display: none; grid-column: 2; grid-row: 1; justify-self: end; align-self: start; position: relative; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: #ffffff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.mb { color: transparent; }
.mb i, .mbtn i { position: absolute; left: 10px; right: 10px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
.mb i:nth-child(1), .mbtn i:nth-child(1) { top: 15px; }
.mb i:nth-child(2), .mbtn i:nth-child(2) { top: 21px; }
.mb i:nth-child(3), .mbtn i:nth-child(3) { top: 27px; }
.mo { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #ffffff; color: #0a0a0a; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.mo.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.mobar { flex: none; height: 60px; box-sizing: border-box; padding: 16px 20px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.mobrand { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; color: #0a0a0a !important; }
.mbtn { position: relative; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: #0a0a0a; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mo.open .mbtn i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mo.open .mbtn i:nth-child(2) { opacity: 0; }
.mo.open .mbtn i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.molinks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-bottom: 60px; }
.molinks a { font-size: 46px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1; color: #0a0a0a !important; opacity: 0; transform: translateY(12px); transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.mo.open .molinks a { opacity: 1; transform: none; }
.mo:not(.open) .molinks a { transition-delay: 0s !important; }
@media (min-width: 601px) { .mo { display: none !important; } }
@media (max-width: 600px) {
  .nv { display: none !important; }
  .mb { display: block; }
  .hdr { padding-left: 20px !important; padding-right: 20px !important; padding-top: 16px !important; height: 60px !important; }
  .hdr-top { margin-top: -60px !important; }
  .hero { margin-top: -60px !important; }
  .mn { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) { .mo, .mo.open, .molinks a, .mbtn i { transition: none !important; } }

/* ---------- Work tiles (home list and "Next project") ---------- */
.tile { position: relative; display: block; overflow: hidden; }
.tile > img { display: block; width: 100%; height: auto; }
.tile .ttl-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--gx); pointer-events: none; }
.tile .ttl { color: #ffffff; font-size: var(--hover-size); font-weight: 500; letter-spacing: -0.04em; line-height: 1; text-align: center;
  opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1); }
.tile:focus-visible .ttl, .tile.act .ttl { opacity: 1; transform: none; }
@media (hover: hover) { .tile:hover .ttl { opacity: 1; transform: none; } }
.tv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.tv.on { opacity: 1; }
@media (max-width: 760px) { .tile > img { aspect-ratio: 16 / 9 !important; object-fit: cover; } }

/* ---------- Grids and media blocks (project pages, contact) ---------- */
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 1.6vw, 24px); row-gap: 32px; }
.cl { grid-column: 1 / span 5; }
.cr { grid-column: 7 / span 6; }
.cfull { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; }
.split { display: grid; grid-template-columns: 256fr 81fr; gap: 0; }
.split.rev { grid-template-columns: 81fr 256fr; }
.third { display: grid; grid-template-columns: 1fr 2fr; gap: 0; }
.third > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.third > video { display: block; width: 100%; height: 100%; aspect-ratio: 8 / 5; object-fit: cover; object-position: 50% 50%; }
.m { display: block; width: 100%; height: auto; object-fit: cover; background: #000000; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(16px, 1.6vw, 24px); row-gap: 32px; }
.c24 { grid-column: 2 / span 3; }
.sub3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(16px, 1.6vw, 24px); row-gap: 28px; }
.dt { font-size: clamp(16px, 1.25vw, 18px); letter-spacing: 0; line-height: 1.4; font-weight: 400; }
.dd { margin: 0; font-size: clamp(19px, 1.68vw, 24px); font-weight: 400; letter-spacing: -0.01em; line-height: 1.4; }
@media (max-width: 760px) {
  .cl, .cr { grid-column: 1 / -1; }
  .pair, .trio, .split, .split.rev, .third { grid-template-columns: 1fr; }
  .third > video { height: auto; aspect-ratio: 16 / 9; }
  .g4 { grid-template-columns: 1fr; }
  .c24 { grid-column: 1 / -1; }
  .sub3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
