/* =========================================================
   Portfolio — image previews and individual case studies
   ========================================================= */

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(to right, var(--accent-deep), var(--accent-lit));
  z-index: 70;
  will-change: transform;
}

/* --- the index of projects, at the top ---------------------------- */

.index {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(4rem, 10vh, 7rem);
}

.index__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.index__preview {
  display: grid;
  gap: .35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: var(--ivory-mid);
  transition: color .4s var(--ease-out);
}
.index__preview:hover,
.index__preview:focus-visible { color: var(--ivory); }
.index__image { display: block; width: 100%; margin-bottom: 1.15rem; }
.index__name { transition: transform .5s var(--ease-settle); }
.index__preview:hover .index__name,
.index__preview:focus-visible .index__name { transform: translateX(.7rem); }

.index__year { font-size: var(--t-sm); color: var(--ivory-dim); }
.index__name {
  font-family: var(--serif);
  font-size: var(--t-md);
  font-variation-settings: "opsz" 36;
  color: var(--ivory);
}
.index__role { font-size: var(--t-sm); }

/* Share text tracks within each gallery row, including naturally wrapped titles. */
.index__list > li {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: .35rem;
}
.index__list > li > .index__preview {
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: .35rem;
}
/* Both labels occupy the same track so revealing details never changes height. */
.index__role--reveal { display: grid; }
.index__role--reveal > span {
  grid-area: 1 / 1;
  transition: opacity .3s var(--ease-out);
}
.index__role-details { opacity: 0; }
.index__preview:hover .index__role-summary,
.index__preview:focus-visible .index__role-summary { opacity: 0; }
.index__preview:hover .index__role-details,
.index__preview:focus-visible .index__role-details { opacity: 1; }
@media (hover: none), (pointer: coarse), (max-width: 620px) {
  .index__role--reveal > span { grid-area: auto; }
  .index__preview .index__role-summary,
  .index__preview .index__role-details { opacity: 1; }
  .index__role-details { color: var(--ivory-dim); }
}

/* Full-image previews for projects whose artwork has its own proportions. */
.editorial-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: var(--graphite);
}
.editorial-preview img { width: 100%; height: auto; }

/* Project pages keep the shared navigation and case-study presentation. */
.project-head {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(8rem, 18vh, 13rem) var(--gutter) 0;
}
.project-page .study { padding-top: 2rem; }
.project-page .nav__link[aria-current="true"] { color: var(--accent-lit); }
.project-page .nav__link[aria-current="true"]::after { transform: scaleX(1); }

/* --- a case study ------------------------------------------------- */

.study {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 9rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

/* media column sticks while the writing scrolls past it */
.study__stage {
  position: sticky;
  top: 12vh;
  align-self: start;
}

.plate-figure { margin: 0; }

.plate {
  --enter: 0;
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: linear-gradient(158deg, var(--charcoal-hi) 0%, var(--graphite) 58%, var(--void) 100%);
  box-shadow: var(--bevel), var(--lift-3);
  aspect-ratio: 4 / 3;
  transform: scale(calc(0.945 + 0.055 * var(--enter)));
  transition: transform .12s linear;
  will-change: transform;
}

/* a single slow highlight raking across the surface as it enters view */
.plate::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(104deg, transparent 42%, rgba(var(--rim-rgb),.09) 50%, transparent 58%);
  transform: translateX(calc((var(--enter) * 150%) - 75%));
}

.plate__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08) translateY(calc((var(--enter) - .5) * -3.5%));
}

/* what you see before you drop a real image in */
.plate__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .5rem;
  text-align: center;
  color: var(--ivory-dim);
  font-size: var(--t-sm);
  padding: 2rem;
}
.plate__empty strong {
  display: block;
  font-family: var(--serif);
  font-size: var(--t-md);
  font-weight: 400;
  color: var(--accent);
}

.plate__caption {
  margin: .95rem 0 0;
  font-size: var(--t-xs);
  color: var(--ivory-dim);
  max-width: 46ch;
}

