/* =========================================================================
   André Heneine: portfolio styles
   ========================================================================= */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --muted: #8a8a8a;
  --line: #e4e4e4;
  --footer: #f2f2f2;
  --tile: #f4f4f4;
  --gutter: clamp(16px, 4vw, 76px);
  --header-h: 104px;
  --radius: 10px;
  --font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 700; margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

[id] { scroll-margin-top: calc(var(--header-h) - 20px); }

/* Links: Regular → Bold on hover, without shifting the layout.
   A hidden bold copy (data-text) reserves the bold width in advance. */
.hl { display: inline-flex; flex-direction: column; }
.hl::after {
  content: attr(data-text);
  font-weight: 700;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  user-select: none;
  pointer-events: none;
}
.hl:hover, .hl:focus-visible, .hl.is-active { font-weight: 700; }

.underline { border-bottom: 2px solid currentColor; padding-bottom: 2px; }

.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }

.label { font-size: 18px; }

/* -------------------------------------------------------------------------
   Header: fixed, inverts its colour over dark content (like the reference)
   ------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--paper);
  color: var(--ink);
}

.wordmark {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1;
}

.nav { display: flex; align-items: center; gap: clamp(24px, 6vw, 96px); font-size: 18px; }
.nav ul { list-style: none; display: flex; margin: 0; padding: 0; }
.nav ul { gap: clamp(20px, 2.4vw, 36px); }

.menu-toggle { display: none; }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  padding: calc(var(--header-h) + 20px) var(--gutter) var(--gutter);
  display: none;
  flex-direction: column;
  gap: 8px;
  font-size: 40px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu .close {
  position: absolute;
  top: calc(var(--header-h) / 2 - 10px);
  right: var(--gutter);
}

@media (max-width: 760px) {
  :root { --header-h: 72px; }
  .wordmark { font-size: 18px; }
  .nav ul { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* -------------------------------------------------------------------------
   Hero / Showreel: the video grows as you scroll (driven by main.js)
   ------------------------------------------------------------------------- */
.hero { position: relative; height: 260vh; }

.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hello {
  position: absolute;
  left: var(--gutter);
  top: calc(var(--header-h) - 0.06em);
  font-size: min(33vw, 50vh);
  line-height: 0.82;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
  white-space: nowrap;
}

.reel {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: #000;
  overflow: hidden;
  will-change: transform;
}
.reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.reel-caption {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 18px;
  line-height: 1.35;
  will-change: transform;
}

.hero-intro {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(24px, 5vh, 56px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.hero-intro p {
  margin: 0 0 28px;
  font-size: clamp(28px, 3.2vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 17em;
}

/* Small screens: no scroll animation, just a stacked layout */
@media (max-width: 760px) {
  .hero { height: auto; }
  .hero-stage {
    position: static;
    height: auto;
    overflow: visible;
    padding: calc(var(--header-h) + 8px) var(--gutter) 48px;
    display: flex;
    flex-direction: column;
  }
  .hello { position: static; font-size: 36vw; margin-bottom: 24px; }
  .reel { position: relative; width: 100%; aspect-ratio: 16 / 9; transform: none !important; border-radius: var(--radius); }
  .reel-caption { position: static; transform: none !important; margin-top: 10px; }
  .hero-intro { position: static; flex-direction: column; align-items: flex-start; margin-top: 48px; opacity: 1 !important; }
  .hero-intro .scroll-hint { display: none; }
}

/* -------------------------------------------------------------------------
   About
   ------------------------------------------------------------------------- */
.section { padding-top: clamp(96px, 14vw, 200px); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 120px);
  align-items: start;
}
.about-photo {
  aspect-ratio: 1;
  max-width: 400px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--tile);
}
.about-text h2 {
  font-size: clamp(36px, 4.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: clamp(32px, 5vw, 72px);
}
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 24px;
}
.about-body .lead { color: var(--ink); margin-top: 0; }
.about-body p { color: var(--muted); margin: 0 0 1.2em; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 400px; }
  .about-body { grid-template-columns: 1fr; gap: 8px; }
}

