.works-body {
  background: var(--paper);
}

.works-body .site-header {
  background: rgb(243 244 241 / 96%);
  transform: none;
}

.works-main {
  padding-top: var(--header-height);
}

.works-hero {
  position: relative;
  display: grid;
  min-height: 82svh;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 56px;
  align-items: end;
  padding: 148px max(var(--page-pad), calc((100% - var(--content-width)) / 2 + var(--page-pad))) 78px;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
  isolation: isolate;
}

.works-hero::before,
.works-hero::after {
  position: absolute;
  inset: 0;
  content: "";
}

.works-hero::before {
  z-index: -2;
  background: url("/assets/portfolio/tiesiogine-transliacija-koncerto-kamera-1280.webp") center 50% / cover no-repeat;
  filter: saturate(0.82) contrast(1.06);
  transform: scale(1.025);
  animation: works-hero-settle 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.works-hero::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(10 12 14 / 90%) 0%, rgb(10 12 14 / 58%) 52%, rgb(10 12 14 / 18%) 100%),
    linear-gradient(0deg, rgb(10 12 14 / 82%) 0%, transparent 72%);
}

.works-hero-text {
  max-width: 850px;
}

.works-hero .kicker {
  margin-bottom: 24px;
  color: rgb(243 244 241 / 68%);
}

.works-hero h1 {
  max-width: 850px;
  font-size: clamp(64px, 7.2vw, 112px);
  font-weight: 900;
  line-height: 0.9;
  text-wrap: balance;
}

.works-hero-copy {
  max-width: 520px;
}

.works-hero-copy p {
  margin-bottom: 30px;
  color: rgb(243 244 241 / 82%);
  font-size: 18px;
  line-height: 1.55;
}

.works-hero .button-dark {
  border-color: var(--paper);
  color: var(--ink);
  background: var(--paper);
}

.works-hero .button-dark:hover {
  color: var(--paper);
  background: transparent;
}

.works-index,
.event-gallery {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 108px var(--page-pad);
}

.works-section-head {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 48px;
  margin-bottom: 54px;
}

.works-section-head > div {
  max-width: 940px;
}

.works-section-head h2 {
  max-width: 920px;
  font-size: clamp(46px, 5vw, 72px);
  line-height: 0.98;
  text-wrap: balance;
}

.works-section-head > div > p {
  max-width: 720px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
}

.works-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.works-filters button {
  min-width: 0;
  min-height: 62px;
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.works-filters button:last-child {
  border-right: 0;
}

.works-filters button:hover,
.works-filters button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.case-studies {
  border-top: 1px solid var(--line);
}

.case-study {
  display: grid;
  min-height: 760px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(48px, 6vw, 104px);
  align-items: center;
  padding: 108px max(var(--page-pad), calc((100% - var(--content-width)) / 2 + var(--page-pad)));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.case-study:nth-child(even) {
  background: var(--paper-soft);
}

.case-study[hidden],
.event-card[hidden] {
  display: none;
}

.case-study.is-visible,
.event-card.is-visible {
  animation: work-item-reveal 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.case-study-reverse .case-copy {
  grid-column: 2;
}

.case-study-reverse .case-media {
  grid-row: 1;
  grid-column: 1;
}

.case-copy {
  max-width: 590px;
}

.case-number {
  margin-bottom: 28px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-copy h2 {
  max-width: 640px;
  font-size: clamp(48px, 5.3vw, 78px);
  line-height: 0.94;
  text-wrap: balance;
}

.case-lead {
  margin: 28px 0 22px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.42;
}

.case-copy > p:not(.case-number, .case-lead, .case-disclosure) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  list-style: none;
}

.case-tags li {
  padding: 9px 11px;
  border: 1px solid var(--line);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-media {
  min-width: 0;
  overflow: hidden;
}

.case-media > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.02);
  transition: filter 420ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.case-study:hover .case-media > img {
  filter: saturate(1);
  transform: scale(1.018);
}

.case-media-duo {
  display: grid;
  min-height: 570px;
  grid-template-columns: minmax(0, 1.6fr) minmax(150px, 0.7fr);
  gap: 8px;
}

.case-media-duo > img {
  height: 100%;
  aspect-ratio: auto;
}

.case-media-duo > img:last-child {
  object-position: center;
}

.case-study-technical {
  color: var(--paper);
  background: var(--ink) !important;
}

.case-study-technical .case-number,
.case-study-technical .case-copy > p:not(.case-number, .case-lead, .case-disclosure) {
  color: rgb(243 244 241 / 65%);
}

.case-study-technical .case-lead {
  color: var(--paper);
}

.case-disclosure {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  color: rgb(243 244 241 / 72%);
  font-size: 13px;
  line-height: 1.55;
}

.technical-map {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  background: #111315;
}

.technical-map::before {
  position: absolute;
  inset: 28px;
  border: 1px solid rgb(243 244 241 / 8%);
  content: "";
}

.technical-node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgb(243 244 241 / 46%);
  color: var(--paper);
  background: #111315;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 800;
}

.node-one { top: 12%; left: 10%; }
.node-two { top: 17%; right: 10%; }
.node-three { bottom: 12%; left: 16%; }
.node-four { right: 16%; bottom: 17%; }

.technical-line {
  position: absolute;
  z-index: 1;
  left: 23%;
  display: block;
  height: 1px;
  background: rgb(243 244 241 / 28%);
  transform-origin: left;
}

.line-one { top: 28%; width: 52%; transform: rotate(5deg); }
.line-two { top: 35%; width: 44%; transform: rotate(61deg); }
.line-three { top: 72%; width: 48%; transform: rotate(-8deg); }

.technical-pulse {
  position: absolute;
  z-index: 3;
  top: calc(28% - 3px);
  left: 23%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 18px rgb(243 244 241 / 70%);
  animation: technical-pulse 4.2s ease-in-out infinite;
}

.event-gallery {
  padding-top: 120px;
  padding-bottom: 120px;
}

.event-gallery-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
}

.event-card {
  display: grid;
  min-width: 0;
  grid-template-rows: 390px auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

.event-card figure {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.event-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: filter 360ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.event-card:hover img {
  filter: saturate(1);
  transform: scale(1.025);
}

.event-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 13px;
  color: rgb(243 244 241 / 82%);
  background: rgb(17 19 21 / 82%);
  font-size: 10px;
  line-height: 1.3;
}

.event-card figcaption a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.event-card > div {
  min-height: 210px;
  padding: 28px;
}

.event-card > div > span {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 800;
}

.event-card h3 {
  margin: 15px 0 12px;
  font-size: 30px;
  line-height: 1.05;
}

.event-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.works-contact {
  display: grid;
  min-height: 660px;
  align-content: center;
  justify-items: start;
  padding: 110px max(var(--page-pad), calc((100% - var(--content-width)) / 2 + var(--page-pad)));
  color: var(--paper);
  background: var(--ink);
}

.works-contact .kicker {
  color: rgb(243 244 241 / 58%);
}

.works-contact h2 {
  max-width: 980px;
  margin: 24px 0 22px;
  font-size: clamp(48px, 5.6vw, 78px);
  line-height: 0.98;
  text-wrap: balance;
}

.works-contact > p:not(.kicker) {
  max-width: 660px;
  margin-bottom: 36px;
  color: rgb(243 244 241 / 72%);
  font-size: 17px;
  line-height: 1.58;
}

@keyframes works-hero-settle {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1.025); }
}

