/* Portfolio pages for richardgranger.online */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --grey: #E9E8EC;
  --card: #F3F2F6;
  --accent: #7C6E94;
  --ink: #2A2830;
  --slate: #5A5464;
  --muted: #807A8C;
}

body {
  background: var(--grey);
  color: var(--ink);
  min-height: 100vh;
}

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.6rem;
  background: var(--grey);
}
.wordmark {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.close {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  padding: 0 .25rem;
}
.close:hover { color: var(--accent); }

/* ---- masthead ---- */
.masthead {
  text-align: center;
  padding: 2.4rem 1.5rem 3rem;
}
.rule {
  width: 360px;
  max-width: 80vw;
  height: 1px;
  background: var(--accent);
  margin: 0 auto;
  position: relative;
  box-shadow: 0 2px 10px rgba(124, 110, 148, 0.45);
}
.rule::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -4px;
  margin-top: -4px;
  box-shadow: 0 2px 8px rgba(124, 110, 148, 0.5);
}
.eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.4rem 0 1rem;
}
.masthead h1 {
  font-family: 'EB Garamond', serif;
  font-size: 3.6rem;
  font-weight: 400;
  line-height: 1.05;
  text-shadow: 0 6px 24px rgba(93, 78, 122, 0.28);
}
.masthead h1 em { font-style: italic; color: var(--slate); }
.lede {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--muted);
  max-width: 34rem;
  margin: 1.1rem auto 1.4rem;
}

/* ---- sections ---- */
main { max-width: 54rem; margin: 0 auto; padding: 0 1.5rem 1rem; }

section { margin-bottom: 2.8rem; }
.section-head {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: .6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(124, 110, 148, 0.28);
}

/* one card per row */
.stack { display: flex; flex-direction: column; gap: .85rem; }

.card {
  display: flex;
  align-items: flex-start;
  gap: 1.35rem;
  background: var(--card);
  border: 1px solid rgba(124, 110, 148, 0.18);
  border-radius: 3px;
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover {
  border-color: rgba(124, 110, 148, 0.5);
  box-shadow: 0 8px 26px rgba(93, 78, 122, 0.18);
  transform: translateY(-2px);
}

/* screenshot slots, 16:10. The framed placeholder shows until
   /portfolio/img/<slug>.png exists; the image then covers it. */
.shot, .screen {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 110, 148, 0.32);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(93, 78, 122, 0.20);
}
.card .shot {
  flex: 0 0 240px;
  width: 240px;
  height: 150px;
  transition: box-shadow .18s ease;
}
.card:hover .shot { box-shadow: 0 5px 18px rgba(93, 78, 122, 0.30); }
.screen {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 1.6rem;
  border-radius: 4px;
  box-shadow: 0 10px 34px rgba(93, 78, 122, 0.22);
}
.shot img, .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.shot img { filter: saturate(0.88) contrast(0.97); transition: filter .18s ease; }
.card:hover .shot img { filter: none; }

.ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #FBFAFC 0%, #EEECF2 100%);
}
.ph-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  padding: 0 7px;
  background: #DDDAE3;
  border-bottom: 1px solid rgba(124, 110, 148, 0.22);
}
.ph-bar i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(124, 110, 148, 0.45);
}
.ph-bar b {
  flex: 1;
  height: 7px;
  margin-left: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
}
.ph-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0 .8rem;
  text-align: center;
}
.ph-mark {
  font-family: 'EB Garamond', serif;
  font-size: 1.55rem;
  font-style: italic;
  line-height: 1.1;
  color: var(--slate);
}
.ph-tag {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* the large frame on a project page */
.screen .ph-bar { height: 30px; gap: 7px; padding: 0 14px; }
.screen .ph-bar i { width: 9px; height: 9px; }
.screen .ph-bar b {
  height: auto;
  margin-left: 14px;
  padding: 3px 12px;
  border-radius: 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen .ph-body { gap: .6rem; }
.screen .ph-mark { font-size: 3rem; }
.screen .ph-tag { font-size: 0.7rem; }
.ph-note {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-top: .4rem;
}

.card .body { flex: 1 1 auto; min-width: 0; }

.card h3 {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: .4rem;
}
.card p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--slate);
}
.card .also {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: .45rem;
}
.card .domain {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: .7rem;
}
.card:hover .domain { color: var(--ink); }

