/* ============================================================
   BUDNIKOV FILMS — base system
   Cinematic / dark / atmospheric
   ============================================================ */

:root {
  /* color */
  --bg: #0a0908;
  --bg-1: #0e0c0b;
  --bg-2: #141110;
  --bg-3: #1b1715;
  --line: rgba(244, 240, 234, 0.10);
  --line-2: rgba(244, 240, 234, 0.18);
  --text: #f4f0ea;
  --text-dim: rgba(244, 240, 234, 0.62);
  --text-faint: rgba(244, 240, 234, 0.50);
  --accent: #e8c89a;
  --accent-2: #f3ddb6;

  /* type — single family, harmonized scale */
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --brandfont: "Cinzel", "Times New Roman", serif;   /* Trajan-style wordmark */
  --narrative: "Playfair Display", Georgia, serif;     /* large storytelling prose */
  --serif: var(--font);
  --credit: var(--font);
  --grotesk: var(--font);

  /* weights */
  --w-reg: 400;
  --w-med: 500;
  --w-semi: 600;

  /* uppercase-label tracking (one ladder, no ad-hoc values) */
  --track-label: 0.2em;   /* nav, buttons, links, footer, captions */
  --track-eyebrow: 0.26em; /* accent eyebrows — one notch wider */

  /* display tracking */
  --track-display: -0.02em;

  /* metrics */
  --shell: min(1480px, calc(100% - 64px));
  --gutter: clamp(24px, 5vw, 80px);
  --header-h: 92px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-2: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--grotesk);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
input, textarea, select { font: inherit; }
::selection { background: var(--accent); color: #14110c; }

.hidden { display: none !important; }
.shell { width: var(--shell); margin-inline: auto; }

/* ---------- atmospheric overlays ---------- */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.05;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.7) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 90% at 50% 38%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- shared type helpers ---------- */
.eyebrow {
  font-family: var(--font);
  font-weight: var(--w-med);
  font-size: clamp(0.66rem, 0.8vw, 0.78rem);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}
.eyebrow--plain::before { display: none; }

.display {
  font-family: var(--font);
  font-weight: var(--w-med);
  line-height: 0.94;
  letter-spacing: var(--track-display);
  margin: 0;
}

.lead {
  font-family: var(--font);
  font-weight: var(--w-reg);
  line-height: 1.18;
  letter-spacing: -0.005em;
}

/* ---------- buttons ---------- */
.btn {
  --pad: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 28px;
  font-family: var(--font);
  font-weight: var(--w-med);
  font-size: 0.8rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  transition: color 0.4s var(--ease), background 0.4s var(--ease),
    border-color 0.4s var(--ease), transform 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn .btn__arrow { transition: transform 0.4s var(--ease); }
.btn:hover { border-color: var(--accent); }
.btn:hover .btn__arrow { transform: translateX(5px); }
.btn--solid {
  background: var(--text);
  color: #14110c;
  border-color: var(--text);
  font-weight: var(--w-semi);
}
.btn--solid:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
/* link with sliding arrow */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font);
  font-weight: var(--w-med);
  font-size: 0.78rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text);
  padding-bottom: 6px;
  position: relative;
}
.arrow-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}
.arrow-link:hover::after { width: 100%; }
.arrow-link .arrow-link__icon {
  font-size: 1.5rem;
  line-height: 0;
  transition: transform 0.4s var(--ease);
}
.arrow-link:hover .arrow-link__icon { transform: translateX(6px); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  transition: background 0.5s var(--ease), backdrop-filter 0.5s var(--ease),
    border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom-color: var(--line);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding-inline: var(--gutter);
}
.brand { display: inline-flex; flex-direction: row; align-items: flex-start; gap: clamp(10px, 1vw, 16px); }
.brand-text { display: inline-flex; flex-direction: column; gap: 4px; }
.brand-mark { font-size: clamp(1.3rem, 2vw, 1.75rem); height: 0.72em; width: auto; opacity: 0.94; flex: none; margin-top: 0.375em; }
.brand-title {
  font-family: var(--brandfont);
  font-weight: 600;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  letter-spacing: 0.16em;
  color: var(--text);
  white-space: nowrap;
}
.brand-subtitle {
  font-family: var(--font);
  font-weight: var(--w-med);
  font-size: 0.72rem;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
}
.desktop-nav {
  display: flex;
  margin-left: auto;
  gap: clamp(28px, 3.5vw, 60px);
}
.desktop-nav a {
  position: relative;
  font-weight: var(--w-med);
  font-size: 0.74rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 0;
  transition: color 0.35s var(--ease);
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}
.desktop-nav a:hover,
.desktop-nav a.is-active { color: var(--text); }
.desktop-nav a:hover::after,
.desktop-nav a.is-active::after { width: 100%; }

