/* ============================================
   Focal Studio — Portfolio
   Style sombre, épuré (réf. capture Adobe Portfolio)
   ============================================ */

:root {
  --bg: #222222;
  --bg-elevated: #2c2c2c;
  --text: #f5f5f4;
  --text-dim: #a8a8a6;
  --border: #333333;
  --accent: #f5f5f4;
  --gap: 4px;
  --header-h: 128px; /* header padding (40+20) + logo height (68) */
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header / Nav ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 40px 40px 20px;
  background: rgba(34, 34, 34, 0.88);
  backdrop-filter: blur(8px);
}

.logo {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
}

.logo img {
  height: 68px;
  width: auto;
  display: block;
}

nav {
  grid-column: 1;
  justify-self: start;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
}

nav a {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 400;
  transition: color 0.2s ease;
}

nav a:hover,
nav a.active {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 640px) {
  header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 20px 16px 14px;
    row-gap: 12px;
  }

  .logo {
    grid-column: 1;
  }

  .logo img {
    height: 44px;
  }

  nav {
    grid-column: 1;
    justify-self: center;
  }

  nav ul {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav a {
    font-size: 13px;
  }

  :root {
    --header-h: 116px;
  }
}

/* ---------- Hero ----------
   The hero is pinned to the viewport (position: fixed) while
   .hero-spacer reserves its height in the normal document flow.
   .grid-section sits right after the spacer with an opaque
   background, so as the page scrolls it rises up and
   progressively covers the fixed headline underneath it.
*/

.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  /* Centers the title precisely within the gap between the
     header and the top of the video grid peek (not the full
     screen height), so it sits symmetrically between the two. */
  padding-top: var(--header-h);
  padding-bottom: calc(45vh - var(--header-h));
  padding-bottom: calc(45dvh - var(--header-h));
  z-index: 1;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 1000px;
}

.hero p {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 300;
  max-width: 560px;
}

.hero-spacer {
  height: 55vh;
  height: 55dvh;
}

/* The fixed-hero / rising-grid effect is kept on mobile too — only
   the side padding and title size adjust for narrow screens. The
   header's own mobile breakpoint (640px) updates --header-h so the
   title stays centered in the gap above the grid on phones as well. */
@media (max-width: 640px) {
  .hero {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ---------- Video Grid ---------- */

.grid-section {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  background: var(--border);
  border-top: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

/* Second row: landscape (16:9) videos, 2 up, spanning the same
   container width as the portrait grid above. */
.landscape-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: var(--gap);
}

/* The grid stays 3 columns (2 for landscape rows) all the way down to
   phone widths, same layout as desktop — only the inner spacing and
   text sizes shrink so tiles stay comfortable to tap and read. */
@media (max-width: 700px) {
  :root {
    --gap: 2px;
  }

  .grid-item .overlay {
    padding: 10px;
  }

  .grid-item .title {
    font-size: 11px;
    line-height: 1.3;
  }

  .grid-item .category {
    font-size: 9px;
    margin-top: 2px;
  }

  .play-icon {
    width: 22px;
    height: 22px;
    top: 8px;
    right: 8px;
  }

  .play-icon::after {
    border-top-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 6px;
  }
}

@media (max-width: 420px) {
  .grid-item .overlay {
    padding: 8px;
  }

  .grid-item .title {
    font-size: 10px;
  }

  .grid-item .category {
    display: none;
  }
}

.grid-item {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: pointer;
}

/* Landscape (16:9) source videos keep their native ratio
   instead of the portrait 9:16 tile shape, so nothing is cropped. */
.grid-item.landscape {
  aspect-ratio: 16 / 9;
}

.grid-item video,
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-item .placeholder-fill {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 20px;
}

/* Titles/categories are no longer shown on the grid — tiles stay clean,
   with only a small play icon marking video tiles. */
.grid-item .overlay {
  display: none;
}

.play-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(245, 245, 244, 0.5);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.grid-item:hover .play-icon {
  opacity: 1;
}

.play-icon::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--text);
  margin-left: 2px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
}

.lightbox.open {
  display: flex;
}

.lightbox video {
  max-width: 100%;
  max-height: 85vh;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 28px;
  color: var(--text);
  cursor: pointer;
  font-weight: 200;
}

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(60, 60, 60, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top::after {
  content: "";
  width: 8px;
  height: 8px;
  border-left: 1.5px solid var(--text);
  border-top: 1.5px solid var(--text);
  transform: rotate(45deg) translateY(2px);
}

/* ---------- Generic page content (About / Contact) ---------- */

.page {
  padding: 120px 40px 120px;
  max-width: 760px;
  margin: 0 auto;
}

.page h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  margin-bottom: 40px;
  text-align: center;
}

.page p {
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 300;
  margin-bottom: 20px;
  max-width: 640px;
}

.page p strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Contact ---------- */

.contact-block {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.contact-block a {
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  width: fit-content;
  transition: opacity 0.2s ease;
}

.contact-block a:hover {
  opacity: 0.6;
}

form {
  margin: 50px auto 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
}

form label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: block;
}

form input,
form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  padding: 10px 0;
  font-family: inherit;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-bottom-color: var(--text);
}

form textarea {
  resize: vertical;
  min-height: 100px;
}

form button {
  margin-top: 10px;
  align-self: center;
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 12px 32px;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

form button:hover {
  background: var(--text);
  color: var(--bg);
}

/* ---------- Footer ---------- */

footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 13px;
}
