/*
Theme Name: H1roto Portfolio Detail Clean Today
Theme URI: https://h1roto.com/
Description: Dark, lightweight CSS Grid portfolio theme for h1roto.com.
Author: Hiroto Kosaka
Version: 2026.8
License: GNU General Public License v3 or later
Text Domain: h1roto
*/

:root {
  --bg: #232323;
  --bg-soft: #292929;
  --surface: #fff;
  --text: #f4f4f2;
  --muted: #999d9f;
  --line: rgba(255,255,255,.1);
  --accent: #3cc7e8;
  --max: 1600px;
  --gap: clamp(20px, 1.55vw, 28px);
}

* { box-sizing: border-box; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Helvetica Neue", Helvetica, "Noto Sans JP", sans-serif;
  font-size: 1.2rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.site-shell {
  width: min(calc(100% - clamp(28px, 5vw, 96px)), var(--max));
  margin-inline: auto;
}

.site-header {
  min-height: clamp(148px, 13vw, 210px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: clamp(38px, 4.6vw, 72px);
}
.site-logo { display: inline-flex; align-items: center; }
.site-logo__image,
.custom-logo {
  width: auto;
  max-width: min(280px, 42vw);
  max-height: 64px;
  object-fit: contain;
}
.site-logo__text {
  color: #fff;
  font-size: clamp(2rem, 2.2vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -.04em;
}
.site-nav {
  padding-top: 7px;
  margin-right: clamp(0px, 4vw, 64px);
}
.site-nav__list {
  display: flex;
  gap: clamp(16px, 2vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__list li { margin: 0; list-style: none; }
.site-nav__list a {
  position: relative;
  color: #aeb1b3;
  font-size: 1rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: color .2s ease;
}
.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transition: right .2s ease;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a { color: #fff; }
.site-nav__list a:hover::after,
.site-nav__list .current-menu-item > a::after { right: 0; }

.site-content { padding-bottom: 20px; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
}
.portfolio-item { min-width: 0; margin: 0; }
.portfolio-item__link {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface);
}
.portfolio-item__media {
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  background: #fff;
}
.portfolio-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.001);
  transition:
    object-position 1.05s cubic-bezier(.22,.61,.36,1),
    transform 1.05s cubic-bezier(.22,.61,.36,1),
    opacity .62s cubic-bezier(.2,.65,.3,1);
  will-change: object-position, transform;
}

/* The image first reveals its title, then quietly exposes the cropped area. */
.portfolio-item__media img.is-landscape {
  animation: none;
}
.portfolio-item__media img.is-portrait {
  animation: none;
}
.portfolio-item__media img.is-square {
  animation: none;
}

.portfolio-item__link:hover .portfolio-item__media img.is-landscape,
.portfolio-item__link:focus-visible .portfolio-item__media img.is-landscape {
  animation: h1roto-pan-x 4.9s .22s linear 1 both;
}
.portfolio-item__link:hover .portfolio-item__media img.is-portrait,
.portfolio-item__link:focus-visible .portfolio-item__media img.is-portrait {
  animation: h1roto-pan-y 4.9s .22s linear 1 both;
}
.portfolio-item__link:hover .portfolio-item__media img.is-square,
.portfolio-item__link:focus-visible .portfolio-item__media img.is-square {
  transform: scale(1.035);
}

/* Pendulum rhythm: quickest through centre, almost still at each edge. */
@keyframes h1roto-pan-x {
  0% {
    object-position: 50% 50%;
    animation-timing-function: cubic-bezier(.18,.72,.30,1);
  }
  27% {
    object-position: 15% 50%;
    animation-timing-function: cubic-bezier(.70,0,.30,1);
  }
  73% {
    object-position: 85% 50%;
    animation-timing-function: cubic-bezier(.70,0,.82,.28);
  }
  100% { object-position: 50% 50%; }
}
@keyframes h1roto-pan-y {
  0% {
    object-position: 50% 50%;
    animation-timing-function: cubic-bezier(.18,.72,.30,1);
  }
  27% {
    object-position: 50% 15%;
    animation-timing-function: cubic-bezier(.70,0,.30,1);
  }
  73% {
    object-position: 50% 85%;
    animation-timing-function: cubic-bezier(.70,0,.82,.28);
  }
  100% { object-position: 50% 50%; }
}
.portfolio-item__placeholder { display:block; width:100%; height:100%; background:#ecece8; }
.portfolio-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(14px, 1.5vw, 22px);
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.08) 68%);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .42s .03s cubic-bezier(.2,.65,.3,1),
    transform .54s .06s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}

.portfolio-item__category {
  margin-bottom: 5px;
  color: rgba(255,255,255,.72);
  font-size: .78rem;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity .38s .11s cubic-bezier(.2,.65,.3,1),
    transform .48s .11s cubic-bezier(.16,1,.3,1);
}
.portfolio-item__title {
  margin: 0;
  font-size: clamp(1.15rem, .95vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity .42s .18s cubic-bezier(.2,.65,.3,1),
    transform .54s .18s cubic-bezier(.16,1,.3,1);
}
.portfolio-item__link:hover .portfolio-item__media img,
.portfolio-item__link:focus-visible .portfolio-item__media img { opacity: .72; }
.portfolio-item__link:hover .portfolio-item__overlay,
.portfolio-item__link:focus-visible .portfolio-item__overlay { opacity: 1; transform: none; }
.portfolio-item__link:hover .portfolio-item__category,
.portfolio-item__link:focus-visible .portfolio-item__category,
.portfolio-item__link:hover .portfolio-item__title,
.portfolio-item__link:focus-visible .portfolio-item__title {
  opacity: 1;
  transform: none;
}
.portfolio-item__link:hover .portfolio-item__media img.is-square,
.portfolio-item__link:focus-visible .portfolio-item__media img.is-square {
  transition-delay: .22s, .22s, .05s;
}

.pagination { margin: clamp(38px, 5vw, 72px) 0 10px; }
.pagination .nav-links { display: flex; align-items: center; gap: 8px; }
.pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .08em;
}
.pagination .page-numbers:hover,
.pagination .current { border-color: #fff; color: #fff; }

.site-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(34px, 5vw, 70px);
  padding: 18px 0 30px;
}
.site-footer p { margin: 0; color: #696d6f; font-size: .78rem; letter-spacing: .09em; }

/* Single posts and pages */
.single .site-content,
.page .site-content { max-width: 1120px; margin-inline: auto; }
.single .type-post,
.page .type-page { background: #fff; color: #17191b; }
.single .gridly-image img,
.page .gridly-image img { width: 100%; }
.single .gridly-copy,
.page .gridly-copy { padding: clamp(28px, 6vw, 72px); }
.gridly-copy h1 { margin: 0 0 22px; font-size: clamp(2.8rem, 5vw, 5.8rem); line-height: 1.1; }
.gridly-copy p { font-size: clamp(1.35rem, 1.3vw, 1.7rem); line-height: 1.9; }
.gridly-copy a { text-decoration: underline; text-underline-offset: 3px; }
.gridly-category { padding: 16px 0; color: var(--muted); }
.gridly-date { color: #888; font-size: 1rem !important; }
.post-nav { display:flex; justify-content:space-between; gap:16px; margin-top:24px; }
.post-nav a { padding:10px 0; color:#fff; }
.aligncenter { display:block; margin-inline:auto; }
.alignleft { float:left; margin:0 24px 18px 0; }
.alignright { float:right; margin:0 0 18px 24px; }

@media (max-width: 1400px) {
  .portfolio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .site-header { min-height: 122px; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-item__overlay { position: static; opacity: 1; transform: none; background: var(--bg-soft); padding: 12px 13px 14px; }
  .portfolio-item__category,
  .portfolio-item__title { opacity: 1; transform: none; }
  .portfolio-item__category { color: var(--muted); }
  .site-logo__image, .custom-logo { max-height: 44px; }
}
@media (max-width: 460px) {
  .site-header { display:block; min-height: 146px; }
  .site-nav { padding-top: 24px; }
  .site-nav__list { gap: 18px; flex-wrap: wrap; }
  .portfolio-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --------------------------------------------------------------------------
   Persistent header
   The navigation remains usable throughout long project pages.
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 50%;
  width: min(calc(100% - clamp(28px, 5vw, 96px)), var(--max));
  min-height: 0;
  padding: clamp(22px, 2.3vw, 36px) 0 18px;
  transform: translateX(-50%);
  align-items: flex-start;
  background: linear-gradient(to bottom, rgba(35,35,35,.98) 0%, rgba(35,35,35,.92) 72%, rgba(35,35,35,0) 100%);
}
.site-content {
  padding-top: clamp(126px, 10vw, 166px);
}
body.admin-bar .site-header { top: 32px; }
.site-header .site-logo__image,
.site-header .custom-logo { max-height: 58px; }

/* --------------------------------------------------------------------------
   Project detail
   -------------------------------------------------------------------------- */
.single .site-content {
  max-width: 1120px;
  margin-inline: auto;
}
.single .project-detail {
  width: 100%;
  margin: 0;
  background: transparent;
  color: #17191b;
}
.project-hero {
  margin: 0;
  background: #fff;
  overflow: hidden;
}
.project-hero + .project-body {
  margin-top: clamp(18px, 2vw, 28px);
}
.project-hero__image {
  display: block;
  width: 100%;
  height: auto;
}
.project-body {
  background: #fff;
  padding: clamp(46px, 7vw, 96px) clamp(34px, 7vw, 96px) clamp(58px, 8vw, 112px);
}
.project-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(42px, 6vw, 76px);
}
.project-eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 16px;
  color: #85898c;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.project-title {
  margin: 0;
  max-width: 14ch;
  color: #17191b;
  font-size: clamp(3.6rem, 5.3vw, 7.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.045em;
}
.project-year {
  margin: 0 0 .55em;
  color: #9a9da0;
  font-size: 1rem;
  letter-spacing: .14em;
}
.project-content {
  max-width: 860px;
  margin-top: clamp(44px, 6vw, 76px);
  padding-top: clamp(34px, 4vw, 52px);
  border-top: 1px solid #e6e6e3;
}
.project-content > *:first-child { margin-top: 0; }
.project-content > *:last-child { margin-bottom: 0; }
.project-content p,
.project-content li {
  color: #34373a;
  font-size: clamp(1.45rem, 1.25vw, 1.75rem);
  line-height: 1.9;
}
.project-content p { margin: 0 0 1.35em; }
.project-content a {
  color: #17191b;
  text-decoration: underline;
  text-decoration-color: #aeb1b3;
  text-underline-offset: .2em;
}
.project-content img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin-block: clamp(20px, 4vw, 56px);
}
.project-content .aligncenter { margin-inline: auto; }
.project-content .wp-block-image,
.project-content figure { margin-inline: 0; }
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: clamp(46px, 7vw, 84px);
  padding-top: 24px;
  border-top: 1px solid #e6e6e3;
}
.project-tags span {
  color: #7d8184;
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.project-tags span:not(:last-child)::after {
  content: "/";
  margin-left: 10px;
  color: #c5c7c8;
}

/* Previous / works / next: always visible as a deliberate end to the page. */
.project-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: 150px;
  padding: clamp(34px, 5vw, 64px) 0;
  border-bottom: 1px solid var(--line);
}
.project-navigation__item a {
  display: inline-flex;
  flex-direction: column;
  max-width: 34rem;
}
.project-navigation__item--next { text-align: right; }
.project-navigation__item--next a { align-items: flex-end; float: right; }
.project-navigation__label,
.project-navigation__works {
  color: #b4b7b9;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.project-navigation__title {
  margin-top: 9px;
  color: #f2f2ef;
  font-size: clamp(1.25rem, 1.15vw, 1.55rem);
  line-height: 1.4;
  transition: color .2s ease;
}
.project-navigation__item a:hover .project-navigation__title { color: var(--accent); }
.project-navigation__works {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  transition: color .2s ease;
}
.project-navigation__works:hover { color: #fff; }
.project-navigation__grid {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
}
.project-navigation__grid i {
  display: block;
  width: 5px;
  height: 5px;
  background: currentColor;
}

/* Old Gridly details must never leak back into the new project template. */
.single .gridly-category,
.single .gridly-copy,
.single .post-nav,
.single .comments-area,
.single #respond { display: none !important; }

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
@media (max-width: 720px) {
  .site-header {
    padding-top: 20px;
    padding-bottom: 20px;
    background: rgba(35,35,35,.96);
  }
  .site-content { padding-top: 118px; }
  .project-heading {
    display: block;
    margin-bottom: 42px;
  }
  .project-title { max-width: none; }
  .project-year { margin-top: 18px; }
  .project-navigation {
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    min-height: 118px;
  }
  .project-navigation__title { display: none; }
}
@media (max-width: 460px) {
  .site-header {
    display: flex;
    min-height: 0;
  }
  .site-nav { padding-top: 5px; }
  .site-nav__list { gap: 14px; flex-wrap: nowrap; }
  .project-body { padding-inline: 26px; }
  .project-navigation__label,
  .project-navigation__works { font-size: .9rem; }
}

/* =========================================================
   Graphic / Website portfolio extension
   ========================================================= */
.project-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 64px);
    margin-top: clamp(30px, 4vw, 52px);
    padding-top: 20px;
    border-top: 1px solid rgba(20, 20, 20, .16);
}

.project-meta p {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: .04em;
}

.project-meta p > span {
    display: block;
    margin-bottom: 7px;
    color: rgba(20, 20, 20, .46);
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .18em;
}

.project-website a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: opacity .25s ease;
}

.project-website a:hover,
.project-website a:focus-visible {
    opacity: .52;
}

.project-website b {
    font-size: 1.05em;
    font-weight: 400;
}

@media (max-width: 700px) {
    .project-meta {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* Keep information-only projects concise after duplicate artwork is removed. */
.project-body:not(:has(.project-content)):not(:has(.project-tags)) .project-heading {
  margin-bottom: 0;
}
.project-content > figure,
.project-content > .wp-block-image,
.project-content > p:has(> img:only-child) {
  margin-top: clamp(34px, 5vw, 64px);
  margin-bottom: clamp(34px, 5vw, 64px);
}

/* Project image lightbox --------------------------------------------------- */
.project-detail .project-hero img.is-lightbox-enabled,
.project-detail .project-content img.is-lightbox-enabled {
    cursor: zoom-in;
}

.project-detail .project-hero img.is-lightbox-enabled:focus-visible,
.project-detail .project-content img.is-lightbox-enabled:focus-visible {
    outline: 2px solid #22b9e6;
    outline-offset: 5px;
}

html.has-project-lightbox,
html.has-project-lightbox body {
    overflow: hidden;
}

.project-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.project-lightbox.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.project-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.96);
    cursor: zoom-out;
}

.project-lightbox__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(58px, 8vw) minmax(0, 1fr) minmax(58px, 8vw);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    pointer-events: none;
}

