:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fffaf1;
  background: #30271f;
  font-synthesis: none;
  --projects-gutter: var(--site-edge, 65px);
  --projects-gold: #f4d35e;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; }
/* Match the works page's scrollbar geometry when switching pages. */
html, body { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--projects-gold); outline-offset: 5px; }
::selection { color: #282017; background: #eed18b; }

.projects-scene {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: #30271f url("assets/works-ambient-bg-v3.webp") center top / cover no-repeat;
}

.projects-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 15, 13, .66), rgba(17, 15, 13, .29) 42%, rgba(17, 15, 13, .16)), linear-gradient(0deg, rgba(11, 10, 9, .42), rgba(11, 10, 9, .06) 46%, rgba(11, 10, 9, .14)), linear-gradient(180deg, rgba(20, 16, 11, .1), rgba(20, 16, 11, .1));
}

.projects-page { display: flex; flex-direction: column; min-height: 100svh; }
.projects-page .site-header { right: auto; width: calc(100vw - var(--site-edge) - var(--site-edge)); }
.projects-main,
.projects-footer {
  width: calc(100% - var(--projects-gutter) - var(--projects-gutter));
  max-width: 1640px;
  margin-inline: auto;
}

.projects-main { flex: 1; padding-top: 78px; }
.projects-intro { min-height: 157px; padding-bottom: 10px; color: #fff; text-shadow: 0 2px 22px rgba(0, 0, 0, .36); }
.projects-eyebrow { margin: 0 0 14px; color: var(--projects-gold); font-size: 12px; font-weight: 400; line-height: normal; letter-spacing: .2em; }
.projects-eyebrow::after { content: ""; display: block; width: 54px; height: 1px; margin-top: 10px; background: var(--projects-gold); box-shadow: 0 0 12px rgba(244, 211, 94, .32); }
.projects-intro h1 { margin: 0; font-size: 56px; font-weight: 400; line-height: 1; letter-spacing: -.065em; }
.projects-lede { max-width: 390px; margin: 18px 0 0; color: rgba(255, 255, 255, .84); font-size: 18px; line-height: 1.65; }

.projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 0 12px;
  border: 1px solid rgba(255, 249, 225, .16);
  border-radius: 12px;
  background: radial-gradient(70% 150% at 50% 0%, rgba(255, 255, 255, .12), transparent 58%), radial-gradient(120% 170% at 88% 120%, rgba(238, 225, 150, .08), transparent 58%), linear-gradient(132deg, rgba(28, 24, 20, .28), rgba(112, 93, 70, .18) 48%, rgba(16, 14, 12, .32));
  /* Match the navigation tint without a broad dark shadow below the bar. */
  background-color: rgba(153, 133, 108, .24);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 3px 10px rgba(48, 35, 21, .05);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  backdrop-filter: blur(24px) saturate(1.16);
}

.projects-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.projects-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.projects-filter {
  flex: none;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255, 251, 239, .82);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: .08em;
  white-space: nowrap;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.projects-filter:hover { color: #fffaf1; border-color: rgba(255, 249, 225, .2); background: rgba(255, 251, 239, .07); }
.projects-filter[aria-pressed="true"] { color: var(--projects-gold); border-color: rgba(238, 225, 150, .12); background: rgba(238, 225, 150, .09); box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 4px 12px rgba(238, 225, 150, .07); }
.projects-filter:focus-visible { outline: 2px solid var(--projects-gold); outline-offset: 3px; }
.projects-library-note { flex: none; margin: 0; color: rgba(255, 251, 239, .67); font-size: 11px; line-height: 1.6; letter-spacing: .08em; white-space: nowrap; }
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 27px; align-items: stretch; }
.project-card { min-width: 0; }
.project-video {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 225, .27);
  border-radius: 12px;
  background: linear-gradient(130deg, rgba(103, 87, 64, .46), rgba(43, 34, 25, .48));
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 16px 38px rgba(23, 16, 8, .15);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: transform .3s ease, border-color .6s cubic-bezier(.22, .61, .36, 1), box-shadow .6s cubic-bezier(.22, .61, .36, 1);
}

.project-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse at 77% 18%, rgba(255, 243, 198, .25), transparent 55%), linear-gradient(135deg, #4e4537, #92846b 58%, #574934);
}

.project-media::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(124deg, transparent 0 72px, rgba(250, 235, 195, .09) 72px 73px, transparent 73px 145px), linear-gradient(90deg, transparent 49.8%, rgba(250, 235, 195, .07) 50%, transparent 50.2%);
  pointer-events: none;
}

.project-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19, 15, 10, .04) 45%, transparent 100%); pointer-events: none; }
.project-cover {
  position: absolute;
  inset: -2px;
  display: block;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  object-fit: cover;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
  transform-origin: 50% 100%;
  transition: transform .55s ease, filter .4s ease;
}
.project-play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 250, 229, .55);
  border-radius: 50%;
  color: #fff9e6;
  background: rgba(255, 245, 213, .09);
  box-shadow: inset 0 1px rgba(255, 255, 255, .2), 0 5px 25px rgba(25, 19, 9, .12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translate(-50%, -50%);
  transition: background .3s ease, border-color .3s ease;
}

