/* ------------------------------------------------------------------
   demetriusfordham.com — shared stylesheet
   Values measured from the live Cargo site (see SPEC.md, SITE-SPEC.md).
   ------------------------------------------------------------------ */

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

:root {
  --paper: #ffffff;
  --ink: rgba(0, 0, 0, 0.75);
  --ink-strong: #111;
  --edge: 60px;        /* gallery + footer margin */
  --edge-head: 24px;   /* masthead sits further left than the gallery */
  --gap: 12px;         /* Cargo's per-card padding */
  --type: 12px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "HelveticaNeue-Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: var(--type);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 44px var(--edge-head) 0;
}
.wordmark { display: block; line-height: 0; }
.wordmark img { width: 242px; max-width: 52vw; }

.nav { display: flex; gap: 18px; letter-spacing: .02em; white-space: nowrap; }
.nav a { padding-bottom: 1px; }
.nav a.is-current { border-bottom: 1px solid currentColor; }
.nav a:hover { color: #000; }

/* PROJECTS is a hover trigger, not a link — as on the original Cargo nav,
   which used a <label> with a nested <ul>. Opens on hover, and on focus so
   it also works from the keyboard and on touch. */
.nav-group { position: relative; }

.nav-label {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 0 1px;
  letter-spacing: inherit;
  cursor: default;
}
.nav-group:hover .nav-label,
.nav-group:focus-within .nav-label { color: #000; }
.nav-group.is-current .nav-label { border-bottom: 1px solid currentColor; }

.nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin: 0;
  padding-top: 9px;      /* inside the hover area, so the gap doesn't break it */
  list-style: none;
  text-align: right;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  z-index: 50;
}
.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu { opacity: 1; visibility: visible; }

.nav-menu li + li { margin-top: 7px; }
.nav-menu a { color: rgba(0,0,0,.6); }
.nav-menu a:hover,
.nav-menu a.is-current { color: #000; }

/* ---------- page furniture ---------- */

.wrap { padding: 0 var(--edge); }

.project-head {
  padding: 52px var(--edge) 0;
  max-width: 760px;
}
.project-head h1 {
  font-size: var(--type);
  font-weight: 300;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.project-head .credits { margin-top: 6px; color: rgba(0,0,0,.5); }

/* ---------- free-form scatter (homepage) ---------- */

.scatter { position: relative; width: 100%; height: 0; }
.scatter .card { position: absolute; line-height: 0; }

/* ---------- justified gallery (Transparent) ----------
   Each row is a flex line; flex-grow is the image's aspect ratio, so
   widths come out proportional and every image in a row shares a height. */

.justified { margin-top: 40px; }
.justified .row { display: flex; }
.justified .cell { padding: var(--gap); flex: 1 1 0; min-width: 0; }

/* ---------- column grid (Ageless Beauty) ---------- */

.grid4 {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.grid4 .cell { padding: var(--gap); }

/* ---------- clickable images ---------- */

.zoomable { cursor: zoom-in; }

/* A photograph box that keeps its slot even if the file is absent.
   Set aspect-ratio inline; on load failure it becomes a labelled placeholder. */
.shot { position: relative; line-height: 0; }
.shot img { width: 100%; }
.shot.is-missing { background: #f0efed; outline: 1px solid #dddbd6; outline-offset: -1px; }
.shot.is-missing img { display: none; }
.shot.is-missing::after {
  content: attr(data-name);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1.5; letter-spacing: .04em;
  color: #b3aea6; text-align: center; padding: 0 10px; word-break: break-all;
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 96px var(--edge) 40px;
}
.site-footer .ig { line-height: 0; }
.site-footer .ig svg { display: block; width: 19px; height: 19px; }
.site-footer .colophon { text-align: right; }

/* ---------- about ---------- */

.about { display: flex; gap: 60px; padding: 52px var(--edge) 0; align-items: flex-start; }
.about .portrait { flex: 0 0 34%; max-width: 420px; }
.about .bio { flex: 1 1 auto; max-width: 560px; }
.about .bio h1 {
  font-size: var(--type); font-weight: 300;
  letter-spacing: .02em; text-transform: uppercase; margin-bottom: 18px;
}
.about .bio p { margin-bottom: 15px; }
.about .bio a { border-bottom: 1px solid rgba(0,0,0,.25); }
.about .bio a:hover { color: #000; border-bottom-color: #000; }

/* ---------- projects index ---------- */

.projects-index { padding: 52px var(--edge) 0; }
.projects-index .item { display: inline-block; vertical-align: top; width: 301px; margin-right: 24px; }
.projects-index .item + .item { margin-top: 36px; }   /* stagger, as on the original */
.projects-index .label { margin-bottom: 10px; letter-spacing: .02em; text-transform: uppercase; }
.projects-index .item:hover .label { color: #000; }

/* ---------- lightbox ---------- */

.lb {
  position: fixed; inset: 0; z-index: 900;
  display: none;
  background: rgba(255, 255, 255, 0.97);
}
.lb.is-open { display: block; }

.lb-stage {
  position: absolute; inset: 48px 92px 60px;
  display: flex; align-items: center; justify-content: center;
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}

.lb button {
  position: absolute;
  background: none; border: 0; padding: 0;
  color: rgba(0,0,0,.45);
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.lb button:hover { color: #000; }

.lb-close { top: 22px; right: 26px; font-size: 17px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 44px; width: 60px; height: 90px; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-count {
  position: absolute; left: 0; right: 0; bottom: 24px;
  text-align: center;
  font-size: 11px; letter-spacing: .08em;
  color: rgba(0,0,0,.4);
}

@media (max-width: 700px) {
  .lb-stage { inset: 44px 14px 52px; }
  .lb-prev, .lb-next { font-size: 34px; width: 42px; height: 70px; }
  .lb-prev { left: 0; }
  .lb-next { right: 0; }
}

/* ---------- phone ---------- */

@media (max-width: 700px) {
  :root { --edge: 22px; --edge-head: 18px; --gap: 6px; }

  .masthead { padding-top: 28px; }

  .scatter {
    height: auto !important;
    padding-bottom: 0 !important;
    display: flex; flex-direction: column; gap: 44px;
  }
  .scatter .card { position: static !important; width: auto !important; }
  .scatter .card:nth-child(3n+1) { width: 88%; align-self: flex-start; }
  .scatter .card:nth-child(3n+2) { width: 68%; align-self: flex-end; }
  .scatter .card:nth-child(3n+3) { width: 78%; align-self: center; }

  .justified .row { flex-wrap: wrap; }
  .justified .cell { flex: 1 1 44%; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }

  .about { flex-direction: column; gap: 32px; }
  .about .portrait { flex: 1 1 auto; max-width: 100%; }

  .projects-index .item { width: 100%; margin-right: 0; }
  .projects-index .item + .item { margin-top: 44px; }

  .site-footer { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 64px; }
  .site-footer .colophon { text-align: left; }
}