/* ---- project pages ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
  margin-bottom: 2.8rem;
}
.fact {
  background: var(--card);
  border: 1px solid rgba(124, 110, 148, 0.18);
  border-radius: 3px;
  padding: 1rem 1.1rem;
  text-align: center;
}
.fact .num {
  display: block;
  font-family: 'EB Garamond', serif;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ink);
}
.fact .lbl {
  display: block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: .45rem;
}
.prose p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--slate);
}
.prose p + p { margin-top: .9rem; }
.features { list-style: none; display: grid; gap: .6rem; }
.features li {
  position: relative;
  padding-left: 1.4rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--slate);
}
.features li::before {
  content: '';
  position: absolute;
  left: .2rem;
  top: .55em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}
.stackline {
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--slate);
}
.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .85rem;
  align-items: stretch;
  margin: .5rem 0 2.8rem;
}
.pager a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
  background: var(--card);
  border: 1px solid rgba(124, 110, 148, 0.18);
  border-radius: 3px;
  padding: .9rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.pager a:hover {
  border-color: rgba(124, 110, 148, 0.5);
  box-shadow: 0 8px 26px rgba(93, 78, 122, 0.18);
}
.pager .next { text-align: right; }
.pager .all { text-align: center; }
.pager .dir {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.pager .name {
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
}

footer {
  text-align: center;
  padding: 1rem 1.5rem 3rem;
}
footer p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
footer .legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .4rem .65rem;
  max-width: 54rem;
  margin: 0 auto .6rem;
  padding-top: 1.1rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-top: 1px solid rgba(124, 110, 148, 0.28);
}
footer .legal a {
  color: var(--accent);
  text-decoration: none;
  transition: color .18s ease;
}
footer .legal a:hover { color: var(--ink); }
footer .legal .dot { color: rgba(124, 110, 148, 0.5); }

@media (max-width: 600px) {
  .masthead h1 { font-size: 2.6rem; }
  .masthead { padding-top: 1.4rem; }
  main { padding: 0 1rem 1rem; }
  .card { flex-direction: column; gap: .9rem; }
  .card .shot { flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .screen .ph-mark { font-size: 2rem; }
  .screen .ph-bar b { display: none; }
  .facts { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .all { text-align: left; }
}

.note {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: -0.6rem auto 1.4rem;
}

/* ---- screen carousel on a project page (model.js) ----
   Any project with a screens list gets this in place of the big placeholder. */
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.model { margin-bottom: 2.6rem; }
.model-stage { position: relative; }
.model-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 110, 148, 0.32);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(93, 78, 122, 0.22);
}
.model-frame .ph-bar { height: 30px; gap: 7px; padding: 0 14px; }
.model-frame .ph-bar i { flex: none; width: 9px; height: 9px; }
.model-frame .ph-bar b {
  min-width: 0;
  max-width: 24rem;
  height: auto;
  margin-left: 14px;
  padding: 3px 12px;
  border-radius: 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-view {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #F6F5F8;
}
.model-zoom { position: absolute; inset: 0; display: block; cursor: zoom-in; }
.model-zoom img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  transition: opacity .45s ease, transform .45s ease;
}
.model-zoom img.is-out { opacity: 0; transform: translateX(18px); }
.model-zoom img.is-out.from-left { transform: translateX(-18px); }
.model-zoom:focus-visible { outline: none; }
.model-zoom:focus-visible::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 0 3px var(--accent);
}

/* slender arrows: outside the frame on wide screens, on its edges below 940px */
.model-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 96px;
  margin-top: -48px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease;
}
.model-arrow svg { display: block; }
.model-arrow:hover { color: var(--ink); }
.model-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.model-arrow[hidden], .model-nav[hidden] { display: none; }
.model-stage .model-arrow.prev { left: -60px; }
.model-stage .model-arrow.next { right: -60px; }

