/* =========================================================================
   PROJECT PAGES — long-form case studies
   Loads after style.css and reuses its tokens, plates and ledger rows.
   ========================================================================= */

/* ---------------- page chrome ---------------- */
.pnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(16px,2.2vw,26px) var(--edge);
  background: linear-gradient(to bottom, rgba(6,7,8,0.92), rgba(6,7,8,0));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.pnav__back {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grey);
  display: inline-flex; align-items: center; gap: 9px;
  transition: color .3s var(--ease-out);
}
.pnav__back:hover { color: var(--white); }
.pnav__back:focus-visible { color: var(--white); }
.pnav__back i { font-style: normal; transition: transform .3s var(--ease-out); }
.pnav__back:hover i { transform: translateX(-4px); }
.pnav__name { font-size: 12px; font-weight: 500; color: var(--white); }

/* ---------------- masthead ---------------- */
.phead {
  padding: clamp(120px,20vh,220px) var(--edge) clamp(40px,7vh,80px);
  max-width: 1500px;
}
.phead__kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--grey-meta); display: block; margin-bottom: 20px;
}
.phead__title {
  font-weight: 200; letter-spacing: -0.035em; line-height: 0.9;
  font-size: clamp(52px,10vw,150px); color: var(--white);
  overflow: hidden; padding-bottom: .12em; margin-bottom: -.06em;
}
.phead__title > span { display: inline-block; transform: none; }
.phead__dek {
  margin-top: 26px; font-size: clamp(18px,2.1vw,30px); font-weight: 300;
  line-height: 1.4; color: var(--grey); max-width: 34ch;
}
.phead__facts {
  margin-top: clamp(36px,6vh,64px);
  display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
  gap: 20px clamp(20px,3vw,48px); border-top: 1px solid var(--line); padding-top: 22px;
  max-width: 1100px;
}
.phead__facts div { display: flex; flex-direction: column; gap: 6px; }
.phead__facts dt, .phead__facts b {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--grey-meta); font-weight: 400;
}
.phead__facts dd, .phead__facts span {
  font-size: 14px; font-weight: 300; color: var(--white); line-height: 1.5; margin: 0;
}

/* ---------------- prose ---------------- */
.pbody { padding: 0 var(--edge) clamp(80px,14vh,180px); }
.psec { max-width: 1500px; margin: 0 auto clamp(56px,9vh,110px); }
.psec__h {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--amber, var(--white)); color: var(--white);
  padding-bottom: 12px; margin-bottom: 28px; border-bottom: 1px solid var(--line);
}
.prose { max-width: 68ch; }
.prose p {
  font-size: clamp(15px,1.35vw,18px); font-weight: 300; line-height: 1.78;
  color: var(--grey); margin-bottom: 1.05em;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--white); font-weight: 400; }
.prose em { font-style: italic; color: var(--mist); }
.prose .lede {
  font-size: clamp(19px,2vw,27px); font-weight: 300; line-height: 1.5;
  color: var(--white); margin-bottom: 1.1em; letter-spacing: -0.008em;
}
.prose a { color: var(--white); border-bottom: 1px solid var(--grey-dim); }
.prose a:hover { border-color: var(--white); }

/* two-column prose for longer sections */
.prose--wide { max-width: none; column-count: 2; column-gap: clamp(36px,5vw,80px); }
.prose--wide p { break-inside: avoid-column; }
@media (max-width: 900px){ .prose--wide { column-count: 1; } }

/* ---------------- pull quote / honesty block ---------------- */
.pull {
  max-width: 46ch; margin: clamp(40px,6vh,70px) 0;
  padding-left: clamp(20px,2.5vw,34px); border-left: 1px solid var(--white);
}
.pull p {
  font-size: clamp(19px,2.1vw,28px); font-weight: 300; line-height: 1.44;
  color: var(--white); letter-spacing: -0.01em;
}
.pull cite {
  display: block; margin-top: 14px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-meta); font-style: normal;
}

/* ---------------- spec table ---------------- */
.spec { width: 100%; border-collapse: collapse; max-width: 900px; }
.spec th {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--grey-meta); text-align: left; font-weight: 400;
  padding: 0 20px 12px 0; border-bottom: 1px solid var(--line);
}
.spec td {
  padding: 14px 20px 14px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 300; color: var(--grey); vertical-align: top;
}
.spec td:first-child { color: var(--white); font-weight: 400; white-space: nowrap; }
.spec td:last-child, .spec th:last-child { padding-right: 0; }
.spec .num { font-family: var(--mono); font-size: 12px; color: var(--grey-meta); white-space: nowrap; }

/* ---------------- results ---------------- */
.rlist { display: grid; gap: 0; max-width: 1100px; }
.rlist__i {
  display: grid; grid-template-columns: 1fr auto; gap: 18px clamp(20px,3vw,50px);
  padding: 22px 0; border-top: 1px solid var(--line); align-items: baseline;
}
.rlist__i:last-child { border-bottom: 1px solid var(--line); }
.rlist__t { font-size: clamp(16px,1.6vw,21px); font-weight: 400; color: var(--white); line-height: 1.35; }
.rlist__s {
  margin-top: 8px; font-size: 14px; font-weight: 300; line-height: 1.65;
  color: var(--grey); max-width: 60ch;
}
.rlist__m {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--grey-meta); text-align: right; white-space: nowrap;
}
@media (max-width: 700px){
  .rlist__i { grid-template-columns: 1fr; }
  .rlist__m { text-align: left; }
}