.project-lightbox__figure {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(58px, 7vh, 96px) 0 clamp(36px, 5vh, 72px);
    pointer-events: auto;
}

.project-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 1;
    transform: scale(1);
    transition: opacity 160ms ease, transform 260ms cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
}

.project-lightbox__image.is-loading {
    opacity: 0;
    transform: scale(0.985);
}

.project-lightbox__caption {
    margin-top: 14px;
    max-width: 70ch;
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
    line-height: 1.65;
    letter-spacing: 0.04em;
    text-align: center;
}

.project-lightbox__close,
.project-lightbox__nav {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.76);
    cursor: pointer;
    pointer-events: auto;
    transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.project-lightbox__close:hover,
.project-lightbox__close:focus-visible,
.project-lightbox__nav:hover,
.project-lightbox__nav:focus-visible {
    color: #fff;
}

.project-lightbox__close:focus-visible,
.project-lightbox__nav:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.8);
    outline-offset: 6px;
}

.project-lightbox__close {
    position: absolute;
    top: clamp(22px, 3vw, 42px);
    right: clamp(22px, 3vw, 42px);
    width: 42px;
    height: 42px;
}


.project-lightbox__nav {
    grid-row: 1;
    align-self: stretch;
    width: 100%;
    font-size: 24px;
    font-weight: 300;
    opacity: 0.72;
}

