/* Works page — extends style.css (same :root tokens). */
.works { max-width: 1120px; margin: 0 auto; padding: 90px 24px 100px; }
.works__head { max-width: 640px; }
.works__title { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6vw, 72px); line-height: 1; letter-spacing: -0.01em; margin: 28px 0 22px; }
.works__title em { font-style: normal; color: var(--red); }

.works__grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 32px; margin-top: 64px; }

.work { display: block; }
.work__shot { position: relative; margin: 0; aspect-ratio: 8 / 5; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.work__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .5s cubic-bezier(.22, .9, .3, 1); }
.work:hover .work__shot img, .work:focus-visible .work__shot img { transform: scale(1.03); }
.work:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }

.work__meta { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.work__no { font-family: var(--serif); font-weight: 500; font-size: 15px; color: var(--red); }
.work__name { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.work__cat { font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.works__cta { margin-top: 110px; padding-top: 56px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.works__cta h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.5vw, 48px); line-height: 1.1; }
.works__cta h2 em { font-style: normal; color: var(--red); }

/* Industry filter (built by works.js) */
.works__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.chip { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid #b9b4ab; border-radius: 4px; padding: 9px 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.works__filters + .works__grid { margin-top: 36px; }

@media (max-width: 760px) {
  .works { padding-top: 56px; }
  .works__grid { grid-template-columns: 1fr; gap: 44px; }
  .work__meta { grid-template-columns: auto 1fr; }
  .work__cat { grid-column: 2; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .work__shot img, .chip { transition: none; }
  .work:hover .work__shot img { transform: none; }
}

/* ---------- Showcase tiles: soft shadow, caption on hover ---------- */
.works__grid {
  gap: 32px;
  margin-top: 36px;
}

.work { position: relative; }

.work__shot {
  border: 0;
  border-radius: 6px;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(23, 21, 26, .06),
    0 18px 40px -14px rgba(23, 21, 26, .28);
  transition: transform .35s cubic-bezier(.22, .9, .3, 1), box-shadow .35s;
}

.work:hover .work__shot,
.work:focus-visible .work__shot {
  transform: translateY(-4px);
  box-shadow:
    0 2px 6px rgba(23, 21, 26, .06),
    0 26px 48px -16px rgba(23, 21, 26, .36);
}

/* Caption sits on top of the picture and fades in */
.work__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 18px 20px;
  border: 0;
  border-radius: 0 0 6px 6px;
  background: rgba(23, 21, 26, .88);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}

.work:hover .work__meta,
.work:focus-visible .work__meta {
  opacity: 1;
  transform: none;
}

.work__no   { color: #fff; opacity: .7; }
.work__name { color: #fff; font-size: 22px; }
.work__cat  { color: #fff; opacity: .8; }

/* Phones and tablets have no hover, so keep the caption visible */
@media (hover: none) {
  .work__meta { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .works__grid { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .work__shot, .work__meta { transition: none; }
  .work:hover .work__shot,
  .work:focus-visible .work__shot { transform: none; }
}

/* ---------- Project popup ---------- */
.modal {
  width: min(1080px, 94vw);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 30px 80px -20px rgba(23, 21, 26, .55);
}

.modal::backdrop { background: rgba(23, 21, 26, .62); }

.modal[open] { animation: modal-in .25s cubic-bezier(.22, .9, .3, 1); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

body:has(.modal[open]) { overflow: hidden; }

/* Close button stays visible while you scroll */
.modal__close {
  position: sticky;
  top: 14px;
  z-index: 3;
  display: block;
  width: 38px;
  height: 38px;
  margin: 14px 14px -52px auto;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}

.modal__close:hover { background: var(--red); }
.modal__close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Large screenshot */
.modal__hero { padding: 28px 32px 28px; }

.modal__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

/* Sticky tab bar */
.modal__tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 28px;
  padding: 0 36px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.modal__tabs button {
  padding: 16px 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}

.modal__tabs button:hover { color: var(--ink); }

.modal__tabs button.is-active {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.modal__tabs button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Label on the left, content on the right */
.modal__sec {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 40px 36px 8px;
  scroll-margin-top: 54px;
}

.modal__sec:last-child { padding-bottom: 48px; }

.modal__label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 5px;
}

.modal__body p {
  font-size: 16.5px;
  line-height: 1.8;
  color: #3a383e;
  max-width: 680px;
}

.modal__platform {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid #b9b4ab;
  border-radius: 4px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.swatches {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
}

.swatch { width: 96px; }

.swatch__chip {
  display: block;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.swatch__hex {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.swatch__name {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .modal__hero { padding: 16px 16px 20px; }
  .modal__tabs { padding: 0 20px; gap: 20px; }
  .modal__sec { grid-template-columns: 1fr; gap: 12px; padding: 28px 20px 4px; }
  .modal__label { padding-top: 0; }
}

dialog.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
}