/*
Theme Name: Apostolski TV MP4 Player
Theme URI: https://apostolski.tv
Author: Angel Apostolski
Description: Custom portfolio theme for Angel Apostolski with editable content and MP4 video player support.
Version: 3.1.3
Requires at least: 6.0
Text Domain: apostolski-tv
*/

@font-face {
  font-family: "HK Nova";
  src: local("HK Nova Heavy"), url("assets/fonts/HKNova-Heavy.otf") format("opentype");
  font-display: swap;
  font-weight: 900;
}

:root {
  --bg: #090908;
  --ink: #f4ead8;
  --red: #f0523b;
  --lemon: #f4d21f;
  --muted: #b9aa91;
  --line: rgba(244, 234, 216, 0.16);
  --display: "HK Nova", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell,
.page {
  min-height: 100vh;
  padding: 24px 24px clamp(110px, 8vw, 160px);
  overflow-x: hidden;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project {
  position: relative;
  min-height: 34vw;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: #181512;
  isolation: isolate;
}

.project:nth-child(3n + 1) {
  grid-column: span 2;
  min-height: 48vw;
}

.project img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.06);
  transform: scale(1.01);
  transition: transform 600ms ease, filter 600ms ease;
}

.project:hover img {
  filter: saturate(1.08) contrast(1.1);
  transform: scale(1.055);
}

.project-info {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 36px);
  text-align: center;
  opacity: 0;
  transition: opacity 260ms ease;
}

.project:hover .project-info,
.project:focus-visible .project-info {
  opacity: 1;
}

.project-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}

.project-title svg {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 70%;
  overflow: visible;
  transform: translateY(-50%);
}

.project-title text {
  color: var(--lemon);
  fill: var(--lemon);
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -0.05em;
  line-height: 0.84;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 255, 0, 0.18);
  transform-box: fill-box;
  transform-origin: center;
}

.footer-nav {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0 28px;
  background: linear-gradient(0deg, rgba(9, 9, 8, 0.96), rgba(9, 9, 8, 0.64) 72%, rgba(9, 9, 8, 0));
}

.footer-nav a {
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 5.3rem);
  letter-spacing: -0.045em;
  line-height: 0.88;
  text-transform: lowercase;
  display: inline-block;
  transition: transform 160ms ease;
  transform-origin: center;
}

.footer-nav a:hover {
  transform: scale(1.06);
}

.footer-nav a:nth-child(2) {
  text-align: center;
}

.footer-nav a:nth-child(3) {
  text-align: right;
}

.about-page {
  --portrait-height: min(42vw, 560px);
  width: min(1320px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: clamp(42px, 7vw, 110px);
  align-items: start;
  padding: clamp(28px, 6vw, 82px) 0;
  border-bottom: 1px solid var(--line);
}

.portrait {
  display: grid;
  gap: 42px;
}

.about-page h1,
.contact-page h1 {
  margin: 0;
  color: var(--lemon);
  font-family: var(--display);
  font-size: clamp(5.4rem, 14vw, 14rem);
  letter-spacing: -0.06em;
  line-height: 0.82;
  text-transform: uppercase;
}

.contact-page h1 {
  font-size: clamp(5.4rem, 16vw, 16rem);
}

.portrait img {
  width: min(100%, 420px);
  height: var(--portrait-height);
  display: block;
  border-radius: 24px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.copy {
  display: grid;
  gap: clamp(8px, 1vw, 13px);
  max-width: 760px;
  min-height: var(--portrait-height);
  height: var(--portrait-height);
  align-content: space-between;
  margin-top: calc(clamp(5.4rem, 14vw, 14rem) * 0.82 + 42px);
}

.dek {
  display: block;
  margin: 0;
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(3rem, 5.2vw, 5.8rem);
  letter-spacing: -0.05em;
  line-height: 0.78;
  text-transform: uppercase;
}

.copy p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.18;
}

.copy strong {
  color: var(--lemon);
}

.contact-page {
  width: min(1320px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 6vw, 72px);
  align-items: start;
  padding: clamp(28px, 6vw, 82px) 0;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4.5vw, 58px) clamp(38px, 7vw, 96px);
  align-content: start;
  min-width: 0;
}

.label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.email {
  display: inline-block;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.05vw, 3.8rem);
  letter-spacing: -0.045em;
  line-height: 0.9;
  white-space: nowrap;
  transition: transform 160ms ease;
  transform-origin: left center;
}