@keyframes work-item-reveal {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes technical-pulse {
  0%, 12% { opacity: 0; transform: translate(0, 0); }
  28%, 64% { opacity: 1; }
  82%, 100% { opacity: 0; transform: translate(360px, 32px); }
}

@media (max-width: 1100px) {
  .case-study {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
    gap: 48px;
  }

  .case-media-duo {
    min-height: 500px;
    grid-template-columns: 1fr;
    grid-template-rows: 1.45fr 0.55fr;
  }

  .event-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .works-hero {
    min-height: 720px;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .works-section-head {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .case-study,
  .case-study-reverse {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 46px;
    padding-top: 84px;
    padding-bottom: 84px;
  }

  .case-study-reverse .case-copy,
  .case-study-reverse .case-media {
    grid-row: auto;
    grid-column: auto;
  }

  .case-study-reverse .case-media {
    order: 2;
  }

  .case-copy {
    max-width: 720px;
  }

  .case-media-duo {
    min-height: 540px;
    grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.55fr);
    grid-template-rows: 1fr;
  }

  .technical-map {
    min-height: 480px;
  }
}

@media (max-width: 760px) {
  .works-main {
    padding-top: var(--header-height);
  }

  .works-hero {
    min-height: 640px;
    padding: 106px 18px 48px;
  }

  .works-hero::before {
    background-image: url("/assets/portfolio/tiesiogine-transliacija-koncerto-kamera-640.webp");
    background-position: 60% center;
  }

  .works-hero h1 {
    font-size: 58px;
  }

  .works-hero-copy p {
    font-size: 16px;
  }

  .works-index,
  .event-gallery {
    width: 100%;
    padding: 72px 18px;
  }

  .works-section-head {
    margin-bottom: 34px;
  }

  .works-section-head h2 {
    font-size: 42px;
  }

  .works-section-head > div > p {
    font-size: 15px;
  }

  .works-filters {
    grid-template-columns: 1fr 1fr;
  }

  .works-filters button {
    min-height: 62px;
    border-bottom: 1px solid var(--line);
  }

  .works-filters button:nth-child(2) {
    border-right: 0;
  }

  .works-filters button:nth-child(n + 3) {
    border-bottom: 0;
  }

  .case-study,
  .case-study-reverse {
    gap: 34px;
    padding: 68px 18px;
  }

  .case-copy h2 {
    font-size: 44px;
  }

  .case-lead {
    margin-top: 22px;
    font-size: 18px;
  }

  .case-copy > p:not(.case-number, .case-lead, .case-disclosure) {
    font-size: 15px;
  }

  .case-media-duo {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .case-media-duo > img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .case-media-duo > img:last-child {
    aspect-ratio: 16 / 9;
  }

  .technical-map {
    min-height: 430px;
  }

  .technical-node {
    width: 86px;
    height: 86px;
    font-size: 9px;
  }

  .event-gallery-grid {
    grid-template-columns: 1fr;
  }

  .event-card:first-child {
    grid-column: auto;
  }

  .event-card {
    grid-template-rows: 310px auto;
  }

  .event-card-portrait {
    grid-template-rows: 430px auto;
  }

  .works-contact {
    min-height: 570px;
    padding: 76px 18px;
  }

  .works-contact h2 {
    font-size: 44px;
  }
}

@media (max-width: 420px) {
  .works-hero h1 {
    font-size: 50px;
  }

  .works-section-head h2,
  .case-copy h2,
  .works-contact h2 {
    font-size: 38px;
  }

  .works-filters button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .technical-node {
    width: 76px;
    height: 76px;
  }

  .event-card {
    grid-template-rows: 260px auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .works-hero::before,
  .case-study,
  .event-card,
  .case-media > img,
  .event-card img,
  .technical-pulse {
    animation: none;
    transition: none;
  }
}
