/* ===================================================
   Zouhayr Malha — Portfolio
   Clean editorial design · light animations
   =================================================== */

:root {
  --bg: #faf7f2;
  --ink: #141210;
  --muted: #7a736a;
  --line: #e6e0d6;
  --accent: #ad7f56;
  --accent-2: #cc9e67;
  --radius: 20px;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

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

::selection { background: var(--accent); color: #fff; }

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader__word {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  animation: loaderPulse 1.2s var(--ease) infinite alternate;
}
.loader__word em { color: var(--accent-2); }
@keyframes loaderPulse {
  from { opacity: 0.4; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loader.is-done { opacity: 0; visibility: hidden; }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  z-index: 50;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
}
.nav.is-scrolled {
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.nav__logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  transition: color 0.4s;
}
.nav__logo em { color: var(--accent); }

/* Light nav while over the dark hero (top of page) */
.nav:not(.is-scrolled) .nav__logo { color: var(--bg); }
.nav:not(.is-scrolled) .nav__logo em { color: var(--accent-2); }
.nav:not(.is-scrolled) .nav__links a { color: #b8b1a6; }
.nav:not(.is-scrolled) .nav__links a:hover { color: var(--bg); }
.nav:not(.is-scrolled) .btn--small {
  border-color: rgba(250, 247, 242, 0.55);
  color: var(--bg);
}
.nav:not(.is-scrolled) .btn--small:hover {
  background: var(--bg);
  color: var(--ink);
}
.nav__links {
  display: flex;
  gap: 2rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav__links a {
  position: relative;
  color: var(--muted);
  transition: color 0.3s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 99px;
  border: 1.5px solid var(--ink);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--dark {
  background: var(--ink);
  color: var(--bg);
}
.btn--dark:hover { background: var(--accent); border-color: var(--accent); }
.btn--small {
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
}
.btn--small:hover { background: var(--ink); color: var(--bg); }
.btn__arrow { transition: transform 0.35s var(--ease); }
.btn:hover .btn__arrow { transform: translateY(3px); }

/* ===== Hero (dark cinematic — shattered glass) ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1.2rem, 4vw, 3rem) 4rem;
  background: #0c0a09 url("../media/hero-poster.jpg") right center / cover no-repeat;
  color: var(--bg);
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s var(--ease), transform 2.2s var(--ease);
  transition-delay: 0.9s;
  animation: posterBreathe 30s ease-in-out 4s infinite alternate;
}
body.is-ready .hero__bg { opacity: 1; transform: scale(1); }
@keyframes posterBreathe {
  from { scale: 1; }
  to   { scale: 1.05; }
}
.hero > :not(.hero__poster) { position: relative; z-index: 2; }
.hero__poster {
  position: absolute;
  inset: -20px;
  z-index: 1;
  transition: transform 0.4s ease-out;
}
.hero__shards { position: absolute; inset: 0; }
.shard {
  position: absolute;
  inset: 0;
  clip-path: var(--clip);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.1s var(--ease), transform 1.4s var(--ease);
  transition-delay: calc(1s + var(--i, 0) * 0.14s);
}
.shard:nth-child(1) { --i: 0; }
.shard:nth-child(2) { --i: 1; }
.shard:nth-child(3) { --i: 2; }
.shard:nth-child(4) { --i: 3; }
.shard:nth-child(5) { --i: 7; }
.shard:nth-child(6) { --i: 6; }
.shard:nth-child(7) { --i: 5; }
.shard:nth-child(8) { --i: 4; }
body.is-ready .shard { opacity: 1; transform: scale(1); }
.shard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.22) saturate(0.8) brightness(0.5) contrast(1.08);
  animation: breathe 22s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -3s);
}
@keyframes breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.09); }
}

/* light sweep across the glass — the reel hook */
.hero__sweep {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 226, 180, 0.06) 47%,
    rgba(255, 236, 200, 0.14) 50%,
    rgba(255, 226, 180, 0.06) 53%,
    transparent 58%
  );
  transform: translateX(-70%);
  animation: sweep 7.5s ease-in-out infinite;
  animation-delay: 2.4s;
  pointer-events: none;
}
@keyframes sweep {
  0% { transform: translateX(-70%); }
  55% { transform: translateX(70%); }
  100% { transform: translateX(70%); }
}
.hero__cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}
.hero__glass {
  position: absolute;
  inset: 0;
  background: url("../media/hero-glass.jpg") right center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.5;
}
/* vignette so the text zone stays readable over the shard collage */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(10, 8, 7, 0.96) 0%, rgba(10, 8, 7, 0.78) 38%, rgba(10, 8, 7, 0.35) 60%, rgba(10, 8, 7, 0) 80%),
    linear-gradient(0deg, rgba(10, 8, 7, 0.68) 0%, rgba(10, 8, 7, 0) 30%),
    linear-gradient(180deg, rgba(10, 8, 7, 0.72) 0%, rgba(10, 8, 7, 0) 26%);
  pointer-events: none;
}
.hero__eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.4rem;
}
.hero__title {
  font-size: clamp(2.6rem, 8.5vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
.hero__title em {
  color: var(--accent-2);
  letter-spacing: -0.01em;
  font-weight: 400;
}
.hero__title .line { display: block; }
.hero__bottom {
  margin-top: 2.8rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.hero__desc {
  max-width: 26rem;
  color: #b8b1a6;
  font-size: 1.05rem;
}
.btn--hero {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--bg);
}
.btn--hero:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Load animations */
.reveal-load {
  opacity: 0;
  transform: translateY(28px);
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: calc(var(--d, 0s) + 0.9s);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Marquee ===== */
.marquee {
  border-top: 1px solid #2a251f;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1.1rem 0;
  background: #100e0c;
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  animation: scroll 28s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  font-family: var(--font-display);
  font-size: 1.4rem;
  white-space: nowrap;
  color: var(--bg);
}
.marquee__track i {
  color: var(--accent);
  font-style: normal;
  font-size: 0.9rem;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== Sections ===== */
section { padding: clamp(4.5rem, 9vw, 8rem) clamp(1.2rem, 4vw, 3rem); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.section-head h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-head h2 em { color: var(--accent); font-weight: 400; }
.section-head p { color: var(--muted); }

/* ===== Work categories ===== */
.work__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: -1.4rem 0 3rem;
}
.cat-chip {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 0.45rem 1rem;
  transition: color 0.3s, border-color 0.3s;
}
.cat-chip:hover { color: var(--accent); border-color: var(--accent); }
.work__cat { margin-bottom: 3.6rem; }
.work__cat:last-child { margin-bottom: 0; }
.work__cat-title {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.work__cat-title em {
  color: var(--accent);
  font-size: 0.75em;
  margin-right: 0.5rem;
}
.work__cat-note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.72em;
  color: var(--accent);
}

/* ===== Work grid ===== */
.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}
.card {
  display: block;
  position: relative;
}
.card__cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.18), transparent 55%);
}
.card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s var(--ease);
}
.card:hover .card__cover img { transform: scale(1.05); }
.card__cover--cta {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__cta-text {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
  line-height: 1.15;
  position: relative;
  z-index: 1;
  transition: transform 0.6s var(--ease);
}
.card__cta-text em { color: var(--accent-2); font-weight: 400; }
.card--cta:hover .card__cta-text { transform: scale(1.06); }
.card__cover { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.card:hover .card__cover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -20px rgba(20, 18, 16, 0.35);
}
.card__meta { margin-top: 1.1rem; }
.card__meta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 0.3s;
}
.card:hover .card__meta h3 { color: var(--accent); }
.card__meta p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}
.card__year {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
}

