@font-face {
  font-family: "Manrope";
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope.woff2) format("woff2");
}

:root {
  --bg: #d8d8d8;
  --text: #0c0c0c;
  --accent: #ff6600;
  --gutter: clamp(20px, 5vw, 80px);
  --header-h: 112px;
  --ease: cubic-bezier(.19, 1, .22, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font: 500 16px/1.7 "Manrope", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg) url(bg.jpg) 0 0 / 420px repeat;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.dark { --bg: #020202; --text: #f2f2f2; background: var(--bg); }
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 500; line-height: 1.25; }
p { margin: 0 0 1em; }
em { font-style: normal; font-weight: 700; color: var(--accent); }

/* ---------- header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter);
  transition: padding .5s var(--ease);
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg); opacity: 0; transition: opacity .4s;
}
body.scrolled .header { padding-top: 14px; padding-bottom: 14px; }
/* scrolled: orange bar, white logo + nav (not while the mobile menu overlay is open) */
body.scrolled .header::before { opacity: 1; background: var(--accent); box-shadow: 0 6px 24px rgb(255 102 0 / .25); }
body.scrolled:not(.menu-open) .header { color: #fff; }
body.scrolled:not(.menu-open) .logo .dark { display: none; }
body.scrolled:not(.menu-open) .logo .light { display: block; }
body.scrolled:not(.menu-open) .nav a::after,
body.scrolled:not(.menu-open) .nav a[aria-current] span { color: #0c0c0c; }
.logo { position: relative; z-index: 2; }
.logo img { height: 84px; width: auto; transition: height .5s var(--ease); }
body.scrolled .logo img { height: 44px; }
.logo .light, body.dark .logo .dark { display: none; }
body.dark .logo .light { display: block; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 36px; }
.nav a {
  position: relative; display: block; overflow: hidden;
  text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.6;
}
/* rolling text on hover */
.nav a span { display: block; transition: transform .5s var(--ease); }
.nav a::after {
  content: attr(data-name); position: absolute; left: 0; top: 100%;
  color: var(--accent); transition: transform .5s var(--ease);
}
.nav a:hover span, .nav a:hover::after { transform: translateY(-100%); }
.nav a[aria-current] span { color: var(--accent); }

.menu-toggle {
  display: none; position: relative; z-index: 2;
  width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; color: inherit; cursor: pointer;
}
.menu-toggle span, .menu-toggle span::before {
  position: absolute; left: 10px; right: 10px; height: 2px;
  background: currentColor; transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-toggle span { top: 17px; }
.menu-toggle span::before { content: ""; left: 0; right: 0; top: 8px; }
body.menu-open .menu-toggle span { top: 21px; transform: rotate(45deg); }
body.menu-open .menu-toggle span::before { top: 0; transform: rotate(-90deg); }

/* ---------- layout ---------- */
main { padding: calc(var(--header-h) + 60px) var(--gutter) 60px; max-width: 1600px; margin: 0 auto; }

/* ---------- portfolio grid ---------- */
.grid {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(40px, 7vw, 120px);
  max-width: 1440px; margin: 0 auto;
}
.item { position: relative; margin-bottom: clamp(80px, 9vw, 150px); }
/* staggered "random column" layout */
.item:nth-child(even) { margin-top: 14vw; }
.item:nth-child(4n+1) { width: 88%; }
.item:nth-child(4n+2) { width: 92%; justify-self: end; }
.item:nth-child(4n+3) { width: 100%; }
.item:nth-child(4n) { width: 84%; justify-self: end; }
.item-inner { will-change: transform; }
.item a { display: block; text-decoration: none; }
.media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #0002; }
.media img, .media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.media video { opacity: 0; transition: transform 1.2s var(--ease), opacity .5s; }
.item a:hover .media img, .item a:hover .media video { transform: scale(1.06); }
.item a.playing video { opacity: 1; }

.caption {
  position: absolute; left: -24px; bottom: -28px; z-index: 1;
  padding: 14px 22px 12px; max-width: calc(100% + 24px);
  background: var(--cap-bg, #111);
  will-change: transform;
}
.caption h2 { margin: 0; font-size: clamp(19px, 1.9vw, 26px); line-height: 1.3; color: var(--cap-name, #fff); }
.caption span { display: block; font-size: 14px; line-height: 1.6; color: var(--cap-cat, #fff); opacity: .9; }

/* reveal on scroll */
.reveal .media { clip-path: inset(100% 0 0 0); transition: clip-path 1.2s var(--ease); }
.reveal .caption { opacity: 0; transform: translateY(20px); transition: opacity .8s .3s, transform .8s .3s var(--ease); }
.reveal.in .media { clip-path: inset(0); }
.reveal.in .caption { opacity: 1; transform: none; }

/* custom cursor */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  --x: -100px; --y: -100px;
  width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  transform: translate(var(--x), var(--y)) scale(0);
  transition: transform .35s var(--ease);
}
.cursor.on { transform: translate(var(--x), var(--y)) scale(1); }

/* ---------- project page ---------- */
.project h1 { font-size: clamp(32px, 4.5vw, 56px); line-height: 1.15; }
.project h2 { font-size: clamp(24px, 3vw, 40px); }
.project h4 { font-size: clamp(20px, 2.2vw, 30px); }
.row { display: flex; gap: 40px; margin-bottom: 40px; max-width: 1300px; margin-inline: auto; }
.row .row { margin-bottom: 0; gap: 20px; }
/* uniform images: one ratio; pairs square so portrait + landscape line up */
.col > img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.pair .col > img { aspect-ratio: 1; }
.col { flex: 0 0 calc(var(--w) * 1% - 40px * (1 - var(--w) / 100)); min-width: 0; }
.row .row .col { flex-basis: calc(var(--w) * 1% - 20px * (1 - var(--w) / 100)); }
.col > * + * { margin-top: 20px; }
.col ul { padding-left: 1.2em; margin: 0 0 1em; }
.col a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.text p:last-child { margin-bottom: 0; }

.video { position: relative; aspect-ratio: 16 / 9; background: #111; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video button {
  position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; overflow: hidden;
  background: #111; color: #fff; font: inherit;
  display: grid; place-items: center;
}
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.video button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(0 0 0 / .75)); }
.video button::before {
  content: ""; position: relative; z-index: 1; width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 34px no-repeat;
  transition: transform .4s var(--ease);
}
.video button:hover::before { transform: scale(1.12); }
.video button:hover img { transform: scale(1.04); }
.video-meta { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.video-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: clamp(16px, 1.6vw, 20px); font-weight: 700; line-height: 1.3; }
.video small { font-size: 12px; line-height: 1.4; opacity: .7; }

.next {
  display: flex; align-items: center; gap: 30px;
  margin: 100px auto 0; max-width: 900px; text-decoration: none;
}
.next img { width: 45%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 1s var(--ease); }
.next:hover img { transform: scale(1.04); }
.next small { display: block; color: var(--accent); font-weight: 700; }
.next strong { font-size: clamp(24px, 3.5vw, 44px); font-weight: 500; line-height: 1.2; }

/* ---------- about / legal ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 120px); max-width: 1300px; margin: 0 auto; align-items: start; }
.about-photo { position: sticky; top: calc(var(--header-h) + 20px); margin: 0; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about h1 { font-size: clamp(40px, 5.5vw, 76px); line-height: 1.05; letter-spacing: -.02em; margin-bottom: .4em; }
.about h2 { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2em; }
.about section + section { margin-top: clamp(56px, 7vw, 96px); }
.about ul, .about ol { list-style: none; margin: 0; padding: 0; }
.lead { font-size: clamp(20px, 2vw, 26px); line-height: 1.45; }
.services { font-size: clamp(24px, 2.8vw, 38px); line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
.services li { display: inline; }
.services li + li::before { content: " / "; color: var(--accent); font-weight: 400; }
.clients { display: flex; flex-wrap: wrap; gap: 10px; }
.clients li { padding: 6px 14px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 99px; font-size: 15px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.mail {
  font-size: clamp(24px, 3.6vw, 48px); font-weight: 600; line-height: 1.2; text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 3px no-repeat; transition: color .3s;
}
.mail:hover { color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 24px !important; font-weight: 600; }
.contact-links a { text-decoration-color: var(--accent); text-underline-offset: 4px; }
.button {
  display: inline-block; padding: 12px 26px; border: 2px solid currentColor;
  font-weight: 700; text-decoration: none; transition: background .3s, color .3s, border-color .3s;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h2 { font-size: 24px; margin-top: 1.6em; }
.notfound { text-align: center; padding: 10vh 0; }
.notfound h1 { font-size: clamp(80px, 18vw, 200px); line-height: 1; color: var(--accent); }
.visually-hidden { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 40px var(--gutter); font-size: 14px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .row { gap: 24px; }
  .col { flex-basis: calc(var(--w) * 1% - 24px * (1 - var(--w) / 100)); }
  .row > .col:empty { display: none; }
  .row > .col:not(:empty) { flex: 1 1 0; }
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  :root { --header-h: 72px; }
  body { line-height: 1.65; }
  .header { padding: 14px var(--gutter); }
  body.scrolled .header { padding-top: 10px; padding-bottom: 10px; }
  .logo img, body.scrolled .logo img { height: 46px; }
  .menu-toggle { display: block; }

  .nav {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: flex-end;
    padding: 0 var(--gutter) 15vh;
    background: var(--bg);
    opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
  }
  body:not(.dark) .nav { background: var(--bg) url(bg.jpg) 0 0 / 420px repeat; }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav { opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: 6px; }
  .nav a { font-size: 44px; line-height: 1.25; }
  .nav li { opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .6s var(--ease); }
  body.menu-open .nav li { opacity: 1; transform: none; }
  body.menu-open .nav li:nth-child(2) { transition-delay: .07s; }
  body.menu-open .nav li:nth-child(3) { transition-delay: .14s; }

  main { padding: calc(var(--header-h) + 30px) var(--gutter) 40px; }

  .grid { grid-template-columns: 1fr; }
  .item, .item:nth-child(n) { width: 100%; margin: 0 0 64px; justify-self: stretch; }
  .caption { position: relative; left: auto; bottom: auto; display: inline-block; margin: -22px 0 0 14px; max-width: calc(100% - 28px); }

  .row { flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .row > .col, .row > .col:not(:empty) { flex: none; width: 100%; }
  .row.pair { flex-direction: row; gap: 12px; }
  .row.pair > .col:not(:empty) { flex: 1 1 0; width: auto; }
  .col > * + * { margin-top: 16px; }

  .next { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 60px; }
  .next img { width: 100%; }

  .about { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 420px; }
    .clients li { font-size: 14px; padding: 5px 12px; }

  .video button { padding-bottom: 60px; }
  .video button::before { width: 52px; height: 52px; background-size: 24px; }
  .video-meta { left: 14px; right: 14px; bottom: 10px; }
  .video-title { font-size: 15px; }
  .video small { font-size: 11px; }

  .footer { flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .reveal .media { clip-path: none; }
  .reveal .caption { opacity: 1; transform: none; }
}

