@font-face {
  font-family: 'Mosvita';
  src: url('/fonts/mosvita-black-expanded.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('/fonts/roboto-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('/fonts/roboto-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --accent: #B6FF2E;  /* lime: buttons, menu highlights, titles */
  --dark: #0A0B0D;    /* every dark surface */
  --line: #17191D;    /* hairlines between sections, a step lighter than --dark so they stay visible */
  --white: #ffffff;
  --nav-h: 5.5rem;    /* height of the sticky top nav; subtracted from scroll targets in main.js */
  --title-font: 'Mosvita', 'Arial Black', Impact, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--dark);
  color: var(--white);
  font: 400 1rem/1.6 'Roboto', system-ui, sans-serif;
}
img, video { display: block; max-width: 100%; }
/* Locks background scroll while the mobile nav drawer is open. */
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons: lime pills, dark title font ---------- */
.btn {
  display: block;
  padding: 0.85em 1.4em;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--dark);
  font: 900 0.8rem/1 var(--title-font);
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn:hover { transform: scale(1.04); }
.btn__label { display: inline; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

/* ---------- Horizontal navigation: sticky, logo left, menu + socials right ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  background: var(--dark);
}
.nav__logo { display: inline-flex; flex: none; }
.nav__logo img { width: 3.5rem; height: auto; transition: filter 0.2s ease; }
.nav__logo:hover img, .nav__logo:focus-visible img { filter: brightness(0) invert(1); } /* lime → white */
/* On desktop the menu wrapper is invisible to layout: .nav__links and .nav__social
   stay direct flex children of .nav, exactly as if the wrapper weren't there. The
   mobile breakpoint below turns it into the actual hamburger dropdown panel. */
.nav__menu { display: contents; }
.nav__toggle { display: none; }
.nav__links {
  list-style: none;
  margin: 0 0 0 auto; /* pushes the links (and the socials after them) to the right */
  padding: 0;
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.nav__links a {
  display: inline-block;
  color: var(--white);
  font: 900 1.3rem/1 var(--title-font);
  text-transform: uppercase;
  transition: color 0.15s ease;
  transform: translateY(0.085em); /* the font's built-in leading sits below the caps, not above; this re-centres the ink on the nav */
}
.nav__links a:hover, .nav__links a.is-active { color: var(--accent); }

/* Icon-only circles: the same contact-buttons partial as the Fly-with-me section,
   with its text label hidden (aria-label on the link keeps it announced). */
.nav__social { display: flex; flex: none; gap: 0.6rem; }
.nav__social .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}
.nav__social .icon { width: 0.95rem; height: 0.95rem; }
.nav__social .btn__label { display: none; }

/* ---------- Page ---------- */
/* Full-width landing video; its centre is the centre of the screen. */
.hero { position: relative; height: 55vh; height: 55svh; min-height: 24rem; }
.hero::after { content: ''; position: absolute; inset: 0; background: rgba(10, 11, 13, 0.45); pointer-events: none; } /* keeps the logo readable on bright footage */
.hero__video { width: 100%; height: 100%; object-fit: cover; object-position: center; background: var(--dark); pointer-events: none; }
.hero__video--empty { background: var(--dark); }

/* Logo, tagline and button: dead centre of the video (= centre of the area beside the nav). */
.hero__content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  --hero-gap: clamp(1.25rem, 2.2vw, 2rem); /* the one gap used above and below the tagline */
  padding: 1rem;
  text-align: center;
}
.hero__logo { margin: 0 0 var(--hero-gap); width: min(78%, 46rem); line-height: 0; }
.hero__logo img { width: 100%; height: auto; }
/* The negative block margins (in em) cancel the font's built-in space above the capitals and below the
   baseline, so the visible gap to the logo and to the button is exactly --hero-gap on both sides. */
.hero__tagline {
  margin: -0.229em 0 -0.338em;
  color: var(--white);
  font: 900 clamp(0.9rem, 1.7vw, 1.6rem)/1.3 var(--title-font);
  text-transform: uppercase;
}
.btn--lg { display: inline-flex; align-items: center; gap: 0.6em; margin-top: var(--hero-gap); padding: 1.1em 2.2em; font-size: clamp(0.8rem, 1.1vw, 1rem); }
.btn--lg .icon { width: 0.9em; height: 0.9em; }

/* ---------- Portfolio: single column, centred ---------- */
.work {
  /* The same value sits between the hero and the first tile (top padding) and between
     one tile's title and the next tile (the flex gap) — see the title comment below. */
  --item-gap: clamp(2.5rem, 6vw, 4.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--item-gap);
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--item-gap) clamp(1.5rem, 5vw, 4.5rem) clamp(3rem, 7vw, 6rem);
}
.tile { display: block; width: 100%; }
/* Wider than the 16:9 source (~15% shorter at the same width) for an ultra-widescreen crop at
   rest; object-fit: cover below trims the top and bottom of the thumbnail/preview to fit. On
   hover/focus the frame opens up to the video's full native 16:9 — the surrounding layout
   reflows smoothly as it grows. */
