/* Painfully Hueman — shared styles for every page */

:root {
  --ink: #222;
  --line: #282828;
  --paper: #fff;
  --active: #0080ff;
  --side: 64px;          /* left/right page margin */
  --column: 629px;       /* width of the project boxes */
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

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

/* INTRO — spinning reel logo over a white screen when the site first loads */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper);
  cursor: pointer;
  transition: opacity 0.6s ease;
}

.intro:focus {
  outline: none;
}

.intro img {
  display: block;
  width: min(630px, 90vw, 76vh);   /* 75% bigger (was 360px), still fits small screens */
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes intro-spin {
    to { transform: rotate(360deg); }
  }

  .intro img {
    animation: intro-spin 8s linear infinite;
  }
}

.intro.leaving {
  opacity: 0;
  pointer-events: none;
}

.intro-seen .intro {
  display: none;
}

.intro-on body {
  overflow: hidden;
}

/* HEADER — stays at the top of the window on every page, see-through background */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 56px var(--side) 28px;
  background: transparent;
}

.logo {
  display: block;
  flex: 0 1 360px;     /* shrinks a little on medium screens so the menu always fits */
  min-width: 220px;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  flex: none;
  white-space: nowrap;
  display: flex;
  gap: 28px;
  font-size: 17px;
  font-weight: 800;
  line-height: 23px;
  color: #000;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--active);
}

/* INDEX — sections of work, each a row of framed cards like the ARMORY grid */
.index {
  padding: 48px 0 160px;
}

.index-section + .index-section {
  margin-top: 104px;
}

/* section label: Courier, a rule underneath, same edges as the cards */
.section-title {
  margin: 0 calc(3.5714% + 26.19px) 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.index .projects {
  padding: 0;
  row-gap: 64px;
}

/* INDEX — three projects in one row, framed like the ARMORY grid */
.projects {
  display: grid;
  /* the row spans exactly the same width as the ARMORY grid: the same outer
     margin as ARMORY (its five columns leave that much at each edge), and the
     same space between the three cards */
  --edge: calc(3.5714% + 26.19px);
  grid-template-columns: repeat(3, calc((100% - 4 * var(--edge)) / 3));
  justify-content: space-evenly;
  width: 100%;
  padding: 80px 0 160px;
  align-items: start;
}

.project {
  display: block;
}

.project .frame {
  padding: 10px;
  border: 1px solid #000;
  background: var(--paper);
  transition: box-shadow 0.15s ease;
}

a.project:hover .frame {
  box-shadow: 0 0 0 1px #000;
}

.project img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2f2f2;
}

.project h2 {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 800;
  line-height: 23px;
}

.project p {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 400;
  line-height: 19px;
}

/* medium screens: ARMORY switches to four columns here, with a smaller margin */
@media (max-width: 1100px) {
  .projects {
    --edge: calc(2.4% + 25.344px);
    padding: 72px 0 120px;
  }

  .section-title {
    margin-left: calc(2.4% + 25.344px);
    margin-right: calc(2.4% + 25.344px);
  }
}

/* PAGE TITLE — same big Garamond title as ARMORY */
.page-title {
  padding: 32px 16px 8px;
  text-align: center;
  font-family: "Apple Garamond", "AppleGaramond", "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: clamp(43px, 8.1vw, 115px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* HUEMANS — a wall of Polaroids, each linking to the person */
/* same grid as ARMORY: five columns, the side margins equal to the gaps */
.wall {
  display: grid;
  grid-template-columns: repeat(5, calc((100% - 200px) / 7 * 1.1));
  justify-content: space-evenly;
  row-gap: 96px;           /* ARMORY: frame bottom to the next frame top */
  align-items: start;
  width: 100%;
  padding: 64px 0 160px;
}

.polaroid {
  position: relative;
  display: block;
  transition: transform 0.2s ease;
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.22);   /* tight, little blur */
  transition: box-shadow 0.2s ease;
}

.polaroid.linked {
  cursor: pointer;
}

.polaroid:hover,
.polaroid:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.polaroid:hover img,
.polaroid:focus-visible img {
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.24);
}

.polaroid-link {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.polaroid:hover .polaroid-link,
.polaroid:focus-visible .polaroid-link {
  opacity: 1;
}

@media (max-width: 1100px) {
  .wall {
    grid-template-columns: repeat(4, calc((100% - 144px) / 5 * 1.1));
    row-gap: 83px;
  }
}

/* PROJECT PAGE — logo, text, then a grid of photos */
.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 120px;
}

.story-logo {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
}

.story-text {
  max-width: 600px;
  margin-top: 32px;
  font-size: 18px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 762px;      /* photos 25% smaller than the first version */
  margin-top: 64px;
}

