/* ============================================================
   whatemmadoes.com — design system
   Canvas stays quiet ink-on-gesso; every project floods the
   page with its own brand colour. Type: Bricolage Grotesque
   (display) / Rubik (body, Arabic) / Marhey (Arabic display).
   ============================================================ */

:root {
  --paper: #F6F3EC;
  --ink: #1C1811;
  --muted: color-mix(in srgb, currentColor 60%, transparent);
  --font-display: "Bricolage Grotesque", "Rubik", sans-serif;
  --font-body: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Marhey", "Rubik", sans-serif;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --page-bg: var(--paper);
  --page-ink: var(--ink);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--page-bg);
  color: var(--page-ink);
  transition: background-color .55s ease, color .55s ease;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

[lang="ar"] { font-family: var(--font-ar); direction: rtl; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem var(--gutter);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.wordmark {
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
}

.wordmark .spark {
  display: inline-block;
  margin-left: .15em;
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}

.wordmark:hover .spark { transform: rotate(180deg) scale(1.2); }

.site-header nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }

.site-header nav a {
  text-decoration: none;
  position: relative;
}

.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -.2em;
  border-bottom: 2px solid currentColor;
  transition: right .25s ease;
}

.site-header nav a:hover::after,
.site-header nav a[aria-current]::after { right: 0; }

/* ---------- hero ---------- */

.hero {
  min-height: calc(100svh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem var(--gutter) 4rem;
}

.hero-ar {
  font-family: var(--font-ar);
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  margin: 0 0 .5rem;
  color: var(--muted);
}

.masthead {
  font-size: clamp(3.6rem, 14.5vw, 12.5rem);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  line-height: .88;
  letter-spacing: -.025em;
  text-transform: uppercase;
  margin: 0 0 1.2rem;
}

.masthead-line { display: block; overflow: hidden; }

.masthead-line > span, .masthead-line { will-change: transform; }

@keyframes rise-in {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.masthead .masthead-line {
  animation: rise-in .7s cubic-bezier(.22, .9, .3, 1) backwards;
}

.masthead .masthead-line:nth-child(2) { animation-delay: .08s; }
.masthead .masthead-line:nth-child(3) { animation-delay: .16s; }

.masthead-dot { color: #D6087B; }

.hero-cycle {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  font-weight: 500;
  margin: 0 0 1.4rem;
  display: flex;
  gap: .45em;
  align-items: baseline;
}

.cycle-stage {
  position: relative;
  display: inline-block;
  min-width: 9.5em;
  height: 1.25em;
}

.cycle-word {
  position: absolute;
  inset: 0 auto auto 0;
  white-space: nowrap;
  color: var(--wc, currentColor);
  font-weight: 700;
  opacity: 0;
  transform: translateY(.5em);
  transition: opacity .35s ease, transform .35s ease;
}

.cycle-word.is-current { opacity: 1; transform: translateY(0); }

.hero-intro {
  max-width: 34em;
  margin: 0 0 2.5rem;
  color: var(--muted);
}

.scroll-cue {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: .15em;
}

.scroll-cue span { display: inline-block; transition: transform .3s ease; }
.scroll-cue:hover span { transform: translateY(.2em); }

/* ---------- section heads ---------- */

.section-head {
  padding: 0 var(--gutter);
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.01em;
  display: flex;
  align-items: baseline;
  gap: 1em;
  flex-wrap: wrap;
}

.eyebrow-ar {
  font-family: var(--font-ar);
  font-size: .5em;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
}

.section-head p { color: var(--muted); margin: .5rem 0 0; max-width: 40em; }

/* ---------- work index (signature) ---------- */

.work { padding: 6rem 0 4rem; }

.work-index { border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }

.work-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1.6rem var(--gutter);
  border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  text-decoration: none;
  transition: opacity .35s ease, padding-left .35s ease;
}

.work-title {
  display: flex;
  align-items: baseline;
  gap: .6em;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4.6rem);
  font-weight: 700;
  font-variation-settings: "opsz" 96;
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: 1;
}

.work-title-ar {
  font-family: var(--font-ar);
  font-size: .45em;
  font-weight: 400;
  opacity: 0;
  transform: translateX(-.4em);
  transition: opacity .35s ease, transform .35s ease;
}

.work-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  font-size: .9rem;
  text-align: right;
}

.work-discipline { font-weight: 500; }

.work-count {
  font-family: var(--font-display);
  font-weight: 600;
  opacity: .5;
  font-size: .8rem;
  letter-spacing: .08em;
}

.work-thumb { display: none; }

/* flood behaviour (desktop pointer devices) */
@media (hover: hover) {
  body.is-flooding .work-row:not(.is-active) { opacity: .28; }
  .work-row.is-active { padding-left: calc(var(--gutter) + .6rem); }
  .work-row.is-active .work-title-ar { opacity: .85; transform: translateX(0); }
}

.work-more {
  padding: 1.4rem var(--gutter) 0;
  color: var(--muted);
  font-style: normal;
}