.project-lightbox__nav--prev { grid-column: 1; }
.project-lightbox__nav--next { grid-column: 3; }
.project-lightbox__nav--prev:hover { transform: translateX(-3px); }
.project-lightbox__nav--next:hover { transform: translateX(3px); }

.project-lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: clamp(20px, 3vh, 36px);
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    letter-spacing: 0.14em;
    pointer-events: none;
}

@media (max-width: 700px) {
    .project-lightbox__panel {
        grid-template-columns: 50px minmax(0, 1fr) 50px;
    }

    .project-lightbox__figure {
        padding-top: 72px;
        padding-bottom: 58px;
    }

    .project-lightbox__image {
        max-height: calc(100vh - 132px);
    }

    .project-lightbox__close {
        top: 14px;
        right: 12px;
    }

    .project-lightbox__nav {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-lightbox,
    .project-lightbox__image,
    .project-lightbox__close,
    .project-lightbox__nav {
        transition: none !important;
    }
}


/* =========================================================
   Project detail scale refinement
   Keep enough visual distance between inline preview and lightbox enlargement.
   ========================================================= */
.single .site-content {
  max-width: 1180px;
}

.project-hero {
  width: min(100%, 900px);
  margin-inline: auto;
  background: transparent;
}

.project-hero__image {
  width: 100%;
  max-height: min(72vh, 900px);
  object-fit: contain;
  background: #fff;
}

.project-body {
  width: min(100%, 900px);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 70px) clamp(30px, 5vw, 68px) clamp(52px, 6vw, 82px);
}