.photos button {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photos button:hover,
.photos button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.photos button:focus {
  outline: none;
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
}

/* PHOTO VIEWER — same look as the ARMORY detail view */
.zoom {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 60px 90px 40px;
  background: rgba(255, 255, 255, 0.97);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  touch-action: pan-y;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
}

.zoom.open {
  display: flex;
}

.zoom-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border: 1px solid #000;
  background: var(--paper);
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}

.zoom-meta {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #8a8a8a;
}

.zoom-btn {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #000;
  cursor: pointer;
}

.zoom-btn:hover {
  text-decoration: underline;
}

.zoom-close { top: 12px; right: 16px; }
.zoom-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.zoom-next  { right: 16px; top: 50%; transform: translateY(-50%); }

/* ABOUT / CONTACT — single text column */
.text {
  width: 100%;
  max-width: 752px;
  margin: 0 auto;
  padding: 120px 16px 120px;
}

.text h1 {
  font-size: 36px;       /* 50% larger (was 24px) */
  font-weight: 800;
  line-height: 45px;
  margin-bottom: 48px;
}

.text p {
  font-size: 24px;       /* 50% larger (was 16px) */
  font-weight: 400;
  line-height: 33px;
}

.text p + p {
  margin-top: 33px;
}

/* EDITORIAL — covers in the same row as INDEX; covers keep their 4:5 shape */
.project.cover img {
  aspect-ratio: 4 / 5;
}

/* EDITORIAL ARTICLE — interview: photos and Q&A in one reading column */
.article {
  --read: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
  padding: 56px 24px 160px;
}

.article figure {
  margin: 0;
  width: 100%;
}

.article img {
  display: block;
  width: 100%;
  height: auto;
}

.article-cover { max-width: 640px; }
.article-wide { max-width: 960px; }
.article-portrait { max-width: 560px; }
.article-wide.article-color { max-width: 760px; }

.qa {
  width: 100%;
  max-width: var(--read);
}

.qa h2 {
  margin-bottom: 14px;
  font-size: 24px;
  font-weight: 700;
  line-height: 31px;
}

.qa p {
  font-size: 22px;
  font-weight: 400;
  line-height: 32px;
}

.qa p + p {
  margin-top: 28px;
}

/* photo with the short lines beside it */
.article-split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 48px;
  align-items: center;
  width: 100%;
  max-width: 960px;
}

.article-split .qa p + p {
  margin-top: 24px;
}