.header-cta { display: inline-flex; align-items: center; gap: 22px; }
.header-mail {
  font-weight: var(--w-med);
  font-size: 0.74rem;
  letter-spacing: var(--track-label);
  color: var(--text-dim);
  transition: color 0.35s var(--ease);
}
.header-mail:hover { color: var(--accent); }

.menu-toggle {
  display: none;
  flex: none;
  width: 46px; height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 14px; right: 14px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 18px; }
.menu-toggle span:nth-child(2) { top: 23px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(8, 7, 6, 0.97);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(-12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
    visibility 0s linear 0.5s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0s;
}
.mobile-menu a {
  font-family: var(--font);
  font-weight: var(--w-med);
  font-size: clamp(2.4rem, 11vw, 4rem);
  line-height: 1.05;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.mobile-menu a .idx {
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: var(--track-label);
  color: var(--accent);
}
.mobile-menu a:last-of-type { border-bottom: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
  padding: clamp(48px, 6vw, 80px) 0 clamp(36px, 4vw, 52px);
}
.footer-brand .brand-title { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
.footer-tag {
  font-family: var(--font);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin: 12px 0 0;
  max-width: 22ch;
  color: var(--text-dim);
}
.footer-socials { display: flex; gap: 20px; margin-top: 22px; }
.footer-socials a {
  font-weight: var(--w-med);
  font-size: 0.72rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.35s var(--ease);
}
.footer-socials a:hover { color: var(--accent); }
.footer-contacts {
  display: grid;
  gap: 14px;
  text-align: right;
}
.footer-contacts h3 {
  font-family: var(--font);
  font-size: 0.64rem;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 4px;
  font-weight: var(--w-med);
}
.footer-contacts a, .footer-contacts p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.45;
  transition: color 0.35s var(--ease);
}
.footer-contacts a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; color: var(--text-faint); font-size: 0.76rem; letter-spacing: 0.06em; }
.footer-bottom .footer-socials { margin-top: 0; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; will-change: auto; }

.reveal-clip { overflow: hidden; }
.reveal-clip > * {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal-clip.in > * { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-clip > * { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   RESPONSIVE — header/footer
   ============================================================ */
@media (max-width: 1024px) {
  :root { --shell: calc(100% - 48px); }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-contacts { text-align: left; }
}
@media (max-width: 720px) {
  :root { --shell: calc(100% - 40px); --header-h: 76px; }
  .desktop-nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-contacts { text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   RESPONSIVE — short viewports (phone in landscape)
   4 menu items at clamp(2.4rem, 11vw, 4rem) need ~475px of height;
   a 375px-tall landscape phone centred them and clipped the ends.
   ============================================================ */
@media (max-height: 560px) {
  .mobile-menu {
    justify-content: flex-start;
    padding-top: calc(var(--header-h) + 8px);
    padding-bottom: 24px;
  }
  .mobile-menu a {
    font-size: clamp(1.4rem, 7vh, 2.2rem);
    padding: 10px 0;
  }
}

/* ---------- visible keyboard focus over the dark palette ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- narrow phones (<=400px) ----------
   "BUDNIKOV FILMS" is white-space: nowrap, so the brand cannot shrink and the
   hamburger — the only nav below 720px — absorbed the whole deficit. */
@media (max-width: 400px) {
  .topbar { padding-inline: 16px; gap: 12px; }
  .topbar .brand-title { font-size: 1.05rem; letter-spacing: 0.12em; }
  .topbar .brand-subtitle { font-size: 0.58rem; letter-spacing: 0.14em; }
}
