/* ==========================================================================
   projects.css: selected work / past projects
   Extends site.css tokens. No new colours, no new fonts.
   ========================================================================== */

/* ---------- hero ---------- */

.pjhero {
  position: relative;
  min-height: clamp(540px, 78vh, 880px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.pjhero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.pjhero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}

.pjhero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* vertical scrim seats the type; horizontal scrim guarantees contrast on the
     left where the headline sits, since the hearth and sky are the bright zones */
  background:
    linear-gradient(
      to right,
      rgba(25, 20, 16, 0.62) 0%,
      rgba(25, 20, 16, 0.34) 42%,
      rgba(25, 20, 16, 0) 72%
    ),
    linear-gradient(
      to top,
      rgba(25, 20, 16, 0.97) 0%,
      rgba(25, 20, 16, 0.86) 30%,
      rgba(25, 20, 16, 0.4) 66%,
      rgba(25, 20, 16, 0.58) 100%
    );
}

.pjhero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  /* the site convention is that the section owns the gutter (see .section in
     site.css); .pjhero is not a .section, so it has to supply its own */
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
}

.pjhero h1 {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--cream);
  font-size: clamp(2.6rem, 7.2vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0.6rem 0 0;
  max-width: 20ch;
}

.pjhero .lede {
  color: var(--stone);
  max-width: 56ch;
  margin-top: 1.6rem;
}

/* ---------- honesty note ---------- */

.pjnote {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--gold);
  background: rgba(222, 157, 55, 0.045);
  padding: clamp(1.1rem, 2.4vw, 1.75rem) clamp(1.2rem, 3vw, 2.25rem);
  max-width: 78ch;
}

.pjnote p {
  margin: 0;
  color: var(--stone);
  font-size: 0.95rem;
  line-height: 1.65;
}

.pjnote p + p {
  margin-top: 0.7rem;
}

/* Switzer ships no 700, so carry emphasis on colour + the heaviest loaded weight */
.pjnote strong {
  color: var(--cream);
  font-weight: 500;
}

/* ---------- project index ---------- */

.pjindex {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

@media (min-width: 800px) {
  .pjindex {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pjcard {
  background: var(--bark);
  padding: clamp(1.4rem, 3vw, 2.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  transition: background 0.4s ease;
  min-height: 178px;
}

a.pjcard:hover,
a.pjcard:focus-visible {
  background: var(--bark-2);
}

.pjcard__num {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.pjcard__name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--cream);
  margin: 0;
}

.pjcard__meta {
  font-size: 0.85rem;
  color: var(--smoke);
  line-height: 1.55;
  margin: 0;
}

.pjcard__go {
  margin-top: auto;
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.pjcard--soon {
  opacity: 0.55;
}

.pjcard--soon .pjcard__go {
  color: var(--smoke);
}

/* ---------- case study shell ---------- */

.case {
  border-top: 1px solid var(--rule);
  /* inline gutter matters: without it the stat band, sticky room headers and
     status chips run flush into the viewport edge and clip on narrow screens */
  padding: clamp(3.5rem, 9vw, 7.5rem) var(--gutter);
}

.case__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.case h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5.2vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.012em;
  color: var(--cream);
  margin: 0;
  max-width: 24ch;
}

/* ---------- stat band ---------- */

.stats {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: clamp(2rem, 5vw, 3.25rem);
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 760px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: var(--bark);
  padding: clamp(1.1rem, 2.6vw, 1.7rem);
}

.stat dt {
  font-family: var(--font-label);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 0.5rem;
}

.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.95rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.stat dd small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.3rem;
  letter-spacing: 0;
}

/* ---------- room block ---------- */

.room {
  margin-top: clamp(3rem, 8vw, 6.5rem);
}

.room__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
}

.room__num {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
}

.room__name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.1vw, 2.1rem);
  font-weight: 400;
  color: var(--cream);
  margin: 0;
  line-height: 1.1;
  flex: 1 1 auto;
}

/* status chip, never colour alone, the word carries the meaning */
.chip {
  font-family: var(--font-label);
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.34rem 0.62rem;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1;
}

.chip--installed {
  color: var(--bark);
  background: var(--gold);
  border-color: var(--gold);
}

