/* jarrodmckay.com — global styles.
   Dark, sharp, editorial. The interface should disappear behind the
   photography. Design tokens first; every page draws from the same system. */

@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f0f0f;
  --bg-soft: #141414;          /* placeholder panels, subtle surfaces */
  --text: #c9c9c9;
  --text-dim: #8f8f8f;         /* AA-safe secondary text on --bg */
  --text-bright: #ececec;
  --rule: #242424;             /* hairline dividers */
  --focus: #bdbdbd;

  --font: "Jost", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --track-nav: 0.22em;         /* sidebar + small uppercase labels */
  --track-head: 0.32em;        /* page headings */
  --track-meta: 0.14em;        /* metadata lines */

  --sidebar-w: 220px;
  --content-pad: 4rem;
  --content-max: 1280px;
}

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

html { background: var(--bg); }

body {
  font-family: var(--font);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- sidebar shell ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 2.25rem 2rem;
  border-right: 1px solid var(--rule);
}

.wordmark {
  color: var(--text-bright);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wordmark-sub {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-dim);
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.site-nav {
  margin-top: 7rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.site-nav a {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--text-bright);
}

.sidebar-foot {
  margin-top: auto;
  color: var(--text-dim);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

/* ---------- content column ---------- */

.content {
  margin-left: var(--sidebar-w);
  padding: 3.25rem var(--content-pad) 5rem;
  max-width: calc(var(--sidebar-w) + var(--content-max));
}

.page-head h1 {
  color: var(--text-bright);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 300;
  letter-spacing: var(--track-head);
  text-transform: uppercase;
}

.page-head {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.page-intro {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.8;
  max-width: 34rem;
  margin-bottom: 2.75rem;
}

/* ---------- homepage collection panels ---------- */

.collections {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  list-style: none;
}

.collections li { position: relative; }
.collections li:nth-child(-n + 3) { grid-column: span 2; }
.collections li:nth-child(n + 4)  { grid-column: span 3; }

.collection {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
}

.collections li:nth-child(-n + 3) .collection { aspect-ratio: 1 / 1; }
.collections li:nth-child(n + 4)  .collection { aspect-ratio: 2 / 1; }

.collection img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.88);
  transition: filter 0.5s ease, opacity 0.5s ease;
}

.collection:hover img,
.collection:focus-visible img { filter: brightness(1); }

/* quiet gradient so the title reads over any photograph */
.collection::after {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.collection-label {
  position: absolute;
  left: 1.5rem;
  bottom: 1.35rem;
  z-index: 1;
}

.collection-label .name {
  display: block;
  color: var(--text-bright);
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.collection-label .meta {
  display: block;
  margin-top: 0.5rem;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.collection:hover .collection-label .meta,
.collection:focus-visible .collection-label .meta { opacity: 1; }

.collection-label .meta .arrow { margin-left: 0.6rem; }

/* a gallery whose photographs aren't published yet */
.collection.pending {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
}
.collection.pending::after { content: none; }
.collection.pending .collection-label .meta { color: var(--text-dim); }

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

.prose {
  max-width: 38rem;
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 2;
  color: var(--text);
}

.prose p + p { margin-top: 1.4rem; }

.about-contact {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.about-contact .label {
  display: block;
  color: var(--text-dim);
  font-size: 0.62rem;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.about-contact a {
  color: var(--text-bright);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 0.3s ease;
}

.about-contact a:hover { border-color: var(--text-dim); }

.copyright-line {
  margin-top: 3.5rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

/* ---------- gallery grid ---------- */

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap, 24px);
  list-style: none; /* it's a <ul> for screen readers, not for bullets */
}

.grid li {
  line-height: 0;
}

.grid a.ph {
  display: block;
  height: 100%;
}

.grid img {
  width: 100%;
  height: 100%;
  /* contain, not cover: the box already matches the photo's aspect ratio,
     so this renders identically — but if manifest dimensions ever drift
     from the real file, the photo letterboxes visibly instead of being
     silently cropped. */
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.grid img.loaded { opacity: 1; }

.noscript-note {
  padding: 2rem 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ---------- full-screen viewer ---------- */

body.viewer-open {
  overflow: hidden; /* the page doesn't scroll behind the viewer */
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
}

.viewer.open { display: flex; }

.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-caption {
  position: absolute;
  left: 1.5rem;
  bottom: 1.1rem;
  max-width: 70%;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: var(--track-meta);
  text-transform: uppercase;
  line-height: 1.6;
  transition: opacity 0.4s ease;
}

.viewer-btn {
  position: absolute;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: opacity 0.4s ease, color 0.3s ease;
}

.viewer-btn:hover { color: var(--text-bright); }

.viewer-close { top: 0.5rem; right: 0.5rem; font-size: 1.75rem; }
.viewer-prev  { left: 0.25rem; top: 50%; transform: translateY(-50%); }
.viewer-next  { right: 0.25rem; top: 50%; transform: translateY(-50%); }

/* After a moment of stillness the interface disappears; any mouse
   movement or tap brings it back. */
.viewer.ui-hidden .viewer-caption,
.viewer.ui-hidden .viewer-btn {
  opacity: 0;
  pointer-events: none;
}

/* ---------- motion restraint ---------- */

@media (prefers-reduced-motion: reduce) {
  .grid img,
  .collection img,
  .collection-label .meta,
  .site-nav a,
  .viewer-caption,
  .viewer-btn { transition: none; }
}

/* ---------- tablet ---------- */

@media (max-width: 1024px) {
  :root { --content-pad: 2.5rem; }
  .grid { --gap: 16px; }
  .site-nav { margin-top: 5rem; }
}

/* ---------- mobile: sidebar becomes a compact top bar ---------- */

@media (max-width: 720px) {
  :root { --content-pad: 1rem; }

  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .wordmark { font-size: 0.8rem; }
  .wordmark-sub { display: none; }

  .site-nav {
    margin-top: 0;
    flex-direction: row;
    gap: 1.4rem;
  }

  .sidebar-foot { display: none; }

  .content {
    margin-left: 0;
    padding-top: 1.75rem;
    padding-bottom: 3rem;
  }

  .grid { --gap: 10px; }

  .collections { grid-template-columns: 1fr; gap: 8px; }
  .collections li { grid-column: auto !important; }
  .collections li .collection { aspect-ratio: 4 / 3 !important; }
  .collection-label { left: 1.1rem; bottom: 1rem; }
}
