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

:root {
  --bg: #f7f6f2;
  --text: #0a0a0a;
  --dim: #7f7f7f;
  --accent: #e63329;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* font-family: Helvetica, Arial, sans-serif; */
}

/* ── Page ──────────────────────────────────────────────── */
#page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 64px;
}

/* ── Header ────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 44px 0 28px;
  flex-shrink: 0;
}

.header-links {
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  padding-bottom: 4px;
}
.header-links a { color: inherit; text-decoration: none; }
.header-links a:hover { color: var(--accent); }

.title {
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.1em;
  line-height: 0.9;
  /* text-transform: uppercase; */
}

.tagline {
  margin-top: 10px;
  /* font-size: 0.65rem; */
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ── Rule ──────────────────────────────────────────────── */
.rule {
  height: 1px;
  background: var(--text);
  flex-shrink: 0;
}

/* ── Two-column content ────────────────────────────────── */
#content {
  flex: 1;
  min-height: 0; /* allow flex child to shrink */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

/* ── Project list ──────────────────────────────────────── */
#project-list {
  display: flex;
  flex-direction: column;
  justify-content: center; /* always vertically centred */
  gap: 2px;
  min-height: 0;
}

.project-item {
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 1.25;
  color: var(--dim);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
  user-select: none;
}

.project-item:hover {
  color: var(--text);
}
.project-item.active {
  color: var(--accent);
}

/* ── Preview panel ─────────────────────────────────────── */
#preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 28px 0;
}

#preview-image-wrap {
  flex: 1; /* fill all remaining height */
  min-height: 0;
  overflow: hidden;
  background: #e4e3df;
}

#preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

#preview-meta {
  flex-shrink: 0; /* never pushed out of view */
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 16px;
}

#preview-title {
  /* font-size: 0.75rem; */
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
}

#preview-sub {
  /* font-size: 0.75rem; */
  font-size: 1rem;
  font-weight: 300;
  color: var(--dim);
  line-height: 1.5;
}

/* ── Footer ────────────────────────────────────────────── */
footer {
  padding: 16px 0 28px;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
footer a {
  color: inherit;
  text-decoration: none;
}
footer a:hover {
  color: var(--accent);
}

/* ── Navigation overlay ────────────────────────────────── */
#overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.5s ease;
}
#overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.zoom-clone {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.zoom-clone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  #page {
    position: static;
    display: block;
    padding: 0 24px;
  }

  header {
    /* padding: 36px 0 22px; */
  }

  #content {
    display: block;
    padding: 28px 0 0;
  }

  /* On mobile the preview panel sits first, list below */
  #preview {
    margin-bottom: 40px;
  }

  #preview-image-wrap {
    aspect-ratio: 4/3;
  }

  .project-item {
    font-size: 1.5rem;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    color: var(--text);
  }
  .project-item:last-child {
    border-bottom: none;
  }
  .project-item.active {
    color: var(--accent);
  }

  footer {
    padding: 28px 0 40px;
  }
}