/* Tools carousel: endless marquee, pauses on hover */
.tools {
  margin-top: clamp(64px, 8vw, 120px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.tools-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.tools:hover .tools-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 8px)); } }

.tool {
  flex: 0 0 auto;
  width: clamp(150px, 15vw, 210px);
  aspect-ratio: 1;
  max-width: 400px;
  border-radius: var(--radius);
  background: var(--tile);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 16px;
}
.tool img { width: 38%; height: 38%; object-fit: contain; mix-blend-mode: multiply; }
.tool .monogram {
  width: 38%;
  aspect-ratio: 1;
  max-width: 400px;
  border-radius: 22%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 34px);
}

@media (prefers-reduced-motion: reduce) {
  .tools { overflow-x: auto; }
  .tools-track { animation: none; }
}

/* -------------------------------------------------------------------------
   Work
   ------------------------------------------------------------------------- */
.work-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 32px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.work-head h2 {
  font-size: clamp(96px, 17vw, 300px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  margin-left: -0.05em;
}
.work-head .blurb { justify-self: end; margin: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 36px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.filters button {
  padding: 0 0 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}
.filters button.is-active { border-bottom-color: var(--ink); }

.grid {
  --cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
}
.tile {
  position: relative;
  aspect-ratio: 1;
  max-width: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tile);
  display: block;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.tile-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(16px, 2vw, 28px);
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.08) 60%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tile-info strong { font-size: clamp(18px, 1.6vw, 26px); line-height: 1.15; }
.tile-info span { font-size: 15px; opacity: .8; }
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile[aria-disabled="true"] { cursor: default; }

.grid-empty { color: var(--muted); grid-column: 1 / -1; }

.see-all {
  font-size: clamp(36px, 4.8vw, 80px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  border-bottom: 3px solid currentColor;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
}
.see-all sup { font-size: 0.3em; align-self: flex-start; margin-top: 0.2em; }

@media (max-width: 900px) {
  .work-head { grid-template-columns: 1fr; gap: 16px; }
  .work-head .blurb { justify-self: start; }
  .grid { --cols: 2 !important; }
}
@media (max-width: 520px) {
  .grid { --cols: 1 !important; }
}

/* -------------------------------------------------------------------------
   Contact
   ------------------------------------------------------------------------- */
.contact { margin-top: clamp(96px, 14vw, 200px); border-top: 1px solid var(--line); }
.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-top: clamp(64px, 8vw, 120px);
  padding-bottom: clamp(64px, 8vw, 120px);
}
.contact h2, .contact .email {
  font-size: clamp(36px, 4.8vw, 80px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.contact .email { border-bottom: 3px solid currentColor; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--footer);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: 16px;
}
.socials { display: flex; gap: 16px; }
.socials a { display: grid; place-items: center; width: 36px; height: 36px; transition: opacity .2s; }
.socials a:hover { opacity: .55; }
.socials svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   Project pages
   ------------------------------------------------------------------------- */
.project { padding-top: calc(var(--header-h) + clamp(32px, 6vw, 96px)); padding-bottom: clamp(96px, 12vw, 180px); }
.back { display: inline-flex; margin-bottom: 40px; }
.project h1 {
  font-size: clamp(44px, 7vw, 120px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14em;
}
.project-meta { margin-top: 20px; }
.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  margin: clamp(48px, 6vw, 96px) 0;
}
.project-body .text p { margin: 0 0 1.2em; max-width: 36em; }
.videos { display: grid; gap: clamp(24px, 3vw, 48px); }
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video.vertical { aspect-ratio: 9 / 16; width: min(100%, 400px); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.next-row { display: flex; justify-content: flex-end; margin-top: clamp(64px, 8vw, 120px); }

@media (max-width: 900px) {
  .project-body { grid-template-columns: 1fr; }
}

.see-all:hover .hl { font-weight: 700; }
