:root {
  --red: #CE020F;
  --cream: #F7EFE4;
  --black: #000000;
  --grey: #c9c9c9;
  --nav-h: 76px;
  --pad-x: clamp(20px, 4vw, 64px);
  --radius: 16px;
  --ease-frame: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden; /* the site does not scroll — pages switch via the navbar */
  background: var(--black);
}

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em; /* 6% letter spacing everywhere */
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; letter-spacing: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  transition: clip-path 0.8s var(--ease-frame), visibility 0s 0.8s;
  clip-path: inset(0 0 0 0 round 0);
}
#splash.done { clip-path: inset(46% 38% 46% 38% round 60px); visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.splash-logo { width: clamp(140px, 22vw, 240px); }
.splash-logo .logo-text { font-family: "Inter", Arial, sans-serif; font-weight: 900; font-size: 110px; fill: var(--red); letter-spacing: 0.02em; }
.splash-logo .logo-dot { fill: var(--red); }
.splash-wordmark { color: var(--red); font-weight: 800; font-size: clamp(14px, 1.6vw, 20px); letter-spacing: 0.34em; }
.splash-dots { display: flex; gap: 10px; margin-top: 6px; }
.splash-dots span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--red);
  animation: dotPulse 1.1s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.18s; }
.splash-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotPulse { 0%, 100% { transform: scale(0.55); opacity: 0.35; } 50% { transform: scale(1); opacity: 1; } }

/* ---------- Navbar ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x);
}
.brand { display: flex; align-items: center; }
.brand-mark { width: 64px; height: auto; }
.brand-mark .logo-text { font-family: "Inter", Arial, sans-serif; font-weight: 900; font-size: 104px; fill: var(--red); }
.brand-mark .logo-dot { fill: var(--red); }

#nav-menu { display: flex; gap: clamp(18px, 3vw, 44px); }
#nav-menu a {
  position: relative;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  color: #fff; padding: 6px 2px;
  transition: color 0.25s;
}
#nav-menu a:hover { color: var(--red); }
#nav-menu a.active { color: var(--red); }
#nav-menu a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--red);
}

#nav-burger { display: none; flex-direction: column; gap: 6px; padding: 8px; }
#nav-burger span { width: 26px; height: 2px; background: #fff; transition: transform 0.3s, opacity 0.3s; }
#nav-burger.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
#nav-burger.open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Pages & frame-in transition ---------- */
#pages { position: relative; height: 100dvh; }
.page {
  position: absolute; inset: 0;
  height: 100dvh;
  padding-top: var(--nav-h);
  overflow: hidden;
}
.page[hidden] { display: none; }
.page-dark { background: var(--black); color: #fff; }
.page-light { background: var(--cream); color: var(--black); }

.page.frame-in { animation: frameIn 0.75s var(--ease-frame) both; }
@keyframes frameIn {
  from { clip-path: inset(10% 6% 10% 6% round 32px); opacity: 0; }
  to   { clip-path: inset(0 0 0 0 round 0);     opacity: 1; }
}
.page.frame-out { animation: frameOut 0.35s ease both; }
@keyframes frameOut {
  from { opacity: 1; }
  to   { opacity: 0; clip-path: inset(10% 6% 10% 6% round 32px); }
}

.page-scroll { height: 100%; overflow-y: auto; padding: 0 var(--pad-x) 40px; }

.heading-red { color: var(--red); font-size: clamp(28px, 4vw, 54px); font-weight: 800; letter-spacing: 0.06em; }
.heading-black { color: var(--black); font-size: clamp(28px, 4vw, 54px); font-weight: 800; letter-spacing: 0.06em; }

/* ---------- About ---------- */
.about-layout {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  padding-top: clamp(16px, 4vh, 48px);
  align-items: start;
}
.about-text p {
  margin-top: 18px;
  max-width: 62ch;
  color: var(--grey);
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.65;
}
.about-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.about-photos .photo {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: #111;
}
.about-photos img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); }