/* --- writing column ----------------------------------------------- */

.study__body { padding-block: 6vh 14vh; }

.study__eyebrow {
  font-size: var(--t-sm);
  color: var(--accent);
  margin: 0 0 .55rem;
}

.study__title {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  font-variation-settings: "opsz" 100;
  margin: 0 0 1.6rem;
}

.study__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.1rem 2rem;
  margin: 0 0 2.6rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.study__facts div { font-size: var(--t-sm); }
.study__facts dt { color: var(--ivory-dim); margin-bottom: .18rem; }
.study__facts dd { margin: 0; color: var(--ivory); }

.beat { margin-bottom: 2.4rem; }

/* hidden only when scripting is available to bring them back */
.js .beat {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-settle);
}
.js .beat.is-in { opacity: 1; transform: none; }

.beat h2 {
  font-size: var(--t-md);
  font-variation-settings: "opsz" 30;
  line-height: 1.2;
  margin: 0 0 .55rem;
}
.beat p { color: var(--ivory-mid); }
.beat p:last-child { margin-bottom: 0; }

.beat ul {
  color: var(--ivory-mid);
  margin: 0;
  padding-left: 1.1rem;
  max-width: var(--measure);
}
.beat li { margin-bottom: .4rem; }
.beat li::marker { color: var(--accent); }

.study__link {
  display: inline-block;
  margin-top: .4rem;
  color: var(--ivory);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: border-color .35s, color .35s;
}
.study__link:hover { border-color: var(--accent-lit); color: var(--accent-lit); }

.study + .study { border-top: 1px solid var(--hairline); }

/* Editorial project pages frame original artifacts without the case-study grid or plate crop. */
.editorial-project {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) var(--gutter) 0;
}

.editorial-project__header { max-width: 950px; margin-bottom: clamp(3rem, 6vw, 5rem); }
.editorial-project__eyebrow,
.editorial-project__section-label {
  margin: 0 0 .65rem;
  color: var(--accent);
  font-size: var(--t-sm);
}
.editorial-project__header h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  font-variation-settings: "opsz" 144;
  margin-bottom: 1.4rem;
}
.editorial-project__intro {
  max-width: 57ch;
  color: var(--ivory-mid);
  font-family: var(--sans);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.65;
}
.editorial-project__roles {
  display: flex;
  gap: .8rem 2rem;
  padding: 1.2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: var(--t-sm);
}
.editorial-project__roles > span { flex: 0 0 6rem; color: var(--ivory-dim); }
.editorial-project__roles ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ivory);
}
.editorial-project__links { display: flex; flex-wrap: wrap; gap: .8rem 2rem; }
.editorial-project__header .editorial-project__links { margin-top: 1.3rem; }

.editorial-project__hero,
.editorial-project__gallery figure { margin: 0; }
.editorial-project__hero img,
.editorial-project__gallery img {
  width: 100%;
  height: auto;
  outline: 1px solid var(--hairline);
}

.editorial-project__section {
  padding-top: clamp(4rem, 10vw, 8rem);
}
.editorial-project__section--narrow { max-width: 750px; }
.editorial-project__section h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}
.editorial-project__section p:not(.editorial-project__section-label) {
  color: var(--ivory-mid);
}
.editorial-project__section-head { margin-bottom: 2rem; }
.editorial-project__gallery {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.editorial-project__gallery a { display: block; cursor: zoom-in; }
.editorial-project__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--graphite);
  border: 1px solid var(--hairline);
}
.editorial-project__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.editorial-project__section--links {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
}

@media (max-width: 900px) {
  .study {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .study__stage { position: static; }
  .plate { transform: none; }
  .study__body { padding-block: 0 4vh; }
  .index__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .index__list { grid-template-columns: 1fr; }
  .editorial-project__roles { display: block; }
  .editorial-project__roles > span { display: block; margin-bottom: .5rem; }
}
