@font-face {
  font-family: 'Gramatika';
  src: url('../fonts/GramatikaRegular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gramatika';
  src: url('../fonts/GramatikaBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gramatika';
  src: url('../fonts/GramatikaSlanted.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Gramatika';
  src: url('../fonts/GramatikaBoldSlanted.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

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

:root {
  --bg: #FFFFFF;
  --ink: #111111;
  --muted: #888888;
  --ph-1: #EBEBEB;
  --ph-2: #E2E2E2;
  --ph-3: #F0F0F0;
  --line: rgba(17, 17, 17, 0.1);
  --nav-h: 56px;
  --px: clamp(24px, 5vw, 64px);
  --gap: clamp(16px, 2.5vw, 36px);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: 'Gramatika', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* ── NAV ─────────────────────────────────────────────────── */

nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(var(--px), calc((100% - 1480px) / 2 + var(--px)));
}

.nav-logo {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-img {
  height: 30px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

/* ── MAIN ────────────────────────────────────────────────── */

main {
  padding-top: calc(var(--nav-h) + 8px);
  padding-bottom: 100px;
  padding-left: var(--px);
  padding-right: var(--px);
  max-width: 1480px;
  margin: 0 auto;
}

.section-label {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── PROJECT GRID (index) ────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--gap);
  row-gap: calc(var(--gap) * 1.6);
}

.project-card a {
  display: block;
}

.project-cover {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.35s ease;
}

.project-card:hover .project-cover img {
  opacity: 0.84;
}

.ph-label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 13px;
  font-style: italic;
  color: rgba(17, 17, 17, 0.28);
  pointer-events: none;
}

.project-info {
  margin-top: 13px;
}

.project-title {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.project-meta {
  font-size: 16px;
  color: var(--ink);
  margin-top: 5px;
}

/* ── SELECTED CLIENTS ────────────────────────────────────── */

.clients-section {
  margin-top: clamp(80px, 12vw, 140px);
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.clients-section .section-label {
  display: block;
  margin-bottom: 32px;
}

.clients-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
}

.client-logo {
  height: 22px;
  filter: grayscale(100%) opacity(0.38);
  transition: filter 0.3s;
}

.client-logo:hover {
  filter: grayscale(0%) opacity(1);
}

.client-name {
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── HOME PAGE — transparent nav ────────────────────────── */

.page-home nav {
  background: transparent;
}

.page-home .nav-logo,
.page-home .nav-links a {
  color: #fff;
}

.page-home .nav-logo-img {
  filter: brightness(0) invert(1);
}

.page-home .nav-toggle span {
  background: #fff;
}

@media (max-width: 720px) {
  .page-home .nav-links {
    background: rgba(10, 10, 10, 0.92);
  }
}

/* ── HERO ────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #111;
}

.hero-slides {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  will-change: background-image;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
  padding-top: var(--nav-h);
  /* alineat amb el text "DOING FOTUS" del nav (logo 25px + gap 10px = 35px) */
  padding-left: calc(max(var(--px), calc((100vw - 1480px) / 2 + var(--px))) + 35px);
  padding-right: max(var(--px), calc((100vw - 1480px) / 2 + var(--px)));
}

.hero-copy {
  color: #fff;
  font-size: clamp(28px, 5.2vw, 78px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: min(860px, 88vw);
  width: 100%;
  margin: 0;
  text-align: left;
}

@keyframes hero-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-copy.typing::after {
  content: '|';
  color: rgba(255, 255, 255, 0.6);
  animation: hero-cursor-blink 0.65s step-end infinite;
  font-weight: 300;
}

.hero-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
  cursor: pointer;
  z-index: 3;
}

.hero-down:hover { opacity: 0.35; }

.hero-down svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── FIELD WORK – VIDEO GRID ─────────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.video-item {
  display: block;
}

.video-wrap {
  aspect-ratio: 9 / 16;
  background: var(--ph-1);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.video-item:nth-child(3n+2) .video-wrap { background: var(--ph-2); }
.video-item:nth-child(3n)   .video-wrap { background: var(--ph-3); }

.video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.2s;
}

.play-btn svg {
  width: 52px;
  height: 52px;
  fill: white;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
  transition: transform 0.2s;
}

.video-wrap:hover .play-btn svg {
  transform: scale(1.08);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-info {
  margin-top: 12px;
}

.video-title {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.video-meta {
  font-size: 16px;
  color: var(--ink);
  margin-top: 5px;
}

/* ── PRINTED WORK ────────────────────────────────────────── */

.printed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--gap);
  row-gap: calc(var(--gap) * 1.9);
}

.print-item a {
  display: block;
}

.print-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--ph-1);
  position: relative;
}

.print-item:nth-child(3n+2) .print-cover { background: var(--ph-2); }
.print-item:nth-child(3n)   .print-cover { background: var(--ph-3); }

.print-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.print-item:hover .print-cover img {
  opacity: 0.84;
}

/* ── CONTACT ─────────────────────────────────────────────── */

main.contact-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  padding-bottom: var(--nav-h);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}

.contact-bg-logo {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  z-index: -1;
  opacity: 0.09;
}

.contact-bg-logo img {
  width: clamp(400px, 60vw, 920px);
  height: auto;
  margin-left: max(var(--px), calc((100vw - 1480px) / 2 + var(--px)));
  transform: translateY(20%);
  pointer-events: none;
}

.contact-left {
  position: relative;
}

.contact-logo {
  height: clamp(80px, 10vw, 120px);
  width: auto;
  display: block;
  margin-bottom: 28px;
}

.contact-title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
  white-space: nowrap;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-info a,
.contact-info span {
  font-size: clamp(20px, 2.6vw, 36px);
  display: block;
  color: var(--ink);
  transition: opacity 0.2s;
  line-height: 1.1;
}

.contact-info a:hover {
  opacity: 0.55;
}

.contact-bio {
  position: relative;
}

.contact-bio p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 18px;
  text-align: justify;
  hyphens: auto;
}

/* ── PROJECT DETAIL ──────────────────────────────────────── */

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 52px;
}

.back-link,
.next-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity 0.2s;
}