.email:hover {
  transform: scale(1.045);
}

.rep-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rep-list a {
  display: inline-block;
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.7vw, 3.1rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-transform: lowercase;
  transition: transform 160ms ease;
  transform-origin: left center;
}

.rep-list a:hover {
  transform: scale(1.055);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--ink);
  overflow: hidden;
  padding: 0;
  transition: transform 160ms ease, background 160ms ease;
}

.social a:hover {
  background: var(--red);
  transform: scale(1.1);
}

.social img {
  display: none;
}

.social a::before {
  content: "";
  display: block;
  width: 27px;
  height: 27px;
  background: var(--bg);
  transition: background 160ms ease;
}

.social a:hover::before {
  background: var(--bg);
}

.social a[aria-label="Instagram"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4c0 3.2-2.6 5.8-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8C2 4.6 4.6 2 7.8 2Zm0 2C5.7 4 4 5.7 4 7.8v8.4C4 18.3 5.7 20 7.8 20h8.4c2.1 0 3.8-1.7 3.8-3.8V7.8C20 5.7 18.3 4 16.2 4H7.8Zm8.9 2.1a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4ZM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4c0 3.2-2.6 5.8-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8C2 4.6 4.6 2 7.8 2Zm0 2C5.7 4 4 5.7 4 7.8v8.4C4 18.3 5.7 20 7.8 20h8.4c2.1 0 3.8-1.7 3.8-3.8V7.8C20 5.7 18.3 4 16.2 4H7.8Zm8.9 2.1a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4ZM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.social a[aria-label="Vimeo"]::before {
  width: 30px;
  height: 30px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22.9 7.1c-.1 2.6-1.9 6.1-5.3 10.5-3.5 4.6-6.5 6.9-8.9 6.9-1.5 0-2.8-1.4-3.9-4.2L2.7 12.6C1.9 9.8 1 8.4.1 8.4c-.2 0-.8.4-1.9 1.1L-3 7.9c1.2-1 2.3-2.1 3.5-3.1C2.1 3.4 3.3 2.7 4.1 2.6c2-.2 3.2 1.2 3.7 4.1.5 3.2.9 5.2 1 5.9.6 2.7 1.3 4 2.1 4 .6 0 1.4-.9 2.5-2.7 1.1-1.8 1.7-3.2 1.8-4.1.2-1.6-.4-2.4-1.8-2.4-.6 0-1.3.1-2 .4 1.3-4.3 3.8-6.4 7.5-6.3 2.7.1 4 1.9 4 5.6Z' transform='translate(3 0)'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22.9 7.1c-.1 2.6-1.9 6.1-5.3 10.5-3.5 4.6-6.5 6.9-8.9 6.9-1.5 0-2.8-1.4-3.9-4.2L2.7 12.6C1.9 9.8 1 8.4.1 8.4c-.2 0-.8.4-1.9 1.1L-3 7.9c1.2-1 2.3-2.1 3.5-3.1C2.1 3.4 3.3 2.7 4.1 2.6c2-.2 3.2 1.2 3.7 4.1.5 3.2.9 5.2 1 5.9.6 2.7 1.3 4 2.1 4 .6 0 1.4-.9 2.5-2.7 1.1-1.8 1.7-3.2 1.8-4.1.2-1.6-.4-2.4-1.8-2.4-.6 0-1.3.1-2 .4 1.3-4.3 3.8-6.4 7.5-6.3 2.7.1 4 1.9 4 5.6Z' transform='translate(3 0)'/%3E%3C/svg%3E") center / contain no-repeat;
}

.video-body {
  overflow: hidden;
  user-select: none;
}

.video-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.video-wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

.player {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #151515;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.player iframe,
.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  object-fit: cover;
}

.player .plyr,
.player .plyr__video-wrapper {
  width: 100%;
  height: 100%;
  background: #000;
}

.player .plyr video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: auto;
}

.player .plyr__poster {
  background-size: cover;
}

.player .plyr--video {
  --plyr-color-main: #f0523b;
  --plyr-video-control-color: #fff;
  --plyr-video-control-color-hover: #fff;
  --plyr-video-controls-background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  --plyr-control-radius: 6px;
  --plyr-font-family: "Space Grotesk", Arial, sans-serif;
}

.player .plyr__control--overlaid {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  backdrop-filter: blur(8px);
}

