/* ============================================================
   Shared project-page interactions (see project.js).
   Kept quiet: nothing moves unless it is looked at or touched.
   ============================================================ */

/* ---------------- Lightbox ---------------- */

.zoomable{ cursor: zoom-in; transition: opacity .2s ease; }
.zoomable:hover{ opacity: .9; }
.zoomable:focus-visible{ outline: 2px solid var(--text); outline-offset: 3px; }

.lb{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  background: rgba(250,249,246,.97);
  opacity: 0;
  transition: opacity .2s ease;
}
.lb[hidden]{ display: none; }
.lb.is-open{ opacity: 1; }
.lb figure{ grid-column: 2; margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lb img{ max-height: 84vh; max-width: 100%; width: auto; box-shadow: 0 24px 60px rgba(20,19,15,.12); }
.lb figcaption{ font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; max-width: 70ch; }
.lb button{
  appearance: none; background: none; border: 0; cursor: pointer;
  font: 400 20px/1 var(--font-mono); color: var(--text); padding: 16px;
}
.lb .lb-prev{ grid-column: 1; }
.lb .lb-next{ grid-column: 3; }
.lb .lb-close{ position: absolute; top: 18px; right: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 600px){
  .lb{ grid-template-columns: 36px 1fr 36px; }
}

/* ---------------- Cineteca: palette ---------------- */

.pal{
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  height: 180px;
  gap: 4px;
}
.pal button{
  appearance: none;
  border: 0;
  margin: 0;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  background: var(--c);
  color: var(--ink, #F5F5F7);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-align: left;
  cursor: copy;
  transition: flex-grow .3s ease, transform .3s cubic-bezier(.2,.7,.2,1);
}
.pal button:hover{ transform: translateY(-6px); }
.pal .hex{ opacity: .85; }
.pal .name{ opacity: .6; text-transform: lowercase; }
@media (max-width: 720px){
  .pal{ grid-template-columns: repeat(4, minmax(0, 1fr)); height: auto; }
  .pal button{ height: 96px; }
}

/* ---------------- Degrowth: typogram ---------------- */

.typo{
  margin: 0;
  padding: clamp(40px, 7vw, 80px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  overflow: hidden;
}
.typo-word{
  display: inline-flex;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 76px);
  line-height: 1;
  letter-spacing: .01em;
}
.typo .l{ position: relative; display: inline-block; cursor: default; }
.typo .t{ display: block; clip-path: inset(0 0 50% 0); }
.typo .b{ position: absolute; inset: 0; clip-path: inset(50% 0 0 0); }
.typo .t, .typo .b{ transition: transform .9s cubic-bezier(.2,.7,.2,1) var(--d); }
.typo.is-broken .t{ transform: translate(var(--dx), calc(var(--dy) * -.5)); }
.typo.is-broken .b{ transform: translate(calc(var(--dx) * -1), calc(var(--dy) * .5)); }
/* touching a letter puts it back together, briefly */
.typo.is-broken .l:hover .t,
.typo.is-broken .l:hover .b{ transform: none; transition-delay: 0s; transition-duration: .35s; }
.typo figcaption{ margin-top: 28px; }

/* ---------------- Video poster ---------------- */

.vplay{ position: relative; }
.vplay video{ display: block; width: 100%; }
.vplay-btn{
  position: absolute;
  inset: 0;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;      /* bottom-left, so the poster stays readable */
  justify-content: flex-start;
  padding: 16px;
}
.vplay-btn span{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
  padding: 14px 20px;
  transition: transform .25s ease;
}
.vplay-btn:hover span{ transform: scale(1.04); }
.vplay.is-playing .vplay-btn{ display: none; }

/* ---------------- Tall wireframes side by side ---------------- */
/* column widths follow each image's aspect ratio (all 2000px tall),
   so the three wireframes line up at the same height */
.wf-row{
  display: grid;
  grid-template-columns: 0.389fr 0.472fr 0.894fr;
  gap: 12px;
  align-items: start;
}
.wf-row img{ width: 100%; border: 1px solid var(--line); }
@media (max-width: 600px){
  .wf-row{ grid-template-columns: 1fr 1fr; }
  .wf-row img:last-child{ grid-column: 1 / -1; }
}

/* ---------------- Sticky prototype link ---------------- */
/* small pill in the bottom corner, always within reach while reading */

.proto-pill{
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(20,19,15,.18);
}
.proto-pill span{ padding: 6px 6px 6px 10px; opacity: .55; }
.proto-pill a{
  padding: 6px 10px;
  border-radius: 999px;
  transition: background .2s ease;
}
.proto-pill a:hover{ background: rgba(250,249,246,.16); }
.proto-pill a:focus-visible{ outline: 2px solid var(--bg); outline-offset: -2px; }
@media (max-width: 600px){
  .proto-pill{ right: 12px; bottom: 12px; font-size: 10px; }
  .proto-pill span{ display: none; }
}

/* ---------------- Now vs. redesign ---------------- */

.ba{ margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--text); }
.project-body .content p.ba-step{
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
}
.ba-step span{
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-right: 12px;
}
.ba-pair{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.ba-pair figure{ margin: 0; }
.ba-pair img{ width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--line); }
.ba-pair figcaption{
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.ba-pair figcaption b{
  display: inline-block;
  font-weight: 500;
  color: var(--bg);
  background: var(--muted);
  padding: 2px 6px;
  margin-right: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 10px;
}
.ba-pair figure + figure figcaption b{ background: #B65929; } /* the redesign wears Cineteca's new orange */
@media (max-width: 600px){
  .ba-pair{ grid-template-columns: 1fr; }
}

/* ---------------- Decisions with evidence ---------------- */
/* Each decision is followed by the finding that justifies it. */

.decisions{
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--text);
  counter-reset: d;
}
.decisions li{
  counter-increment: d;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}
.decisions li::before{
  content: counter(d, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding-top: 3px;
}
.decisions li > *{ grid-column: 2; }
.decisions h3{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  margin: 0 0 4px;
}
.project-body .content .decisions p{ font-size: 14px; margin: 0; }

.why,
.project-body .content p.why{
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(20,19,15,.04);
  border-left: 2px solid var(--text);
  font-size: 13px;
  line-height: 1.5;
  color: #4A4944;
}
.why span{
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

/* finding → numbers → consequence */
.evidence-table{
  margin-top: 14px;
  border-top: 1px solid var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.et-row{
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 48px 48px minmax(0, 1.6fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.et-row b{
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  text-align: right;
}
.et-row span:last-child{ color: var(--text); }
.et-row span:first-child{ color: #4A4944; }
.et-head{
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.et-head span{ color: var(--muted) !important; }
.et-head span:nth-child(2), .et-head span:nth-child(3){ text-align: right; }
/* single total column instead of per-group columns */
.et-total .et-row{ grid-template-columns: minmax(0, 2.2fr) 52px minmax(0, 1.6fr); }
.et-total .et-head span:nth-child(2){ text-align: right; }
.et-total .et-head span:nth-child(3){ text-align: left; }
@media (max-width: 600px){
  .et-total .et-row{ grid-template-columns: minmax(0, 1fr) 44px; }
}

@media (max-width: 600px){
  .et-row{ grid-template-columns: minmax(0, 1fr) 40px 40px; }
  .et-row > :last-child{ grid-column: 1 / -1; font-weight: 500; }
  .et-head > :last-child{ display: none; }
}

/* ---------------- Collapsible long quote ---------------- */

.more{ margin-top: 24px; }
.more summary{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.more summary::-webkit-details-marker{ display: none; }
.more summary::before{ content: '+ '; }
.more[open] summary::before{ content: '− '; }
.more summary:hover{ color: var(--text); }

@media (prefers-reduced-motion: reduce){
  .typo .t, .typo .b, .pal button{ transition: none; }
}
