/* =========================================================
   PROJECTS — dark gallery

   Reference language:
   - one dark charcoal canvas, grain over the top
   - oversized condensed caps for display (Antonio, the same
     face the homepage already uses)
   - work shown large in soft-cornered frames
   - a single lime accent, used only on tags and state

   The page is dark in both site themes, so the site chrome is
   forced dark here too and the theme toggle is hidden.
   ========================================================= */

.projects-page {
  --bg: #f3f3f1;
  --bg-2: #e8e8e3;
  --nav-bg: #ffffff;

  --ink: #131315;
  --ink-2: #55555a;
  --ink-3: #6b6b71;
  --line: #dcdcd6;
  --line-strong: #bdbdb6;

  /* Logo teal. It is a fill colour first — anything sitting on it takes
     white. As text it works on the light canvas but not on the dark one,
     so --brand-text carries a readable variant per theme. */
  --brand: #115a63;
  --on-brand: #ffffff;
  --brand-text: #115a63;

  --r-card: 22px;
  --r-img: 16px;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Antonio', 'Inter', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav: 0px;

  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 30px 150px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "cv11", "ss01";
}

body.dark-mode .projects-page {
  --bg: #1d1d1e;
  --bg-2: #232326;
  --nav-bg: #141415;

  --ink: #ffffff;
  --ink-2: #a9a9ae;
  --ink-3: #86868e;
  --line: #313134;
  --line-strong: #55555a;

  /* #115a63 on near-black is 2.1:1 — unreadable. Labels take a tint of
     the same hue; the fill itself stays the logo colour. */
  --brand-text: #5fc2ce;
}

.projects-page :is(h1, h2, h3, h4) {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 0.92;
  text-transform: uppercase;
}

.projects-page ::selection {
  background: var(--brand);
  color: var(--on-brand);
}

/* ---------- Site chrome ----------
   The gallery canvas has to run the full viewport width, so it lives on
   the body. Both themes are supported; the toggle stays available. */
body.work-page {
  background: #f3f3f1;
}

body.work-page footer {
  border-top: 1px solid #dcdcd6;
  background: #f3f3f1;
  color: #6b6b71;
}

body.work-page.dark-mode {
  background: #1d1d1e;
  color: #fff;
}

body.work-page.dark-mode::before {
  opacity: 0.035;
}

body.work-page.dark-mode footer {
  border-top: 1px solid #313134;
  background: #1d1d1e;
  color: #86868e;
}

/* ---------- Tag ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--sans);
  font-size: 0.715rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: none;
  white-space: nowrap;
}

.pill-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--on-brand);
}

/* =========================================================
   1. HERO
   ========================================================= */
.projects-page-hero {
  padding: 30px 0 84px;
}

/* Kicker row — availability tag left, section label right, both sitting
   on the hairline the headline drops from. */
.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.projects-page-hero h1 {
  margin-top: 26px;
  font-size: clamp(3.2rem, 11.5vw, 8.5rem);
  line-height: 0.84;
  letter-spacing: -0.012em;
}

/* The lead and the summary share one ruled row under the headline, so
   the right half of the hero carries weight instead of sitting empty. */
.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  align-items: start;
  gap: 36px 64px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-lead {
  max-width: 46ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 1.6;
  letter-spacing: -0.008em;
  text-wrap: pretty;
}

/* Reads as a spec sheet: label left, figure right, ruled between. */
.work-meta {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-meta li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* First figure lines up with the first line of the lead. */
.work-meta li:first-child {
  padding-top: 0;
}

.work-meta strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* =========================================================
   2. FILTER
   ========================================================= */
.work-filter-wrap {
  position: sticky;
  top: var(--nav);
  z-index: 20;
  margin: 0 -30px 84px;
  padding: 14px 30px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

/* Pinned, the bar owns the strip up to the top of the viewport — that
   strip is the clearance for the site's floating nav, and without it
   page content scrolls through the gap. */
.work-filter-wrap.is-pinned {
  border-bottom-color: var(--line);
  background: var(--bg);
}

.work-filter-wrap.is-pinned::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: var(--nav);
  background: var(--bg);
}

.work-filter-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.work-filter {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.work-filter::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.775rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter-btn .n {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.filter-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-btn.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.filter-btn[hidden] {
  display: none;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.filter-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.7rem;
}

/* =========================================================
   3. FEATURED CASE STUDY
   ========================================================= */
.case-study {
  margin-bottom: 128px;
}

.case-study-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: inherit;
  text-decoration: none;
  font-size: 0;
}

.case-study-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.9s var(--ease);
}

/* The work already carries its own typography, so the caption needs a
   wash under it to stay legible over any piece. */
.case-study-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.26) 0%, rgba(10, 10, 11, 0.6) 52%, rgba(10, 10, 11, 0.72) 100%);
}

.case-study-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
}

.case-study-overlay h2 {
  max-width: 18ch;
  color: #fff;
  font-size: clamp(1.9rem, 5vw, 3.9rem);
  text-wrap: balance;
}

.case-study-lead {
  max-width: 58ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

.btn-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.795rem;
  font-weight: 550;
  letter-spacing: -0.007em;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Over the card scrim it always sits on dark artwork */
.case-study-overlay .btn-light {
  background: #fff;
  color: #141415;
}

.projects-page .ico {
  flex: 0 0 auto;
  stroke-width: 1.9;
  transition: transform 0.3s var(--ease);
}

/* The button label is heavier than the inline link, so its arrow needs
   the extra weight to read as the same stroke. */
.btn-light .ico {
  stroke-width: 2.2;
}

a.case-study-media:hover img {
  transform: scale(1.03);
}

a.case-study-media:hover .btn-light,
.btn-light:hover {
  background: var(--brand);
  color: var(--on-brand);
}

a.case-study-media:hover .btn-light .ico,
.btn-light:hover .ico {
  transform: translateX(3px);
}

a.case-study-media:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

/* Notes sit under the frame, quiet */
.case-study-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin-top: 44px;
}

