/* ==========================================================================
   D02 — Mara Lind · Work (demos/mara-lind/work.html)
   View switch, facet filters, contact sheet / list / gallery views,
   loupe + hover preview, empty state and the "Under NDA" block.
   ========================================================================== */

/* Cross-document view transition into the case study (shared "hofmark" frame) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ---- Page frame --------------------------------------------------------- */
.work-page {
  padding-top: clamp(40px, 6vw, 80px);
}

.work-page__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

/* ---- View switch (segmented control) ----------------------------------- */
.view-switch {
  display: flex;
  border: 1px solid var(--ink);
}

.view-switch__button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 13px;
  cursor: pointer;
}

.view-switch__button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--canvas);
}

/* ---- Filters ------------------------------------------------------------ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 28px 0 36px;
}

.filters__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filters__options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--canvas);
}

/* ---- View: contact sheet ----------------------------------------------- */
.contact-sheet {
  padding: 14px clamp(14px, 2.5vw, 32px) 28px;
  background: var(--sheet);
}

/* Row of film sprocket holes */
.contact-sheet__sprockets {
  height: 10px;
  margin-bottom: 18px;
  background: repeating-linear-gradient(90deg, var(--sheet-ink) 0 10px, transparent 10px 26px);
  opacity: .8;
}

.contact-sheet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 28px 18px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--sheet-ink);
  text-decoration: none;
}

.work-card:hover {
  color: var(--sheet-ink);
}

.work-card__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--edge);
}

.work-card__frame {
  padding: 8px;
  border-radius: 0;
  cursor: zoom-in;
}

.work-card__title {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
  font-size: 22px;
}

.work-card__summary {
  font-size: 14px;
  color: var(--sheet-muted);
}

/* Magnifier following the pointer (position set by JS) */
.loupe {
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: repeating-linear-gradient(135deg, var(--ph) 0 25px, var(--ph-stripe) 25px 27.5px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
  pointer-events: none;
}

/* ---- View: list --------------------------------------------------------- */
.work-list {
  position: relative;
  border-top: 1px solid var(--ink);
}

.work-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 60px;
  gap: 16px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.work-row__no {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}

.work-row__title {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
  font-size: clamp(20px, 2.4vw, 34px);
}

.work-row__service {
  color: var(--muted);
}

.work-row__result {
  font-size: 15px;
}

.work-row__year {
  font-family: var(--f-mono);
  font-size: 13px;
  text-align: right;
}

/* 4:5 preview next to the pointer (position set by JS) */
.work-list__preview {
  --ratio: 4/5;
  position: absolute;
  width: 220px;
  margin: -140px 0 0 24px;
  padding: 8px;
  border-radius: 0;
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .45);
  pointer-events: none;
}

/* ---- View: gallery ------------------------------------------------------ */
.work-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 56px);
}

.work-banner {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.work-banner__frame {
  padding: 14px;
  border-radius: 0;
}

.work-banner__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.work-banner__title {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  text-transform: var(--d-case);
  letter-spacing: var(--d-track);
  font-size: 28px;
}

.work-banner__meta {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--muted);
}

/* ---- Empty state -------------------------------------------------------- */
.work-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 48px 0;
}

.work-empty__title {
  font-size: 28px;
}

/* ---- Under NDA ---------------------------------------------------------- */
.nda {
  margin-top: 72px;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.block-head__title {
  font-size: var(--t-h1);
  line-height: 1;
}

.nda__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px;
}

.nda-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nda-card__cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 3/2;
  padding: 14px;
  background: var(--sheet);
  color: var(--sheet-ink);
  text-align: center;
}

.nda-card__badge {
  padding: 4px 10px;
  border: 2px solid var(--sheet-ink);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nda-card__text {
  font-size: 15px;
}

.nda-card__link {
  font-weight: 600;
}