/* ===== About ===== */
.about { background: var(--ink); color: var(--bg); }
.about__inner {
  display: grid;
  grid-template-columns: auto 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.about__photo {
  position: relative;
  width: clamp(180px, 20vw, 260px);
}
.about__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  transform: translate(12px, 12px);
  pointer-events: none;
  transition: transform 0.5s var(--ease);
}
.about__photo:hover::after { transform: translate(6px, 6px); }
.about__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(0.92);
}
.btn--light {
  margin-top: 1.6rem;
  background: transparent;
  color: var(--bg);
  border-color: var(--accent-2);
}
.btn--light:hover { background: var(--accent-2); color: var(--ink); }
.about h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}
.about h2 em { color: var(--accent-2); font-weight: 400; }
.about p {
  color: #b8b1a6;
  max-width: 34rem;
}
.about p + p { margin-top: 1rem; }
.about__stats {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}
.stat { border-left: 2px solid var(--accent); padding-left: 1.4rem; }
.stat__num, .stat__plus {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  line-height: 1;
  color: var(--bg);
}
.stat__plus { color: var(--accent-2); }
.stat__label {
  display: block;
  margin-top: 0.3rem;
  color: #b8b1a6;
  font-size: 0.92rem;
}

/* ===== Services ===== */
.services__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.service {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  background: #fff;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}
.service:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -24px rgba(173, 127, 86, 0.4);
}
.service__num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1.1rem;
}
.service h3 {
  margin: 0.8rem 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.service p { color: var(--muted); font-size: 0.93rem; }

/* ===== Contact ===== */
.contact {
  text-align: center;
  padding-top: clamp(5rem, 12vw, 10rem);
  padding-bottom: clamp(5rem, 12vw, 10rem);
}
.contact__eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.contact__big {
  display: inline-block;
  font-size: clamp(2.4rem, 7.5vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  transition: color 0.35s;
}
.contact__big em { color: var(--accent); font-weight: 400; }
.contact__arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
.contact__big:hover .contact__arrow { transform: translateX(12px); }
.contact__mail {
  margin-top: 1.6rem;
  color: var(--muted);
}

/* ===== Footer ===== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer__top { transition: color 0.3s; }
.footer__top:hover { color: var(--accent); }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .about__inner { grid-template-columns: auto 1fr; }
  .about__stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 1.6rem; }
  .stat { flex: 1 1 30%; }
}
@media (max-width: 820px) {
  .about__inner { grid-template-columns: 1fr; }
  .about__photo { width: clamp(180px, 45vw, 240px); }
}
@media (max-width: 600px) {
  .nav__links { display: none; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero { background-position: 62% center; }
  .hero__poster { display: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-load { opacity: 1; transform: none; animation: none; transition: none; }
  .marquee__track { animation: none; }
  .shard { transition: none; opacity: 1; transform: none; }
  .shard img { animation: none; }
  .hero__sweep { animation: none; opacity: 0; }
  .hero__poster { transition: none; }
  .hero__bg { transition: none; animation: none; opacity: 1; transform: none; }
}