.tile__media { position: relative; display: block; aspect-ratio: 2.1 / 1; overflow: hidden; border-radius: 5px; background: var(--dark); transition: aspect-ratio 0.4s ease; }
.tile:hover .tile__media, .tile:focus-visible .tile__media { aspect-ratio: 16 / 9; }
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.tile:hover .tile__media img, .tile:focus-visible .tile__media img { transform: scale(1.03); }

/* Hover preview: the muted video fades in over the thumbnail once it is actually playing, at
   its true, uncropped 16:9 — no zoom, so the full frame really is the full frame. It also
   ignores the mouse so YouTube never shows its own hover controls. */
.tile__preview { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
.tile__preview.is-playing { opacity: 1; }
.tile__preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Play button: lime circle, dark arrow, dead centre, always on. Turns white on hover. */
.tile__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 4em;
  height: 4em;
  border-radius: 50%;
  background: var(--accent);
  font-size: clamp(0.9rem, 1.6vw, 1.3rem);
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.tile__play::before {
  content: '';
  margin-left: 0.25em; /* optical centre: a triangle looks off-centre when it is mathematically centred */
  border-style: solid;
  border-width: 0.7em 0 0.7em 1.15em;
  border-color: transparent transparent transparent var(--dark);
}
.tile:hover .tile__play, .tile:focus-visible .tile__play { background: var(--white); transform: translate(-50%, -50%) scale(1.08); }

/* Title: underneath the video (not on top of it), as a lime pill — same max-rounded
   treatment the title had in the two-column design, just moved out of the thumbnail. */
.tile__title {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.3rem auto 0;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--dark);
  font: 900 clamp(0.8rem, 1.1vw, 1rem)/1.2 var(--title-font);
  text-align: center;
  text-transform: uppercase;
}