/* ---------------- link row ---------------- */
.plinks { display: flex; flex-wrap: wrap; gap: 14px; }
.plinks a {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--grey); padding: 12px 18px; border: 1px solid var(--line);
  transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.plinks a:hover { color: var(--white); border-color: var(--white); }

/* ---------------- next project ---------------- */
.pnext {
  border-top: 1px solid var(--line); padding: clamp(50px,9vh,110px) var(--edge);
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 30px; flex-wrap: wrap;
}
.pnext__l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--grey-meta); display: block; margin-bottom: 14px; }
.pnext__t {
  font-size: clamp(30px,5vw,64px); font-weight: 200; letter-spacing: -0.025em;
  color: var(--white); line-height: 1; transition: opacity .3s var(--ease-out);
}
.pnext:hover .pnext__t { opacity: 0.6; }

/* ---------------- home: work index ---------------- */
.work { padding: clamp(70px,12vh,150px) var(--edge) clamp(40px,7vh,90px); }
.work__grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.wcard {
  background: var(--bg); padding: clamp(26px,3.4vw,46px);
  display: grid; grid-template-columns: 1fr; gap: 20px;
  transition: background .4s var(--ease-out);
  position: relative; overflow: hidden;
}
.wcard:hover { background: var(--bg-2); }
.wcard__media {
  aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2);
  position: relative;
}
.wcard__media img, .wcard__media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.78) contrast(1.05) brightness(0.88);
  transition: transform .8s var(--ease-out), filter .5s var(--ease-out);
}
.wcard:hover .wcard__media img, .wcard:hover .wcard__media video {
  transform: scale(1.04); filter: saturate(0.9) contrast(1.05) brightness(1);
}
.wcard__body { display: flex; flex-direction: column; gap: 12px; }
.wcard__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.wcard__t { font-size: clamp(22px,2.4vw,34px); font-weight: 300; color: var(--white); letter-spacing: -0.015em; }
.wcard__n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--grey-meta); }
.wcard__d { font-size: clamp(14px,1.25vw,16px); font-weight: 300; line-height: 1.65; color: var(--grey); max-width: 54ch; }
.wcard__m {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--grey-meta); margin-top: 2px;
}
.wcard__go {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--white);
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
}
.wcard__go i { font-style: normal; transition: transform .3s var(--ease-out); }
.wcard:hover .wcard__go i { transform: translateX(5px); }
@media (min-width: 900px){
  .work__grid { grid-template-columns: 1fr 1fr; }
  .wcard--wide { grid-column: 1 / -1; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(30px,4vw,60px); }
}

/* ---------------- home: intro + thesis ---------------- */
.intro { padding: clamp(80px,14vh,180px) var(--edge) 0; }
.intro__p {
  font-size: clamp(17px,1.75vw,24px); font-weight: 300; line-height: 1.62;
  color: var(--grey); max-width: 60ch;
}
.intro__p strong { color: var(--white); font-weight: 400; }
.common {
  padding: clamp(60px,10vh,130px) var(--edge);
  border-top: 1px solid var(--line); margin-top: clamp(50px,8vh,100px);
}
.common__in { max-width: 62ch; }
.common p {
  font-size: clamp(16px,1.6vw,21px); font-weight: 300; line-height: 1.7; color: var(--grey);
}
.common p + p { margin-top: 1em; }
.common strong { color: var(--white); font-weight: 400; }

/* ---------------- home: onward links ---------------- */
.onward { padding: 0 var(--edge) clamp(70px,12vh,140px); display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line); }
@media (min-width: 760px){ .onward { grid-template-columns: repeat(3,1fr); } }
.onward { padding: 0; margin: 0 var(--edge) clamp(70px,12vh,140px); }
.ocard { background: var(--bg); padding: clamp(24px,3vw,40px); display: flex;
  flex-direction: column; gap: 10px; transition: background .35s var(--ease-out); }
.ocard:hover { background: var(--bg-2); }
.ocard b { font-size: clamp(18px,1.9vw,24px); font-weight: 300; color: var(--white); }
.ocard span { font-size: 14px; font-weight: 300; color: var(--grey); line-height: 1.6; }
.ocard i { font-style: normal; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey-meta); margin-top: 4px; }