.project-play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.project-platform,
.project-action { position: absolute; z-index: 1; font-size: 10px; line-height: 1.5; letter-spacing: .08em; }
.project-platform { top: 17px; left: 18px; padding: 4px 9px; border: 1px solid rgba(255, 249, 229, .22); border-radius: 999px; color: rgba(255, 251, 239, .92); background: rgba(30, 25, 18, .23); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.project-action { right: 18px; bottom: 16px; color: rgba(255, 250, 234, .9); text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.project-caption {
  position: relative;
  z-index: 2;
  margin-top: -2px;
  padding: 23px 22px 23px;
}
.project-title { margin: 0; font-size: 21px; font-weight: 400; line-height: 1.4; letter-spacing: .025em; overflow-wrap: anywhere; }
.project-description { margin: 9px 0 0; color: rgba(255, 250, 239, .76); font-size: 13px; font-weight: 300; line-height: 1.75; overflow-wrap: anywhere; }

.project-video:hover,
.project-video:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 249, 225, .22);
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 0 14px rgba(255, 255, 255, .08), 0 0 30px rgba(255, 255, 255, .05), 0 21px 43px rgba(23, 16, 8, .19);
}
.project-video:hover .project-cover,
.project-video:focus-visible .project-cover { transform: translateZ(0) scale(1.025); filter: brightness(1.025); }
.project-video:hover .project-play,
.project-video:focus-visible .project-play { background: rgba(255, 245, 213, .18); border-color: rgba(255, 249, 221, .85); }

.project-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 260px;
  padding: 28px;
  border: 1px dashed rgba(255, 249, 227, .23);
  border-radius: 12px;
  color: rgba(255, 251, 239, .86);
  background: rgba(62, 50, 33, .26);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: center;
  text-shadow: 0 1px 10px rgba(30, 22, 12, .16);
}

.project-placeholder-symbol { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border: 1px solid rgba(255, 249, 227, .22); border-radius: 50%; }
.project-placeholder-symbol svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.project-placeholder h3 { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.5; letter-spacing: .05em; }
.project-placeholder p { margin: 9px 0 0; font-size: 12px; line-height: 1.7; letter-spacing: .03em; }
.projects-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 36px 28px; color: rgba(255, 251, 239, .72); font-size: 10px; line-height: 1.7; letter-spacing: .16em; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.projects-footer-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; min-width: 0; }
.projects-footer a { flex: none; color: var(--projects-gold); }
.projects-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* The works page keeps a 1640px canvas above its 620px mobile breakpoint. */
@media (min-width: 621px) {
  html, body { min-width: 1776px; }
  body { overflow-x: auto; }
  .projects-main, .projects-footer { width: 1640px; }
  .projects-toolbar { height: 68px; }
}

@media (max-width: 620px) {
  .project-title { font-size: 19px; }
  .project-caption { padding: 20px 19px 21px; }
  .projects-scene { background-position: 58% top; }
  .projects-scene::after { background: linear-gradient(90deg, rgba(17, 15, 13, .64), rgba(17, 15, 13, .3)), linear-gradient(0deg, rgba(11, 10, 9, .38), rgba(11, 10, 9, .06) 65%), linear-gradient(180deg, rgba(20, 16, 11, .12), rgba(20, 16, 11, .12)); }
  .projects-main { padding-top: 86px; }
  .projects-intro { min-height: 134px; padding-bottom: 0; }
  .projects-intro h1 { font-size: clamp(36px, 6.4vw, 52px); }
  .projects-lede { margin-top: 13px; font-size: 14px; }
  .projects-toolbar { flex-direction: column; align-items: stretch; min-height: 62px; gap: 12px; padding: 14px 17px; border-radius: 10px; }
  .projects-filter { padding-inline: 11px; }
  .projects-library-note { align-self: flex-end; font-size: 10px; text-align: right; }
  .projects-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 22px; }
  .project-placeholder { min-height: 180px; padding: 24px; }
  .project-placeholder-symbol { width: 36px; height: 36px; margin-bottom: 12px; }
  .project-placeholder h3 { font-size: 15px; }
  .projects-footer { gap: 12px; padding-block: 32px 24px; font-size: 9px; letter-spacing: .1em; }
}

@media (max-width: 390px) {
  .projects-toolbar { padding-inline: 14px; }
  .projects-library-note { letter-spacing: .02em; }
  .project-caption { padding-inline: 17px; }
  .project-platform { top: 14px; left: 14px; }
  .project-action { right: 14px; bottom: 13px; }
  .project-play { width: 50px; height: 50px; }
  .projects-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .projects-filter,
  .project-video,
  .project-cover,
  .project-play { transition: none; }
  .project-video:hover,
  .project-video:focus-visible,
  .project-video:hover .project-cover,
  .project-video:focus-visible .project-cover { transform: none; }
}