/* ---------- Text sections (fly with me, about) ---------- */
.section { padding: clamp(4rem, 9vw, 8rem) clamp(1.5rem, 5vw, 4.5rem); border-top: 1px solid var(--line); }
.section__inner { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; max-width: 80rem; margin: 0 auto; }
.section__inner--image { grid-template-columns: 1.1fr 1fr; }
/* No image column (fly-with-me, about): a single centred text block instead of left-aligned. */
.section__inner:not(.section__inner--image) { text-align: center; }
.section__title { margin: 0 0 1.75rem; color: var(--accent); font: 900 clamp(2rem, 4vw, 3.5rem)/1.05 var(--title-font); text-transform: uppercase; }
.section__text p { margin: 0 0 1.15rem; max-width: 60ch; color: #d6d6d6; font: 400 clamp(1rem, 1.25vw, 1.2rem)/1.75 'Roboto', system-ui, sans-serif; white-space: pre-line; }
.section__inner:not(.section__inner--image) .section__text p { margin-inline: auto; }
.section__text p:last-child { margin-bottom: 0; }
.section__image img { width: 100%; height: auto; }
.section__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.section__inner:not(.section__inner--image) .section__actions { justify-content: center; }
.section__actions .btn { display: inline-flex; align-items: center; gap: 0.65em; padding: 1.1em 1.8em; font-size: 0.85rem; }
.section__text .section__details { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin: 1.5rem 0 0; }
.section__inner:not(.section__inner--image) .section__details { justify-content: center; }
.section__details a { color: #d6d6d6; transition: color 0.15s ease; }
.section__details a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: 4rem clamp(1.5rem, 4vw, 3.5rem) 1.5rem; border-top: 1px solid var(--line); background: var(--dark); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
.footer__brand img { width: min(100%, 16rem); height: auto; }
.footer__brand p { margin: 1rem 0 0; max-width: 24rem; color: #9a9a9a; }
.footer__title { margin: 0 0 1.1rem; color: var(--accent); font: 900 0.85rem/1.2 var(--title-font); text-transform: uppercase; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.footer nav a { font: 900 1rem/1.2 var(--title-font); text-transform: uppercase; }
.footer a { transition: color 0.15s ease; }
.footer a:hover { color: var(--accent); }
.footer__contact a { display: inline-flex; align-items: center; gap: 0.7em; color: #d6d6d6; }
.footer__contact a:hover { color: var(--accent); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: #9a9ea8; font-size: 0.875rem;
}

/* ---------- Text pages (privacy) ---------- */
.legal { max-width: 46rem; padding: 4rem clamp(1.5rem, 4vw, 3.5rem) 5rem; }
.legal h1 { margin: 0 0 1.5rem; color: var(--accent); font: 900 clamp(2rem, 4vw, 3rem)/1.1 var(--title-font); text-transform: uppercase; }
.legal h2 { margin: 2.25rem 0 0.5rem; font: 900 1rem/1.3 var(--title-font); text-transform: uppercase; }
.legal p { margin: 0 0 1rem; color: #cfcfcf; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Video lightbox ---------- */
.player {
  width: min(94vw, 1280px);
  padding: 0;
  border: 0;
  background: var(--dark);
  color: var(--white);
  overflow: visible;
}
.player::backdrop { background: rgba(10, 11, 13, 0.95); }
.player__close { position: absolute; right: 0; bottom: 100%; margin-bottom: 0.75rem; }
.player__frame { aspect-ratio: 16 / 9; background: var(--dark); }
.player__frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- 404 ---------- */
.notfound main { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; }
.notfound h1 { margin: 0; color: var(--accent); font: 900 clamp(4rem, 15vw, 9rem)/1 var(--title-font); }

/* ---------- Mobile: nav wraps to two rows (logo + socials, then the menu) ---------- */
@media (max-width: 800px) {
  .nav { padding: 0.75rem 1rem; }
  .nav__toggle {
    position: relative;
    z-index: 1; /* stays above the drawer's own background once it slides in */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .nav__toggle-bar {
    display: block;
    width: 1.7rem;
    height: 3px;
    background: var(--white);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  /* Drawer pinned to the right edge, full height, off-screen until .nav.is-open
     (toggled in main.js) slides it in — links on top, the four social buttons
     underneath the last one. */
  .nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 17rem;
    max-width: 80vw;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 6rem 1.5rem 2rem;
    background: var(--dark);
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .nav.is-open .nav__menu { transform: translateX(0); }
  .nav__links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0;
  }
  .nav__social { justify-content: center; }
  .tile__title { font-size: 0.64rem; margin-top: 1.1rem; } /* 20% smaller than the 0.8rem floor it clamps to on mobile; slightly tighter gap under the tile */
  /* Hero-to-first-tile gap matches the left/right screen padding exactly, instead of the wider --item-gap used between .work's padding-top on desktop. */
  .work { padding-top: clamp(1.5rem, 5vw, 4.5rem); }
  .hero { height: 62vh; height: 62svh; }
  .hero__content { --hero-gap: 0.75rem; }
  .btn--lg { padding: 0.85em 1.6em; }
  .section__inner--image { grid-template-columns: 1fr; }
  .footer { padding-top: 3rem; }
  .footer__grid { grid-template-columns: 1fr; gap: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tile__media, .tile__media img, .tile__play, .tile__preview, .btn, .nav__logo img, .nav__menu, .nav__toggle-bar { transition: none; }
}