/* floating cursor preview */
.cursor-preview {
  position: fixed;
  z-index: 40;
  top: 0; left: 0;
  width: clamp(220px, 26vw, 420px);
  pointer-events: none;
  opacity: 0;
  transform: scale(.92);
  transition: opacity .3s ease, transform .3s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.cursor-preview.is-visible { opacity: 1; transform: scale(1); }

.cursor-preview img { width: 100%; }

/* ---------- about ---------- */

.about { padding: 6rem 0; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem var(--gutter);
  padding: 0 var(--gutter);
}

.bio-lede {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 1rem;
}

.about-bio p { max-width: 38em; }

.skill-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0;
  margin: 1.6rem 0 1rem;
}

.skill-chips li {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  border: 1.5px solid currentColor;
  border-radius: 100px;
  padding: .35em .9em;
}

.lang-line { color: var(--muted); font-size: .95rem; }

.about-cv h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--muted);
}

.about-cv h3 + .cv-list { margin-bottom: 2.4rem; }

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

.cv-list li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 1rem;
  padding: .8rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}

.cv-when {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}

.cv-what { font-size: .98rem; }

/* ---------- contact ---------- */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: 7rem var(--gutter);
  text-align: center;
}

.contact-ar {
  font-family: var(--font-ar);
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  margin: 0 0 1rem;
  opacity: .75;
}

.contact-head {
  font-size: clamp(2.8rem, 8.5vw, 7rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: -.02em;
  margin-bottom: 2rem;
}

.contact-mail {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 600;
  text-decoration-thickness: 3px;
  text-underline-offset: .2em;
}

.contact-mail:hover { text-decoration-style: wavy; }

.contact-loc { margin-top: 2rem; opacity: .6; font-size: .95rem; }

/* ---------- footer ---------- */

.site-footer {
  padding: 2rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--muted);
}

.case-page .site-footer { color: inherit; opacity: .75; }

.footer-ar { font-family: var(--font-ar); margin: 0; }

.site-footer p { margin: 0; }

/* ---------- case pages ---------- */

.case-page {
  --page-bg: var(--flood);
  --page-ink: var(--on);
  background: var(--flood);
  color: var(--on);
}

.case-page ::selection { background: var(--on); color: var(--flood); }

.case-hero {
  padding: 4rem var(--gutter) 5rem;
  max-width: 72rem;
}

.case-kicker {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .85rem;
  margin: 0 0 1.2rem;
  opacity: .8;
}

.case-title {
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.02em;
  margin-bottom: 1.6rem;
  display: flex;
  align-items: baseline;
  gap: .35em;
  flex-wrap: wrap;
}

.case-title-ar {
  font-family: var(--font-ar);
  font-size: .42em;
  font-weight: 600;
}

.case-intro {
  max-width: 42em;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  margin: 0 0 2.8rem;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 0;
  padding-top: 1.4rem;
  border-top: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}

.case-meta-item dt {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  opacity: .7;
  margin-bottom: .25rem;
}

.case-meta-item dd { margin: 0; font-weight: 500; font-size: .95rem; }

.case-flow {
  display: grid;
  gap: 0;
}

.case-row {
  display: grid;
  gap: 0;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.case-row.cols-2 { grid-template-columns: 1fr 1fr; }
.case-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.case-row.has-bg {
  background-size: cover;
  background-position: center;
}

.case-row figure { margin: 0; }

.case-row img, .case-row video { width: 100%; }

/* scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .js :is(.case-row, .about-grid, .contact-head) {
    transition: opacity .6s ease, transform .6s ease;
  }
  .js :is(.case-row, .about-grid, .contact-head):not(.revealed) {
    opacity: 0;
    transform: translateY(26px);
  }
  /* case images tile edge-to-edge — fade only, no slide */
  .js .case-row:not(.revealed) { transform: none; }
}

.case-next { display: block; }

.case-next a {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 5rem var(--gutter);
  text-decoration: none;
  background: var(--flood);
  color: var(--on);
  transition: letter-spacing .3s ease;
}

.next-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  opacity: .75;
}

.next-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
}

.case-next a:hover .next-title { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: .12em; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .site-header nav { font-size: .9rem; }

  .hero { min-height: calc(100svh - 3.5rem); padding-bottom: 3rem; }

  .cycle-stage { min-width: 8.5em; }

  .work-row {
    grid-template-columns: 1fr 5.2rem;
    grid-template-areas: "title thumb" "meta thumb";
    padding: 1.2rem var(--gutter);
  }

  .work-title { grid-area: title; }

  .work-title-ar { opacity: .7; transform: none; }

  .work-meta {
    grid-area: meta;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: .8rem;
    font-size: .8rem;
    text-align: left;
  }

  .work-count { white-space: nowrap; }

  .work-thumb {
    display: block;
    grid-area: thumb;
    width: 5.2rem;
    height: 5.2rem;
    object-fit: cover;
    border-radius: 4px;
  }

  .about-grid { grid-template-columns: 1fr; }

  .case-row.cols-2, .case-row.cols-3 { grid-template-columns: 1fr; }

  .case-meta { gap: 1.4rem 2rem; }

  .cv-list li { grid-template-columns: 6em 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .masthead .masthead-line { animation: none; }
  .cycle-word { transition: opacity .2s ease; transform: none; }
  .cursor-preview { transition: opacity .2s ease; }
}