.project-heading {
  align-items: start;
  margin-bottom: clamp(34px, 4vw, 54px);
}

.project-eyebrow {
  margin-bottom: 12px;
  font-size: .86rem;
}

.project-title {
  max-width: 20ch;
  font-size: clamp(2.2rem, 3.1vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -.032em;
}

/* A visually unmistakable close control. */
.project-lightbox__close {
  top: clamp(18px, 2.2vw, 30px);
  right: clamp(18px, 2.2vw, 30px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: auto;
  min-width: 112px;
  height: 46px;
  padding: 0 16px 0 13px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(18,18,18,.72);
  color: #fff;
  box-shadow: 0 7px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
}

.project-lightbox__close:hover,
.project-lightbox__close:focus-visible {
  border-color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.project-lightbox__close-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.project-lightbox__close-icon::before,
.project-lightbox__close-icon::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 1px;
  width: 17px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}
.project-lightbox__close-icon::before { transform: rotate(45deg); }
.project-lightbox__close-icon::after  { transform: rotate(-45deg); }

/* Disable the former unlabeled X geometry. */
.project-lightbox__close > span:first-child:not(.project-lightbox__close-icon)::before,
.project-lightbox__close > span:first-child:not(.project-lightbox__close-icon)::after {
  content: none;
}

.project-lightbox__image {
  max-width: min(88vw, 1600px);
  max-height: calc(100vh - 104px);
}

.project-lightbox__figure {
  padding-top: 54px;
  padding-bottom: 36px;
}

@media (max-width: 700px) {
  .project-hero,
  .project-body { width: 100%; }

  .project-hero__image { max-height: 68vh; }

  .project-title {
    font-size: clamp(2rem, 10vw, 3.15rem);
  }

  .project-lightbox__close {
    top: 12px;
    right: 12px;
    min-width: 46px;
    width: 46px;
    padding: 0;
  }

  .project-lightbox__close-label { display: none; }

  .project-lightbox__image {
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 90px);
  }
}


/* =========================================================
   Structured project information architecture
   Optional fields collapse cleanly when left empty.
   ========================================================= */
.project-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, .75fr);
  gap: clamp(42px, 7vw, 96px);
  align-items: start;
  margin-bottom: clamp(50px, 7vw, 92px);
}
.project-heading__main { min-width: 0; }
.project-title {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 2.65vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.project-summary {
  max-width: 42em;
  margin: clamp(22px, 3vw, 34px) 0 0;
  color: rgba(20,20,20,.72);
  font-size: clamp(1.05rem, 1.25vw, 1.35rem);
  line-height: 1.8;
  letter-spacing: .005em;
}
.project-facts {
  display: grid;
  gap: 0;
  margin: 1px 0 0;
  padding: 0;
  border-top: 1px solid rgba(20,20,20,.16);
}
.project-facts > div {
  display: grid;
  grid-template-columns: 82px minmax(0,1fr);
  gap: 18px;
  padding: 15px 0 16px;
  border-bottom: 1px solid rgba(20,20,20,.12);
}
.project-facts dt,
.project-facts dd { margin: 0; }
.project-facts dt {
  padding-top: 2px;
  color: rgba(20,20,20,.44);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .18em;
}
.project-facts dd {
  color: rgba(20,20,20,.86);
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: .025em;
}
.project-facts a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity .25s ease;
}
.project-facts a:hover,
.project-facts a:focus-visible { opacity: .5; }
.project-facts b { font-weight: 400; }
/* Retire the previous generic meta row in favour of the semantic facts list. */
.project-meta { display: none !important; }

@media (max-width: 760px) {
  .project-heading {
    grid-template-columns: 1fr;
    gap: 38px;
    margin-bottom: 54px;
  }
  .project-title { max-width: none; }
  .project-facts { width: 100%; }
}
@media (max-width: 460px) {
  .project-facts > div { grid-template-columns: 70px minmax(0,1fr); gap: 12px; }
}