.model-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1.5rem;
  align-items: start;
  margin-top: 1.1rem;
}
.model-name, .model-lb-name {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.model-caption {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--slate);
  max-width: 40rem;
  min-height: 3.1em;
  margin-top: .35rem;
}
.model-nav { display: flex; align-items: center; gap: .55rem; margin-top: -5px; }
.model-count, .model-lb-count {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.model-dots { display: flex; }
.model-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.model-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  transition: background-color .18s ease, border-color .18s ease;
}
.model-dot:hover::before { border-color: var(--ink); }
.model-dot[aria-current="true"]::before { background: var(--accent); }
.model-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* lightbox */
.model-lock { overflow: hidden; }
.model-lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 5rem 1.5rem;
  background: var(--grey);
  opacity: 0;
  transition: opacity .22s ease;
}
.model-lb[hidden] { display: none; }
.model-lb.is-open { opacity: 1; }
.model-lb figure { display: flex; flex-direction: column; align-items: center; }
.model-lb img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 10rem);
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  background: #fff;
  border: 1px solid rgba(124, 110, 148, 0.32);
  border-radius: 3px;
  box-shadow: 0 14px 44px rgba(93, 78, 122, 0.28);
  cursor: zoom-out;
}
.model-lb figcaption { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1rem; }
.model-lb-label { display: flex; align-items: baseline; gap: .9rem; }
.model-lb .model-arrow { position: fixed; }
.model-lb .model-arrow.prev { left: 1.2rem; }
.model-lb .model-arrow.next { right: 1.2rem; }
.model-lb-close {
  position: fixed;
  top: .8rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: color .18s ease;
}
.model-lb-close svg { display: block; }
.model-lb-close:hover { color: var(--ink); }
.model-lb-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 940px) {
  .model-stage .model-arrow {
    top: 31px;
    bottom: 1px;
    width: 44px;
    height: auto;
    margin-top: 0;
    border-radius: 0;
  }
  .model-stage .model-arrow.prev { left: 1px; background: linear-gradient(90deg, rgba(243, 242, 246, 0.94), rgba(243, 242, 246, 0.82) 60%, rgba(243, 242, 246, 0)); }
  .model-stage .model-arrow.next { right: 1px; background: linear-gradient(270deg, rgba(243, 242, 246, 0.94), rgba(243, 242, 246, 0.82) 60%, rgba(243, 242, 246, 0)); }
  .model-stage .model-arrow svg { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff); }
  .model-stage .model-arrow:focus-visible { outline-offset: -3px; }
}
@media (max-height: 520px) and (min-width: 601px) {
  .model-lb { padding: .75rem 4.5rem; }
  .model-lb img { max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); }
  .model-lb figcaption { margin-top: .5rem; }
}
@media (max-width: 600px) {
  .model-frame .ph-bar { height: 26px; gap: 6px; padding: 0 10px; }
  .model-frame .ph-bar i { width: 8px; height: 8px; }
  .model-frame .ph-bar b { margin-left: 8px; padding: 2px 10px; font-size: 0.66rem; }
  .model-stage .model-arrow { top: 27px; }
  .model-meta { grid-template-columns: minmax(0, 1fr); margin-top: .7rem; }
  .model-nav { order: -1; justify-content: center; margin: 0 0 .55rem; }
  .model-caption { min-height: 0; }
  .model-lb { padding: 3.5rem .75rem 1.25rem; }
  .model-lb img { max-width: calc(100vw - 1.5rem); }
  .model-lb .model-arrow { position: static; width: 44px; height: 56px; margin-top: 0; }
  .model-lb figcaption { gap: .25rem; margin-top: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .model-zoom img, .model-lb { transition: none; }
}

/* ---- phone variant (device="phone"): no browser bar; the portrait phone
   image is centred on a soft 16:10 stage ---- */
.model-phone {
  border-color: rgba(124, 110, 148, 0.2);
  background: linear-gradient(160deg, #EEECF2 0%, #E4E2EA 100%);
}
.model-phone .model-view { background: none; }
.model-phone .model-zoom img {
  top: 4%;
  bottom: auto;
  height: 92%;
  object-fit: contain;
  object-position: center;
}
.model-phone .model-zoom img.is-gone { opacity: 0; }
.model-lb.is-phone img {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: calc(100vh - 6.5rem);
  max-height: calc(100dvh - 6.5rem);
}
@media (max-width: 940px) {
  .model[data-device="phone"] .model-stage .model-arrow { top: 1px; background: none; }
}
@media (max-height: 520px) and (min-width: 601px) {
  .model-lb.is-phone img { max-height: calc(100vh - 4.5rem); max-height: calc(100dvh - 4.5rem); }
}

/* ---- ten or more screens: counter and dots take their own centred row
   under the frame, and wrap if a phone is too narrow for one line ---- */
.model-many .model-meta { grid-template-columns: minmax(0, 1fr); }
.model-many .model-nav {
  order: -1;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0;
  margin: -.3rem 0 .5rem;
}
.model-many .model-dots { flex-wrap: wrap; justify-content: center; }
.model-many .model-caption { min-height: 0; }

/* ---- portfolio home (viewer.js) ----
   .hdr         fixed header; content scrolls behind it
   .is-compact  header shrinks (on scroll, and while a project is open)
   .is-open     on <body>: the open project's title sits in the header, and the
                project itself opens in place under its card */
.pf-home .hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  overflow: hidden;
  background: rgba(233, 232, 236, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: box-shadow .3s ease;
}
.pf-home .hdr.is-compact { box-shadow: 0 6px 22px rgba(93, 78, 122, 0.16); }
.pf-home .hdr-space { height: var(--hdr-full, 15rem); }
.pf-home .hdr .topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3rem;
  padding: 0 1.4rem;
  background: none;
  pointer-events: none;
  transition: height .35s ease;
}
.pf-home .hdr .topbar a { pointer-events: auto; }
.pf-home .hdr.is-compact .topbar { height: 100%; }
.pf-home.is-open .hdr .close { display: none; }
.pf-home .masthead { padding: 1rem 1.5rem 1.4rem; transition: padding .35s ease; }
.pf-home .masthead h1 { transition: font-size .35s ease; }
.pf-home .rule { transition: width .35s ease; }
.pf-home .eyebrow, .pf-home .lede, .pf-home .note {
  overflow: hidden;
  max-height: 5rem;
  transition: max-height .35s ease, opacity .25s ease, margin .35s ease;
}
.pf-home .eyebrow { margin: 1rem 0 .55rem; }
.pf-home .lede { margin: .7rem auto .9rem; }
.pf-home .note { margin: -.3rem auto .9rem; }

.pf-home .hdr.is-compact .masthead { padding: .55rem 4.5rem .6rem; }
.pf-home .hdr.is-compact .masthead h1 { font-size: 1.95rem; }
.pf-home .hdr.is-compact .rule { width: 240px; }
.pf-home .hdr.is-compact .eyebrow { margin: .45rem 0 .1rem; font-size: .62rem; }
.pf-home .hdr.is-compact .lede,
.pf-home .hdr.is-compact .note { max-height: 0; opacity: 0; margin: 0 auto .45rem; }
.pf-home .hdr.is-compact.is-scrolled .eyebrow { max-height: 0; opacity: 0; margin: .45rem 0 0; }

/* the open project's own header (max 1.5in) */
.mast-proj { display: none; text-align: center; padding: .5rem 12rem .55rem; }
.pf-home.is-open .mast-proj, .mast-proj.is-leaving { display: block; }
.pf-home.is-open .hdr .masthead { display: none; }
.pf-home.is-open .hdr .masthead.is-leaving { display: block; }
.pf-home .hdr .is-leaving { position: absolute; top: 0; left: 0; right: 0; }
.mast-proj .rule { width: 240px; }
.mast-proj h1 {
  font-family: 'EB Garamond', serif;
  font-size: 1.95rem;
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mast-proj h1 em { font-style: italic; color: var(--slate); }
.mast-proj .lede {
  font-size: .95rem;
  max-width: 44rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-home .hdr.is-compact .mast-proj .eyebrow { max-height: 2rem; opacity: 1; margin: .45rem 0 .1rem; font-size: .62rem; }
.pf-home .hdr.is-compact .mast-proj .lede { max-height: 2rem; opacity: 1; margin: .1rem auto .65rem; line-height: 1.35; }
/* scrolling down into an open project shrinks the header the same way */
.pf-home .hdr.is-compact.is-scrolled .mast-proj .eyebrow { max-height: 0; opacity: 0; margin: .45rem 0 0; }
.pf-home .hdr.is-compact.is-scrolled .mast-proj .lede { max-height: 0; opacity: 0; margin: 0 auto .45rem; }
.pf-home .hdr.is-compact.is-scrolled .mast-proj h1 { margin-top: .2rem; margin-bottom: .2rem; }

/* ---- a project opened in place ---- */
.pf-home .card.is-active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent), 0 6px 20px rgba(93, 78, 122, 0.16);
  transform: none;
}
.pf-home .card.is-active .domain { visibility: hidden; }
.inline-proj { overflow: hidden; }
.inline-proj > .project { padding: 1.6rem 0 .4rem; }
.inline-proj .pager { margin-bottom: 1rem; }

/* the X stays on screen, just right of the column, while a project is open */
.pf-x {
  position: fixed;
  top: calc(var(--hdr-h, 6rem) + .9rem);
  right: max(1rem, calc(50vw - 27rem - 4.2rem));
  z-index: 19;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font: 300 2rem/1 'Source Sans 3', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(93, 78, 122, 0.4);
  transition: background-color .18s ease, transform .18s ease;
}
.pf-x:hover { background: var(--ink); transform: scale(1.06); }
.pf-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (max-width: 900px) {
  .mast-proj { padding: .45rem 1.2rem .5rem; }
  .pf-home.is-open .hdr .wordmark { opacity: 0; pointer-events: none; }
  .mast-proj h1 { font-size: 1.5rem; }
  .mast-proj .lede { font-size: .85rem; }
  .pf-x { width: 2.6rem; height: 2.6rem; font-size: 1.7rem; top: calc(var(--hdr-h, 6rem) + .6rem); right: .7rem; }
}
@media (max-width: 700px) {
  .pf-home .masthead { padding-top: 2.6rem; }
  .pf-home .hdr.is-compact .masthead { padding: .55rem 2.8rem .6rem; }
  .pf-home .hdr.is-compact .masthead h1 { font-size: 1.5rem; }
  .pf-home .hdr.is-compact .rule { width: 160px; }
  .pf-home .hdr.is-compact .wordmark { opacity: 0; pointer-events: none; }
  .pf-home .hdr .wordmark { transition: opacity .25s ease; }
}

/* carousel at 75% */
@media (min-width: 601px) {
  .project .model { width: 75%; margin-left: auto; margin-right: auto; }
}
