/* =============================================
   STYLE.CSS
   Things most worth changing are marked with ←
============================================= */


/* ── Colours ────────────────────────────────
   Change these to restyle the whole site.
----------------------------------------------- */
:root {
  --bg:      #f8f5f0;   /* ← page background */
  --text:    #111110;   /* ← main text */
  --muted:   #888480;   /* ← secondary text */
  --line:    #e2ddd8;   /* ← borders */
  --gap:     5px;       /* ← space between images */
  --img-h:   220px;     /* ← height of every image */
  --max-w:   1000px;    /* ← maximum width of the grid */
}


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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Serif Text', serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}


/* ── Navigation ─────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.5rem;
  z-index: 10;
  max-width: var(--max-w);
  width: 100%;
}

.logo {
  text-decoration: none;
  display: block;
  flex-shrink: 0;
}

.logo img {
  height: 30px;     /* ← logo height */
  width: auto;
  max-width: none;
  display: block;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  transition: color 0.15s;
}

nav ul a:hover { color: var(--text); }

/* Consistent cursors throughout the site:
   - pointer (finger) on all clickable elements
   - custom Lottie only on selected grid images */
a, button { cursor: pointer !important; }
nav a, nav ul a { cursor: pointer !important; }


/* ── Project grid ───────────────────────────── */

/* Flex grid — images all the same height, width
   varies by type. Wraps naturally to next row. */
.grid-wrap {
  padding: var(--gap);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  max-width: var(--max-w);
  width: 100%;
}

.cell {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.cell:hover .cell-image { opacity: 0.85; }
.cell:hover .cell-title { opacity: 0.5; }

.cell-image {
  height: var(--img-h);
  background-size: cover;
  background-position: center;
  transition: opacity 0.15s;
}

/* Cell widths — set on the cell itself so both
   images and videos size correctly */
.cell-vertical   { width: 176px; }  /* 4:5  at 220px height */
.cell-square     { width: 220px; }  /* 1:1  at 220px height */
.cell-horizontal { width: 275px; }  /* 5:4  at 220px height */

.cell-vertical   .cell-image { width: 100%; }
.cell-square     .cell-image { width: 100%; }
.cell-horizontal .cell-image { width: 100%; }

.cell-title {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text);
  padding: 0.6rem 0;
  transition: opacity 0.15s;
}

/* Video cells — same size as image cells.
   Iframe sizing is handled by the Vimeo Player SDK. */
.cell-video {
  position: relative;
  height: var(--img-h);
  width: 100%;
  overflow: hidden;
  background: #000;
}


/* ── Shared section styles ──────────────────── */
section {
  padding: 5rem 2.5rem;
  border-top: 1px solid var(--line);
  max-width: var(--max-w);
  width: 100%;
}

.label {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

section h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
}


/* ── About ──────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: start;
}

.about-text { order: 1; }

.about-photo {
  order: 2;
  height: 400px;    /* ← about photo height */
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left;
}

.about-text h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 0.85rem;
  max-width: 52ch;
  font-size: 0.85rem;
  line-height: 1.75;
}


/* ── Contact ────────────────────────────────── */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.contact-label {
  color: var(--muted);
  min-width: 80px;    /* ← keeps labels aligned */
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
  transition: opacity 0.15s;
}

.contact-link:hover { opacity: 0.5; }


/* ── Footer ─────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 2.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  max-width: var(--max-w);
  width: 100%;
}


/* ── Nav dropdown ───────────────────────────── */
.nav-dropdown-toggle {
  font-family: 'DM Serif Text', serif;
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active { color: var(--text); }

.nav-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 50vh;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-dropdown.open {
  transform: translateY(0);
}

.dropdown-col {
  padding: 3rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;   /* scrollable if bio is long */
}

.dropdown-col:last-child {
  justify-content: center;
}

.dropdown-col + .dropdown-col {
  border-left: 1px solid var(--line);
}

.dropdown-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.dropdown-name {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.dropdown-bio {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: none;
  margin-bottom: 0.85rem;
  padding-right: 20px;  /* ← gap between bio text and dividing line */
}

.dropdown-photo {
  height: 80px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left;
}

.dropdown-contact { display: flex; flex-direction: column; gap: 0.5rem; }

.dropdown-close {
  font-family: 'DM Serif Text', serif;
  font-size: 0.78rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  align-self: flex-start;
  transition: color 0.15s;
}

.dropdown-close:hover { color: var(--text); }


/* ── Overlay ────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 20;
  pointer-events: none;
  transition: background 0.35s;
}

.overlay.active {
  background: rgba(0, 0, 0, 0.25);
  pointer-events: all;
}


/* ── Slide-in panel ─────────────────────────── */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  height: 100%;
  background: var(--bg);
  z-index: 30;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel.open {
  transform: translateX(0);
}

.panel-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gap);
  flex: 1;
  overflow: hidden;
  padding: var(--gap);
}

.panel-text {
  padding: 0 2rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Close — always visible, turns black on hover */
.panel-close {
  font-size: 0.78rem;
  font-weight: 400;
  font-family: 'DM Serif Text', serif;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 1.4rem;
  text-align: left;
  align-self: flex-start;
  transition: color 0.15s;
}

.panel-close:hover { color: var(--text); }

.panel-project-name {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'DM Serif Text', serif;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.panel-desc {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--muted);
  font-family: 'DM Serif Text', serif;
  margin-bottom: 1.5rem;
}

.panel-credits {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
}

.credit-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.credit-label {
  color: var(--muted);
  min-width: 90px;    /* ← keeps labels aligned */
  flex-shrink: 0;
}

.credit-value {
  color: var(--text);
}

.credit-link {
  text-decoration: none;
  border-bottom: 0.5px solid var(--text);
  padding-bottom: 1px;
  transition: opacity 0.15s;
}

.credit-link:hover { opacity: 0.5; }

.panel-images {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.panel-img {
  width: 100%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: var(--line);
}

.panel-img.tall  { aspect-ratio: 4 / 5; }   /* vertical */
.panel-img.wide  { aspect-ratio: 5 / 4; }   /* horizontal */

/* Panel video — aspect ratio set dynamically by JS
   based on the actual video dimensions              */
.panel-video {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.panel-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


/* ── Custom cursor ──────────────────────────── */

/* Cursor images are assigned randomly per project
   via main.js on page load.                      */


/* ── Mobile ─────────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 1rem 1.25rem; }
  nav ul { gap: 1.25rem; }
  section { padding: 3.5rem 1.25rem; }
  footer { padding: 1.25rem; }

  /* On mobile all images become square */
  .cell-vertical   .cell-image,
  .cell-square     .cell-image,
  .cell-horizontal .cell-image {
    width: calc(50vw - 10px);
    height: calc(50vw - 10px);
  }

  .panel { width: 100%; }

  .panel-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .panel-images { overflow-y: visible; }

  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    height: auto;
    width: 160px;
  }
}