.chip--specified {
  color: var(--stone);
  background: transparent;
  border-color: var(--rule);
}

/* ---------- room media pairing ---------- */

.pair {
  display: grid;
  gap: clamp(0.85rem, 2vw, 1.4rem);
}

@media (min-width: 900px) {
  /* photo and board share the same 1.545 aspect, so equal columns land the two
     caption bars on the same baseline with no dead space under the shorter one */
  .pair {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.shot {
  position: relative;
  margin: 0;
  background: var(--bark-2);
  overflow: hidden;
  border: 1px solid var(--rule);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.shot--board {
  background: #fff;
}

button.shot {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  border: 1px solid var(--rule);
  font: inherit;
  color: inherit;
}

button.shot:hover img,
button.shot:focus-visible img {
  transform: scale(1.022);
}

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

.shot figcaption,
.shot__cap {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--smoke);
  padding: 0.7rem 0.85rem;
  text-align: left;
  background: var(--bark);
  border-top: 1px solid var(--rule);
}

.room__note {
  color: var(--stone);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: clamp(0.9rem, 2vw, 1.3rem) 0 0;
  max-width: 66ch;
}

/* ---------- investment ---------- */

.feewrap {
  overflow-x: auto;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  border: 1px solid var(--rule);
}

table.fee {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-variant-numeric: tabular-nums lining-nums;
}

table.fee caption {
  text-align: left;
  font-family: var(--font-label);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--smoke);
  padding: 0.95rem 1.05rem;
  border-bottom: 1px solid var(--rule);
}

table.fee th,
table.fee td {
  text-align: left;
  padding: 0.82rem 1.05rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}

table.fee thead th {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}

table.fee td {
  color: var(--stone);
}

table.fee td:first-child {
  color: var(--cream);
}

table.fee tbody tr:last-child td {
  border-bottom: 0;
}

table.fee td.num {
  text-align: right;
  white-space: nowrap;
}

table.fee th.num {
  text-align: right;
}

.feenote {
  font-size: 0.85rem;
  color: var(--smoke);
  line-height: 1.6;
  margin-top: 1rem;
  max-width: 72ch;
}

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

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 12, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  /* hide only AFTER the fade-out; on open, become visible on the same frame so
     the close button is immediately focusable (a transitioning visibility makes
     focus() race and silently fail) */
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.lb[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.lb__img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--rule);
}

.lb__cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(0.6rem, 2.4vw, 1.5rem);
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--stone);
  text-align: center;
  max-width: 90%;
}

.lb__close {
  position: absolute;
  top: clamp(0.6rem, 2.4vw, 1.5rem);
  right: clamp(0.6rem, 2.4vw, 1.5rem);
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--cream);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.lb__close:hover,
.lb__close:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .shot img,
  .lb {
    transition: none;
  }
  button.shot:hover img,
  button.shot:focus-visible img {
    transform: none;
  }
}

/* ---------- project 02 additions ---------- */

/* direction/reference imagery, outlined like a specification chip but named
   differently, so a reader never mistakes reference photography for the property */
.chip--direction {
  color: var(--smoke);
  background: transparent;
  border-color: var(--rule);
  border-style: dashed;
}

/* rooms specified from a board alone sit in a single, narrower column so the
   board is not stretched to fill a two-column grid */
@media (min-width: 900px) {
  .pair--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 62%;
  }
}

/* architectural elevation used as a case banner */
.case__banner {
  margin: clamp(1.8rem, 4vw, 2.6rem) 0 0;
  border: 1px solid var(--rule);
  background: var(--bark-2);
  overflow: hidden;
}

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

.case__banner figcaption {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--smoke);
  padding: 0.7rem 0.85rem;
  background: var(--bark);
  border-top: 1px solid var(--rule);
}

/* per-project honesty note inside a case section */
.case__note {
  margin: clamp(1.6rem, 4vw, 2.4rem) 0 0;
  padding: clamp(1.1rem, 2.6vw, 1.6rem) clamp(1.2rem, 3vw, 1.8rem);
  border-left: 2px solid var(--gold);
  background: var(--bark);
  color: var(--stone);
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 72ch;
}

.case__note strong {
  color: var(--cream);
  font-weight: 500;
}