/* text on the left, photo on the right */
.article-split.flip {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

/* a second question inside the same section */
.qa h2.qa-next {
  margin-top: 40px;
}

.article-end {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.article-end a:hover {
  color: var(--active);
}

/* PROJECT PAGES (work/…) — title, tags, text, then photos */
.case-head {
  width: 100%;
  max-width: var(--read);
  text-align: center;
}

.case-head h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 46px;
}

.case-tags {
  margin-top: 14px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.qa p.case-lede {
  font-size: 26px;
  line-height: 36px;
  margin-bottom: 40px;
}

.qa h2 + p,
.qa h2 + ol,
.qa h2 + ul {
  margin-top: 0;
}

.qa h2:not(:first-child) {
  margin-top: 48px;
}

/* project pages: each heading starts its own box, so no extra space on top */
.case .qa h2:first-child {
  margin-top: 0;
}

.case .qa p.case-lede {
  margin-bottom: 0;
}

.qa ol,
.qa ul {
  margin: 20px 0 0 1.2em;
  font-size: 22px;
  line-height: 32px;
}

.qa li + li {
  margin-top: 12px;
}

.qa ul.case-stats {
  list-style: none;
  margin-left: 0;
}

.qa ul.case-stats li {
  padding-left: 20px;
  border-left: 2px solid #000;
}

.qa a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.qa a:hover {
  color: var(--active);
}

.qa p.case-press {
  margin-top: 28px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 24px;
  text-transform: uppercase;
}

.case .photos {
  margin-top: 0;
}

/* STACK — a whole carousel or deck shown as one clickable cover;
   clicking opens the viewer and PREV/NEXT goes through every slide */
.photos.stack {
  grid-template-columns: 1fr;
  max-width: 400px;
}

.photos.stack.stack-wide {
  max-width: 640px;
}

.photos.stack button:not(:first-child) {
  display: none;
}

/* a second card peeking out behind the cover, so it reads as a set */
.photos.stack button:first-child {
  position: relative;
  box-shadow: 6px 6px 0 -1px #fff, 6px 6px 0 0 #000, 0 2px 3px rgba(0, 0, 0, 0.22);
}

.photos.stack::after {
  content: attr(data-count) " ↗";
  justify-self: end;
  margin-top: -40px;
  margin-right: 10px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.stack-note {
  margin-top: -48px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* PROJECT PAGES — everything boxed in the same thin black frame as the
   INDEX and ARMORY cards: a 1px border with white space inside */
.case .case-head,
.case .qa {
  border: 1px solid #000;
  background: var(--paper);
  padding: 40px 48px;
}

.case .case-head {
  max-width: 820px;
}

.case .qa {
  max-width: 820px;
}

.case .photos button {
  padding: 10px;
  border: 1px solid #000;
  background: var(--paper);
  box-shadow: none;
}

.case .photos button:hover,
.case .photos button:focus-visible {
  transform: none;
  box-shadow: 0 0 0 1px #000;
}

/* the stacked covers: a second framed box peeking out behind */
.case .photos.stack button:first-child {
  box-shadow: 8px 8px 0 -1px var(--paper), 8px 8px 0 0 #000;
}

.case .photos.stack button:first-child:hover {
  box-shadow: 0 0 0 1px #000, 8px 8px 0 -1px var(--paper), 8px 8px 0 0 #000;
}

.case .photos.stack::after {
  margin-top: -58px;
  margin-right: 26px;
}

.case .stack-note {
  margin-top: -40px;
}

.case .article-end {
  border: 1px solid #000;
  padding: 10px 18px;
}

/* a portrait right under a project title */
.photos.photos-portrait {
  grid-template-columns: 1fr;
  max-width: 460px;
}

/* photo credit under a portrait, in the ARMORY "Photo:" style */
.photo-credit {
  margin-top: -56px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8a8a;
}

/* a landscape photo under a project title: wider than a portrait */
.photos.photos-portrait.photos-landscape {
  max-width: 760px;
}

/* a single photo, kept narrow */
.photos.photos-single {
  grid-template-columns: 1fr;
  max-width: 360px;
}

/* slides: two across, wider */
.photos.photos-wide {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1040px;
}

/* ABOUT — contact email at the end, a little apart from the text */
.text p.text-contact {
  margin-top: 56px;
}

/* (old CONTACT page) email in the dead center of the window */
.text.center {
  position: fixed;
  inset: 0;
  max-width: none;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.text a:hover {
  color: var(--active);
}

/* PHONE */
/* HEADER on medium screens: logo on top, menu underneath */
@media (max-width: 900px) {
  .site-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 32px var(--side) 20px;
  }

  .logo {
    flex: none;
    width: min(300px, 100%);
    min-width: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --side: 16px;
  }

  .site-head {
    padding: 24px var(--side) 16px;
  }

  .logo {
    width: min(280px, 100%);
  }

  /* phones: menu spread across the full width */
  .nav {
    align-self: stretch;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
  }

  /* phones: three across, spaced like the ARMORY grid */
  .wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 67px 14px;
    padding: 28px 16px 96px;
  }

  .page-title {
    padding-top: 24px;
  }

  .article {
    gap: 48px;
    padding: 24px 16px 96px;
  }

  .index {
    padding: 24px 0 96px;
  }

  .index-section + .index-section {
    margin-top: 72px;
  }

  .section-title {
    margin: 0 16px 28px;
  }

  .case-head h1 {
    font-size: 28px;
    line-height: 34px;
  }

  .qa p.case-lede {
    font-size: 20px;
    line-height: 28px;
  }

  .qa ol,
  .qa ul {
    font-size: 18px;
    line-height: 27px;
  }

  .photos.photos-wide {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .case .case-head,
  .case .qa {
    padding: 24px 20px;
  }

  .qa h2 {
    font-size: 20px;
    line-height: 27px;
  }

  .qa p {
    font-size: 18px;
    line-height: 27px;
  }

  .qa p + p {
    margin-top: 22px;
  }

  .article-split,
  .article-split.flip {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .projects {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 24px 16px 96px;
  }

  .index .projects {
    padding: 0 16px;
  }

  .text {
    padding-top: 56px;
  }

  .text h1 {
    font-size: 28px;
    line-height: 35px;
    margin-bottom: 32px;
  }

  .text p {
    font-size: 20px;
    line-height: 28px;
  }

  .text p + p {
    margin-top: 28px;
  }

  .text.center {
    padding: 0 16px;
  }

  .story {
    padding-top: 24px;
  }

  .story-text {
    font-size: 16px;
    line-height: 22px;
  }

  .photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 75%;
    margin-top: 40px;
  }

  .zoom {
    padding: 56px 16px 84px;
  }

  .zoom-img {
    max-height: calc(100vh - 200px);
  }

  .zoom-prev,
  .zoom-next {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: none;
    border: 1px solid #000;
    background: var(--paper);
  }
}