.back-link:hover,
.next-link:hover { opacity: 0.55; }
.back-arrow,
.next-arrow { font-size: 16px; }

.detail-header {
  max-width: clamp(280px, 30vw, 420px);
  margin: 0 auto 64px;
  text-align: left;
}

.detail-header .detail-meta {
  font-size: 17px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  margin-top: 20px;
  line-height: 1.7;
}

.detail-header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.7;
  margin-bottom: 20px;
}

.detail-header p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
}

/* ── MUSEUM GALLERY (project detail) ────────────────────── */

.museum-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(56px, 9vh, 108px);
}

.museum-photo {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.museum-photo img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
}

.museum-photo:first-child img {
  max-height: 92vh;
}

.project-credits {
  max-width: clamp(280px, 30vw, 420px);
  margin: 80px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  line-height: 2.2;
  color: var(--ink);
  text-transform: uppercase;
  text-align: left;
  letter-spacing: 0.1em;
}

.project-credits strong {
  color: var(--ink);
  font-weight: 700;
}


/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 1024px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    right: 16px;
    left: auto;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    padding: 8px 28px 16px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    min-width: 180px;
  }
  .nav-links.open { display: flex; }
  .nav-links.open a {
    font-size: 15px;
    padding: 10px 0;
    display: block;
  }
  .nav-toggle { display: flex; }
  .page-home .nav-links {
    background: rgba(12, 12, 12, 0.92);
  }
  .project-grid,
  .printed-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid   { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 52px; }
  .contact-bg-logo { justify-content: center; }
  .contact-bg-logo img { width: 82vw; margin-left: 0; }
  .museum-photo img { max-height: 70vh; }
}

@media (max-width: 480px) {
  .project-grid,
  .printed-grid { grid-template-columns: 1fr; }
}