.projects-page .case-block h3 {
  margin: 0 0 10px;
  color: var(--brand-text);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.case-block p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.7;
  letter-spacing: -0.004em;
}

.case-block a,
.case-study-foot a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.case-block a:hover,
.case-study-foot a:hover {
  text-decoration-color: var(--brand-text);
}

.case-study-foot {
  margin: 30px 0 0;
  color: var(--ink-3);
  font-size: 0.82rem;
}

/* Deliverables read as a quiet inline set */
.projects-page .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.projects-page .chip-row li {
  display: inline-flex;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.73rem;
  font-weight: 450;
  letter-spacing: -0.003em;
}

.projects-page .chip-row li::before {
  content: none;
}

/* =========================================================
   4. THE WORK
   ========================================================= */
.work-groups {
  margin-bottom: 128px;
}

.work-group {
  margin-bottom: 110px;
}

.work-group:last-of-type {
  margin-bottom: 0;
}

.work-group[hidden] {
  display: none;
}

/* LOGO & BRAND IDENTITY ───────────────────────────── 03 */
.work-group .section-title {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 0 40px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 0.95;
  text-transform: uppercase;
}

.work-group .section-title .name {
  flex: 0 0 auto;
}

.work-group .section-title .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.work-group .section-title .count {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0;
}

.projects-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 72px 30px;
  align-items: start;
}

.project-card {
  min-width: 0;
}

.project-card[hidden] {
  display: none;
}

.card-shell {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card-shell:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 6px;
  border-radius: var(--r-img);
}

/* Artwork is never cropped — full column width at its own height, so
   entries in a row match and no poster loses an edge. */
.card-media {
  overflow: hidden;
  border-radius: var(--r-img);
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0;
}

.card-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s var(--ease);
}

a.card-shell:hover .card-media img {
  transform: scale(1.035);
}

.card-body {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding-top: 22px;
}

.projects-page .card-title {
  color: var(--ink);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 0.98;
}

.card-desc {
  max-width: 48ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.885rem;
  line-height: 1.62;
  letter-spacing: -0.004em;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  transition: border-color 0.25s ease, color 0.25s ease;
}

a.card-shell:hover .card-cta {
  border-bottom-color: var(--brand-text);
  color: var(--brand-text);
}

a.card-shell:hover .card-cta .ico {
  transform: translateX(3px);
}

/* A lone project in a discipline runs the full measure */
.work-group[data-count="1"] .projects-page-grid {
  grid-template-columns: minmax(0, 1fr);
}

.projects-page .work-group[data-count="1"] .card-title {
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
}

.work-group[data-count="1"] .card-desc {
  max-width: 62ch;
}

.work-empty {
  margin: 0;
  padding: 80px 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

/* =========================================================
   5. CLIENTS
   ========================================================= */
.clients-strip {
  margin-bottom: 120px;
}

.projects-page .clients-strip .section-title {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 0 32px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.projects-page .clients-strip .section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.clients-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clients-strip-list li {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 450;
  letter-spacing: -0.006em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.clients-strip-list li::before {
  content: none;
}

.clients-strip-list li:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* =========================================================
   6. CLOSING
   ========================================================= */
.projects-page .work-cta {
  display: grid;
  justify-items: center;
  gap: 22px;
  max-width: none;
  padding: 88px 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg-2);
  text-align: center;
}

.projects-page .work-cta h2 {
  max-width: 16ch;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 0.9;
  text-transform: uppercase;
  text-wrap: balance;
}

.projects-page .work-cta p {
  max-width: 54ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.62;
}

/* =========================================================
   7. MOTION
   ========================================================= */
.anim .projects-page .project-card,
.anim .projects-page .case-study {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}

.anim .projects-page .project-card.is-visible,
.anim .projects-page .case-study.is-visible {
  opacity: 1;
  transform: none;
}

.work-groups {
  transition: opacity 0.18s ease;
}

.work-groups.is-swapping {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .projects-page .project-card,
  .projects-page .case-study,
  .projects-page .work-groups {
    opacity: 1 !important;
    transform: none !important;
  }

  .projects-page img {
    transform: none !important;
  }

  .projects-page *,
  .projects-page *::before,
  .projects-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =========================================================
   8. RESPONSIVE
   ========================================================= */
@media screen and (max-width: 1000px) {
  .case-study-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }
}

@media screen and (max-width: 800px) {
  .projects-page {
    padding: 26px 18px 110px;
  }

  .work-filter-wrap {
    margin: 0 -18px 60px;
    padding: 12px 18px;
  }

  .projects-page-hero {
    padding: 18px 0 66px;
  }

  .projects-page-grid,
  .work-group[data-count="1"] .projects-page-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .work-group {
    margin-bottom: 76px;
  }

  .case-study-overlay {
    gap: 14px;
    padding: 24px;
  }

  .case-study-lead {
    display: none;
  }

  .case-study-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .projects-page .work-cta {
    padding: 56px 24px;
  }

  /* The summary drops under the lead and keeps its ruled rows. */
  .hero-foot {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    margin-top: 26px;
    padding-top: 24px;
  }

  .work-meta {
    max-width: 360px;
  }

  /* Count drops under the rail rather than eating its width */
  .work-filter-row {
    flex-wrap: wrap;
    gap: 10px 0;
  }

  .work-filter {
    flex: 1 0 100%;
    margin: 0 -18px;
    padding: 0 18px;
  }
}