.player .plyr__control--overlaid:hover,
.player .plyr__control--overlaid:focus-visible {
  background: rgba(0, 0, 0, 0.78);
}

.player .plyr__control--overlaid svg {
  transform: scale(1.24);
}

.player .plyr__controls {
  opacity: 0;
  transition: opacity 160ms ease;
}

.player:hover .plyr__controls,
.player .plyr--paused .plyr__controls,
.player .plyr--stopped .plyr__controls,
.player .plyr--settings-open .plyr__controls {
  opacity: 1;
}

.video-close-button {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, transform 120ms ease;
}

.player:hover .video-close-button,
.video-close-button:hover,
.video-close-button:focus-visible,
.video-close-button.is-visible {
  opacity: 1;
}

.video-close-button:hover {
  background: rgba(0, 0, 0, 0.76);
  transform: scale(1.04);
}

.video-close-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.sound-button {
  position: absolute;
  top: max(24px, calc((100vh - (100vw / 2.7)) / 2 + 24px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-grid;
  grid-template-columns: 26px auto;
  gap: 10px;
  align-items: center;
  min-height: 49px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  font: 700 16px/1 "Space Grotesk", Arial, sans-serif;
  text-transform: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 70ms ease, background 120ms ease;
}

.close-button {
  position: absolute;
  top: max(24px, calc((100vh - (100vw / 2.7)) / 2 + 24px));
  right: 24px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 70ms ease, background 120ms ease;
}

.sound-button.is-visible,
.sound-button:hover,
.sound-button:focus-visible,
.close-button.is-visible,
.close-button:hover,
.close-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.sound-button:hover,
.close-button:hover {
  background: rgba(0, 0, 0, 0.88);
}

.sound-button svg {
  width: 26px;
  height: 26px;
  display: block;
  fill: currentColor;
}

.close-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

@media (max-width: 820px) {
  .site-shell,
  .page {
    padding: 16px 14px clamp(92px, 24vw, 132px);
  }

  .work-grid,
  .details {
    grid-template-columns: 1fr;
  }

  .project,
  .project:nth-child(3n + 1) {
    grid-column: auto;
    min-height: 72vw;
    border-radius: 18px;
  }

  .project-info {
    opacity: 1;
  }

  .project:hover .project-title text,
  .project:focus-visible .project-title text {
    animation: none;
  }

  .about-page {
    --portrait-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .about-page h1,
  .contact-page h1 {
    font-size: clamp(5rem, 25vw, 8rem);
  }

  .portrait img {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .copy {
    height: auto;
    min-height: 0;
    margin-top: 0;
    align-content: start;
  }

  .dek {
    font-size: clamp(2.15rem, 10vw, 3rem);
    line-height: 0.82;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
  }

  .footer-nav {
    left: 14px;
    right: 14px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-nav a:nth-child(2),
  .footer-nav a:nth-child(3) {
    text-align: left;
  }

  .video-page {
    min-height: 100svh;
  }

  .video-wrap,
  .player {
    height: 100svh;
    background: #000;
  }

  .player iframe,
  .player video {
    inset: auto;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    transform: translate(-50%, -50%);
    object-fit: contain;
  }

  .player .plyr {
    position: absolute;
    inset: auto;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    transform: translate(-50%, -50%);
  }

  .player .plyr video {
    object-fit: contain;
  }

  .sound-button {
    top: calc((100svh - 56.25vw) / 2 + 18px);
    opacity: 1;
    pointer-events: auto;
  }

  .close-button {
    top: calc((100svh - 56.25vw) / 2 + 18px);
    right: 16px;
    opacity: 1;
    pointer-events: auto;
  }

  .video-close-button {
    top: calc((100svh - 56.25vw) / 2 + 12px);
    right: 12px;
    width: 34px;
    height: 34px;
    opacity: 0.84;
  }

  .player .plyr__control--overlaid {
    width: 48px;
    height: 48px;
  }

}

@media (max-width: 920px) and (orientation: landscape) {
  .video-page {
    min-height: 100svh;
  }

  .video-wrap,
  .player {
    height: 100svh;
  }

  .player iframe,
  .player video {
    inset: 0;
    width: 100vw;
    height: 100svh;
    transform: none;
    object-fit: cover;
  }

  .player .plyr {
    inset: 0;
    width: 100vw;
    height: 100svh;
    transform: none;
  }

  .sound-button,
  .close-button {
    top: 18px;
  }

  .video-close-button {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}