.clients-block { margin-top: clamp(28px, 6vh, 64px); padding-bottom: 24px; }
.clients-grid {
  margin-top: 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 28px;
}
.clients-grid li {
  color: #fff; font-weight: 700; font-size: clamp(11px, 1vw, 15px);
  padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Works grid (fits viewport, no page scroll on desktop) ---------- */
#page-works { display: flex; align-items: stretch; }
.works-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 24px);
  padding: 12px var(--pad-x) 28px;
  min-height: 0;
}
.work-card { display: flex; flex-direction: column; min-height: 0; text-align: left; }
.work-card .frame {
  position: relative; flex: 1; min-height: 0;
  border-radius: var(--radius); overflow: hidden; background: #101010;
  outline: 1px solid rgba(255, 255, 255, 0.08);
}
.work-card .frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease-frame), opacity 0.4s;
}
/* on hover the preview enlarges slightly */
.work-card:hover .frame img, .work-card:focus-visible .frame img { transform: scale(1.06); }
.work-card .frame .play-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
  background: rgba(0, 0, 0, 0.25);
}
.work-card .frame .play-badge svg {
  width: 54px; height: 54px; padding: 14px; border-radius: 50%;
  background: var(--red); fill: #fff;
}
.work-card:hover .play-badge, .work-card:focus-visible .play-badge { opacity: 1; }
.work-card .label { padding: 10px 4px 0; font-size: clamp(11px, 1vw, 14px); font-weight: 500; color: #fff; }
.work-card .label .client { color: var(--grey); }
.works-grid .work-card { animation: cardIn 0.6s var(--ease-frame) both; }
.works-grid .work-card:nth-child(2) { animation-delay: 0.06s; }
.works-grid .work-card:nth-child(3) { animation-delay: 0.12s; }
.works-grid .work-card:nth-child(4) { animation-delay: 0.18s; }
.works-grid .work-card:nth-child(5) { animation-delay: 0.24s; }
.works-grid .work-card:nth-child(n+6) { animation-delay: 0.3s; }
@keyframes cardIn {
  from { clip-path: inset(14% 10% 14% 10% round 28px); opacity: 0; transform: translateY(10px); }
  to   { clip-path: inset(0 0 0 0 round 0); opacity: 1; transform: none; }
}
.works-empty { position: absolute; inset: var(--nav-h) 0 0; display: flex; align-items: center; justify-content: center; color: var(--grey); }

/* ---------- Contacts ---------- */
.contacts-layout { padding-top: clamp(16px, 5vh, 56px); color: var(--black); }
.contacts-intro { margin-top: 16px; max-width: 56ch; line-height: 1.6; }
.contacts-cols {
  margin-top: clamp(24px, 5vh, 48px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px);
}
.contacts-people li { padding: 14px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.18); }
.contacts-people .name { font-weight: 600; } /* names are semi-bold */
.contacts-people .role { display: block; margin-top: 4px; font-size: 13px; opacity: 0.75; }
.contacts-people a { display: block; margin-top: 6px; font-size: 13px; color: var(--red); font-weight: 600; }
.contacts-office .label, .contacts-socials .label { font-size: 12px; font-weight: 700; color: var(--red); }
.contacts-office p { margin-top: 8px; line-height: 1.7; }
.contacts-socials li { margin-top: 10px; }
.contacts-socials a { font-weight: 600; border-bottom: 2px solid var(--red); }

/* ---------- Work detail ---------- */
.detail-layout {
  height: 100%;
  display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(20px, 3.5vw, 64px);
  padding: 12px var(--pad-x) 32px;
  align-items: center;
}
.back-btn { color: var(--red); font-weight: 700; font-size: 13px; padding: 8px 0; }
.back-btn:hover { text-decoration: underline; }
.detail-title { margin-top: 18px; font-size: clamp(26px, 3.4vw, 48px); line-height: 1.12; }
.detail-client { margin-top: 10px; font-weight: 600; color: var(--red); font-size: clamp(13px, 1.2vw, 17px); }
.detail-credits { margin-top: clamp(16px, 3vh, 32px); display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; font-size: clamp(11px, 0.95vw, 14px); }
.detail-credits dt { color: rgba(0, 0, 0, 0.55); }
.detail-credits dd { font-weight: 500; }

.detail-video { min-width: 0; }
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--black); border-radius: var(--radius); overflow: hidden;
}
.video-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play-btn {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease-frame);
}
.play-btn:hover { transform: scale(1.1); }
.play-btn svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
.video-frame.playing > img, .video-frame.playing .play-btn { display: none; }
.video-player, .video-player video, .video-player iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000;
}
.video-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; padding: 20px; text-align: center;
}
.video-fallback a { color: var(--red); font-weight: 700; border-bottom: 2px solid var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-layout { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; align-items: start; overflow-y: auto; }
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .contacts-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  #nav-burger { display: flex; }
  #nav-menu {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--black); border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
  }
  #nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  #nav-menu a { padding: 16px var(--pad-x); border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 15px; }
  /* on small screens pages may scroll internally — the no-scroll rule targets desktop */
  .page, .page-scroll { overflow-y: auto; }
  .works-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, auto); }
  .brand-mark { width: 48px; }
}