/* ---------------- sundial calculator ---------------- */
.dial { border: 1px solid var(--line); padding: clamp(24px,3.4vw,44px); max-width: 900px; }
.dial__row { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: flex-end; }
.dial__f { display: flex; flex-direction: column; gap: 8px; }
.dial__f label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--grey-meta);
}
.dial__f input, .dial__f select {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--white);
  font-family: var(--mono); font-size: 13px; padding: 11px 13px; min-width: 150px;
}
.dial__f input:focus, .dial__f select:focus {
  outline: 2px solid var(--white);
  outline-offset: 2px;
  border-color: var(--white);
}
.dial__out {
  margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 30px 44px; align-items: flex-end;
}
.dial__big {
  font-size: clamp(38px,5.5vw,72px); font-weight: 200; color: var(--white);
  letter-spacing: -0.03em; line-height: 1;
}
.dial__big small { font-size: 0.34em; font-weight: 300; color: var(--grey); margin-left: 6px; letter-spacing: 0; }
.dial__parts { display: flex; flex-direction: column; gap: 7px; }
.dial__part {
  font-family: var(--mono); font-size: 11px; color: var(--grey-meta);
  display: flex; gap: 12px; justify-content: space-between; min-width: 240px;
}
.dial__part b { color: var(--grey); font-weight: 400; }
.dial__note { margin-top: 20px; font-size: 12px; color: var(--grey-meta); line-height: 1.6; }
.eot { margin-top: clamp(30px,5vh,50px); width: 100%; max-width: 900px; }
.eot svg { width: 100%; height: auto; display: block; overflow: visible; }
.eot .ax { stroke: var(--line); stroke-width: 1; }
.eot .curve { fill: none; stroke: var(--white); stroke-width: 1.6; }
.eot .mark { fill: var(--white); }
.eot text { font-family: var(--mono); font-size: 9px; fill: var(--grey-dim); letter-spacing: .08em; }

/* ---------------- misc ---------------- */
.note {
  font-family: var(--mono); font-size: 11px; line-height: 1.9; color: var(--grey-meta);
  border-left: 1px solid var(--line); padding-left: 18px; max-width: 60ch;
}
.pfoot {
  border-top: 1px solid var(--line); padding: clamp(34px,5vh,54px) var(--edge);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--grey-meta);
}
.pfoot a { color: var(--grey); }
.pfoot a:hover { color: var(--white); }

/* Rows already live inside the page gutter; avoid applying that gutter twice. */
.pbody .row { padding-right: 0; padding-left: 0; }

@media (max-width: 700px) {
  .pnav {
    min-height: calc(54px + env(safe-area-inset-top));
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: 5px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .pnav__back,
  .pnav__name {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .phead {
    padding-top: calc(112px + env(safe-area-inset-top));
    padding-bottom: 48px;
  }
  .phead__facts {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .phead__facts div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .phead__facts dt,
  .phead__facts b { padding-top: 3px; }

  .pbody { padding-bottom: 80px; }
  .psec { margin-bottom: 64px; }
  .pbody .row { padding-top: 32px; }
  .plate__head {
    font-size: 9px;
    line-height: 1.45;
    letter-spacing: .1em;
  }

  .spec {
    display: block;
    width: 100%;
    max-width: none;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .spec thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .spec tbody,
  .spec tr,
  .spec td {
    display: block;
    width: 100%;
  }
  .spec tr {
    padding: 15px 0 16px;
    border-bottom: 1px solid var(--line);
  }
  .spec td,
  .spec td:first-child {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 3px 0;
    border: 0;
    white-space: normal;
    line-height: 1.55;
  }
  .spec td::before {
    content: attr(data-label);
    padding-top: 2px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--grey-meta);
  }
  .spec .num { white-space: normal; }

  .dial__f { flex: 1 1 145px; }
  .dial__f input,
  .dial__f select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }
  .dial__part {
    width: 100%;
    min-width: 0;
  }
  .eot text {
    font-size: 34px;
    letter-spacing: .04em;
  }
  .eot .ax,
  .eot .curve { vector-effect: non-scaling-stroke; }

  .plinks a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .pnext {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding-top: 44px;
    padding-bottom: 46px;
    gap: 18px;
  }
  .pnext > div { min-width: 0; }
  .pnext__t {
    font-size: clamp(28px, 9vw, 46px);
    line-height: 1.06;
  }
  .pfoot {
    padding-bottom: max(34px, env(safe-area-inset-bottom));
  }
  .pfoot a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 340px) {
  .phead__facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .phead__facts dt,
  .phead__facts b { padding-top: 0; }
  .pnext {
    padding-top: 38px;
    padding-bottom: 40px;
  }
  .pnext__t { font-size: 28px; }
  .pfoot { flex-direction: column; }
}

@media (max-height: 520px) and (max-width: 900px) and (orientation: landscape) {
  .wheelstage__pin {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-content: center;
    gap: 20px;
  }
  .wheelstage__scenes { height: 72vh; }
  .wheelstage__scene h3 { font-size: 28px; }
  .wheelstage__scene p {
    font-size: 14px;
    line-height: 1.5;
  }
  .seqstage__scene,
  .seqstage__scene:nth-of-type(odd) {
    top: 50%;
    bottom: auto;
    left: var(--edge);
    right: auto;
    max-width: 28%;
    transform: translateY(-50%);
  }
  .seqstage__scene:nth-of-type(odd) {
    left: auto;
    right: var(--edge);
  }
  .seqstage__scene h3 { font-size: 30px; }
  .seqstage__scene p {
    font-size: 14px;
    line-height: 1.5;
  }
}
