/* ============================================================
   project.css — the case-study pages
   Preston Thoman · Palm Springs portfolio

   Everything here sits on top of styles.css and sections.css,
   which already supply the tokens, the nav, the buttons, the
   cursor and the .project__media image slot. This file only
   adds the reading layout.
   ============================================================ */

/* a case study is printed on the same drafting sheet as the Work section */
.page-case {
  background:
    var(--grain),
    linear-gradient(rgba(169, 162, 207, .07) 1px, transparent 1px) 0 0 / 100% 120px,
    linear-gradient(90deg, rgba(169, 162, 207, .07) 1px, transparent 1px) 0 0 / 120px 100%,
    linear-gradient(rgba(169, 162, 207, .035) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, rgba(169, 162, 207, .035) 1px, transparent 1px) 0 0 / 24px 100%,
    var(--ink);
  min-height: 100svh;
}
/* the nav is fixed and always solid here — there is no hero behind it */
.page-case .nav { opacity: 1; }

.case { padding-block: clamp(6rem, 12vh, 8.5rem) 0; }
.case__noscript { display: none; padding-block: 8rem; color: var(--cream); }

/* ---- header ---- */
.case__back {
  display: inline-block;
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  margin-bottom: 1.6rem;
  transition: color .3s;
}
.case__back:hover { color: var(--gold); }

.case__title {
  font-family: "Syne", sans-serif; font-weight: 700;
  font-size: clamp(2.1rem, 6.5vw, 4.2rem);
  line-height: 1.02; letter-spacing: -.03em;
  margin: .35rem 0 .9rem;
  text-wrap: balance;
}
.case__metarow {
  display: flex; align-items: center; flex-wrap: wrap; gap: .8rem;
  margin-bottom: 1.1rem;
}
.case__meta {
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin: 0;
}
.case__summary {
  font-size: clamp(1.02rem, 2.1vw, 1.32rem);
  line-height: 1.55;
  color: rgba(241, 230, 208, .8);
  max-width: 46ch;
  text-wrap: pretty;
}

/* ---- hero image ---- */
.case__herowrap { margin-top: clamp(2.2rem, 5vw, 3.4rem); }
.case__hero { aspect-ratio: 21 / 9; border-radius: var(--r); }
@media (max-width: 700px) { .case__hero { aspect-ratio: 16 / 10; } }

/* ---- body + facts ---- */
.case__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-top: clamp(2.8rem, 6vw, 4.5rem);
}
@media (max-width: 860px) { .case__grid { grid-template-columns: 1fr; } }

.case__section { margin-bottom: clamp(2rem, 4vw, 3rem); }
.case__h {
  font-family: "Syne", sans-serif; font-weight: 700;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  letter-spacing: -.015em;
  margin-bottom: .8rem;
  color: var(--cream);
}
.case__body p {
  color: rgba(241, 230, 208, .72);
  font-size: 1rem; line-height: 1.72;
  max-width: 62ch;
  margin-bottom: .9rem;
  text-wrap: pretty;
}
.case__list {
  list-style: none;
  margin: 1.1rem 0 0; padding: 0;
  display: grid; gap: .55rem;
  max-width: 58ch;
}
.case__list li {
  position: relative;
  padding-left: 1.4rem;
  color: rgba(241, 230, 208, .72);
  line-height: 1.6;
}
.case__list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 2px;
  background: var(--orange);
}

/* ---- the facts rail ---- */
.case__aside {
  position: sticky; top: 6.5rem;
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--r);
  background: var(--ink-2);
}
@media (max-width: 860px) { .case__aside { position: static; } }

.case__facts { margin: 0 0 1.4rem; display: grid; gap: .1rem; }
.case__facts dt {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
  margin-top: .9rem;
}
.case__facts dt:first-child { margin-top: 0; }
.case__facts dd {
  margin: .15rem 0 0;
  color: var(--cream); font-size: .93rem; line-height: 1.45;
}
.case__asidehead {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .6rem;
}
.case__link { margin-top: 1.1rem; width: 100%; justify-content: center; }

/* ---- gallery ---- */
.case__gallery {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.case__gallery .project__media { margin-bottom: 0; }
.case__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 1.6rem .95rem .7rem;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .6rem .95rem;
  color: var(--cream);
  background: rgba(18, 21, 28, .88);
  border-top: 1px solid var(--line);
}

/* ---- previous / next ---- */
.case__pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 620px) { .case__pager { grid-template-columns: 1fr; } }
.case__step {
  display: grid; gap: .3rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none;
  transition: border-color .35s, background .35s, transform .35s var(--ease);
}
.case__step:hover {
  border-color: rgba(240, 138, 60, .45);
  background: rgba(59, 61, 107, .18);
  transform: translateY(-2px);
}
.case__step--next { text-align: right; }
.case__steplabel {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--orange);
}
.case__steptitle {
  font-family: "Syne", sans-serif; font-weight: 700;
  font-size: 1.05rem; color: var(--cream);
}

/* ---- not found ---- */
.case__missing { padding-block: clamp(4rem, 12vh, 7rem); }
.case__missing .btn { margin-top: 1.5rem; }

/* ---- footer ---- */
.case__foot {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 18, .5);
}
.case__foot .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--muted);
}
.case__foot a { color: var(--gold); text-decoration: none; }

/* ---- how I worked: the habits a project shows, with the evidence ---- */
.traits { margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.traits__head {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .8rem;
}
.traits__list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px; margin: 0; padding: 0; list-style: none;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.traits__item {
  display: grid; align-content: start; gap: .4rem;
  padding: 1.05rem 1.15rem 1.2rem;
  background: var(--ink-2);
  border-top: 2px solid var(--hi, var(--orange));
}
.traits__item b {
  font-family: "Syne", sans-serif; font-weight: 700; font-size: .95rem;
  color: var(--hi, var(--gold));
}
.traits__item span { font-size: .88rem; line-height: 1.55; color: rgba(241, 230, 208, .74); text-wrap: pretty; }

/* ---- pixel art: scale crisp, never smoothed ---- */
.project__media.is-pixel img,
.loopvid.is-pixel video { image-rendering: pixelated; }

/* ---- a looping clip as the hero, like an animated image ---- */
.loopvid {
  position: relative; margin: 0;
  display: grid; place-items: center;
  aspect-ratio: 21 / 9;
  border-radius: var(--r); border: 1px solid var(--line);
  overflow: hidden;
}
.loopvid video { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; display: block; }
.loopvid__btn {
  position: absolute; right: .9rem; bottom: .9rem;
  font: inherit; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .45rem .8rem; border-radius: var(--r);
  color: var(--cream); background: rgba(18, 21, 28, .82);
  border: 1px solid var(--rule); cursor: pointer;
  transition: background .25s, color .25s;
}
.loopvid__btn:hover { background: var(--cream); color: var(--ink); }
.loopvid__cap {
  position: absolute; left: .9rem; bottom: .95rem;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(241, 230, 208, .8);
}
@media (max-width: 700px) {
  .loopvid { aspect-ratio: 4 / 3; }
  .loopvid__cap { display: none; }
  .loopvid__btn { top: .7rem; bottom: auto; right: .7rem; }
}
