/* ==========================================================================
   VIDEO EDITOR PORTFOLIO
   Colours, fonts and spacing are variables in :root. Change them there.
   ========================================================================== */

:root {
  /* colours */
  --bg: #131316;
  --surface: #1b1b1f;
  --surface-2: #25252b;
  --line: #2b2b32;
  --line-strong: #3c3c45;
  --text: #f3f1ee;
  --muted: #a2a2ab;
  --red: #e11d2e;          /* accent: fills, lines, buttons */
  --red-text: #ff5a68;     /* accent for text on dark background */

  /* type */
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* layout */
  --maxw: 1320px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --header-h: 4.5rem;
  --r: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, video, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
section[id] { scroll-margin-top: calc(var(--header-h) - 1px); }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.icon { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 100; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: var(--r); font-weight: 600; transition: top .2s; }
.skip:focus { top: 1rem; }
.noscript { padding: 8rem var(--gutter) 2rem; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  padding: .95rem 1.6rem; border-radius: 999px;
  font-size: 1rem; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--text); color: var(--bg); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); background: var(--surface); }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(19, 19, 22, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header__in { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; }
.brand__dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--red); }

.nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }
.nav a { position: relative; padding-block: .4rem; color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--text); }
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }

.menu-btn { display: none; position: relative; width: 2.75rem; height: 2.75rem; margin-right: -.6rem; }
.menu-btn span { position: absolute; left: .7rem; right: .7rem; height: 2px; background: currentColor; transition: transform .3s var(--ease), top .3s var(--ease); }
.menu-btn span:first-child { top: 1.1rem; }
.menu-btn span:last-child { top: 1.6rem; }
.menu-btn[aria-expanded="true"] span:first-child { top: 1.35rem; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 1.35rem; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45; background: var(--bg);
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu nav a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: clamp(2rem, 9vw, 3rem); font-weight: 700; font-stretch: 112%; letter-spacing: -.02em; line-height: 1.1; }
.mobile-menu__actions { display: flex; flex-direction: column; gap: .75rem; }
.mobile-menu__actions .btn { width: 100%; }

@media (max-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: block; }
}
@media (min-width: 761px) { .mobile-menu { display: none; } }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { min-height: 100svh; display: flex; flex-direction: column; padding-top: var(--header-h); }
.hero__main { flex: 1; display: flex; flex-direction: column; padding-block: clamp(1.5rem, 4vh, 3rem) clamp(1.75rem, 5vh, 3.5rem); }

.status { display: inline-flex; align-items: center; gap: .6rem; align-self: flex-start; margin-bottom: auto; color: var(--muted); font-size: .95rem; }
.status__dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--red); }

.hero__name {
  margin-top: 1rem;
  font-size: var(--name-size, clamp(3.5rem, min(24vw, 21svh), 16rem));
  font-weight: 800; font-stretch: 125%;
  letter-spacing: -.045em; line-height: .9;
}
.line { display: block; overflow: hidden; padding: .04em 0 .14em; margin: -.04em 0 -.14em; }
.line__in { display: inline-block; }

.hero__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: 1.5rem var(--gap); align-items: end; margin-top: clamp(1.25rem, 3vh, 2rem); }
.hero__role { font-size: clamp(2rem, 5.6vw, 4.75rem); font-weight: 300; font-stretch: 62%; line-height: 1; letter-spacing: -.01em; color: var(--muted); }
.hero__tag { color: var(--text); font-size: 1.05rem; max-width: 36ch; margin-bottom: 1.25rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 760px) {
  .hero__row { grid-template-columns: 1fr; }
}

/* ---------- timeline (decorative) ---------- */
.timeline { --track: clamp(1.4rem, 3.2vw, 2.25rem); }
.tl { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .75rem; padding-block: 1.25rem 1.75rem; border-top: 1px solid var(--line); touch-action: pan-y; }
.tl__labels, .tl__body { display: grid; grid-template-rows: 1.25rem repeat(3, var(--track)); gap: 6px; }
.tl__labels { color: var(--muted); font-size: .7rem; font-weight: 600; align-items: center; }
.tl__body { position: relative; --p: 0; cursor: col-resize; }
.tl__ruler {
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 10%) 0 100% / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 2%) 0 100% / 100% 45% no-repeat;
}
.tl__track { position: relative; }
.clip { position: absolute; top: 0; bottom: 0; left: var(--x); width: var(--w); background: var(--surface-2); border-radius: 3px; transform-origin: left; }
.clip--red { background: var(--red); }
.clip--audio { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.tl__playhead { position: absolute; top: 0; bottom: -6px; left: calc(var(--p) * 100%); width: 0; pointer-events: none; }
.tl__playhead::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--red); }
.tl__tc {
  position: absolute; top: 0; left: 0; height: 1.25rem; padding: 0 .45rem; border-radius: 3px;
  background: var(--red); color: #fff; font: 600 .68rem/1.25rem var(--mono); white-space: nowrap; letter-spacing: .02em;
}

/* ---------- hero entrance (one orchestrated moment) ---------- */
.js .line__in { transform: translateY(115%); }
.js [data-in] { opacity: 0; }
.js .clip { transform: scaleX(0); }
.js.is-ready .line__in { transform: none; transition: transform 1.05s var(--ease) calc(.1s + var(--i) * .1s); }
.js.is-ready [data-in] { opacity: 1; transition: opacity .9s var(--ease) calc(.5s + var(--d, 0) * .14s); }
.js.is-ready .clip { transform: none; transition: transform .9s var(--ease) calc(.8s + var(--k, 0) * 55ms); }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--ruled { border-top: 1px solid var(--line); }

.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 3rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; font-stretch: 112%; line-height: 1.08; letter-spacing: -.02em; }
.h2--xl { font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 800; font-stretch: 125%; letter-spacing: -.04em; line-height: .95; }
.lead { color: var(--muted); max-width: 38ch; }
.lead--small { margin-top: .6rem; font-size: .95rem; }

/* two-column pattern: sticky title on the left, content on the right */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 1.75rem; }
.split__head { grid-column: 1 / span 3; align-self: start; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.split__body { grid-column: 4 / -1; min-width: 0; }
@media (max-width: 900px) {
  .split__head { grid-column: 1 / -1; position: static; }
  .split__body { grid-column: 1 / -1; }
}

/* ---------- video cards ---------- */
.media { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r); }
.media--vertical { aspect-ratio: 9 / 16; }
.media--horizontal { aspect-ratio: 16 / 9; }
.media-el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
video.media-el { object-fit: contain; }

.poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.poster img, .poster video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); }
.poster img.is-loaded, .poster video.is-loaded { opacity: 1; }
.play {
  position: absolute; left: 50%; top: 50%; width: 4rem; height: 4rem; margin: -2rem 0 0 -2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(19, 19, 22, .6); border: 1px solid rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.play .icon { width: 1.5rem; height: 1.5rem; margin-left: .15rem; }
.poster:hover .play, .poster:focus-visible .play { background: var(--red); border-color: var(--red); transform: scale(1.08); }

.poster--empty {
  display: grid; place-content: center; justify-items: center; gap: .4rem; text-align: center;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: .9rem;
}
.poster__ratio { font: 600 .72rem var(--mono); padding: .1rem .5rem; border: 1px solid var(--line-strong); border-radius: 3px; }

.card { min-width: 0; }
.card__text { padding-top: .8rem; }
.card__title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.card__note { margin-top: .2rem; color: var(--muted); font-size: .9rem; }

/* featured */
.feat { display: grid; gap: clamp(1.75rem, 3.5vw, 3rem); }
.feat__h { display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 2.5vw, 2rem) var(--gap); }
.feat__h--multi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feat__v { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.25rem, 2.5vw, 2rem) var(--gap); }
.feat__v .card { flex: 0 1 min(380px, calc((100% - 2 * var(--gap)) / 3)); }
@media (max-width: 900px) {
  .feat__h--multi { grid-template-columns: 1fr; }
  .feat__v .card { flex-basis: calc((100% - var(--gap)) / 2); }
}

/* category grids: vertical = 3 per row, horizontal = 2 per row */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.25rem) var(--gap); align-items: start; }
.grid .card--vertical { grid-column: span 2; }
.grid .card--horizontal { grid-column: span 3; }
@media (max-width: 900px) {
  .grid .card--vertical { grid-column: span 3; }
  .grid .card--horizontal { grid-column: span 6; }
}

/* ---------- about ---------- */
.about__top { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.about__top.has-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); align-items: start; }
.about__lead { margin-bottom: 1.5rem; font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 700; font-stretch: 106%; line-height: 1.08; letter-spacing: -.025em; max-width: 20ch; }
.about__text { margin-bottom: 1rem; max-width: 62ch; color: #d6d4d0; }
.tools { margin-top: 1.5rem; color: var(--muted); font-size: .95rem; }
.tools__label { margin-right: .75rem; color: var(--text); font-weight: 600; }
.about__photo { margin: 0; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.principles { list-style: none; padding: 0; margin-top: clamp(2.25rem, 5vw, 3.75rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
.principles li { border-top: 1px solid var(--line); padding: 1.25rem 0 1.9rem; }
.principle__title { margin-bottom: .4rem; font-size: 1.1rem; font-weight: 600; }
.principles p { color: var(--muted); max-width: 44ch; }
@media (max-width: 760px) {
  .about__top.has-photo { grid-template-columns: 1fr; }
  .about__photo { max-width: 18rem; }
}
@media (max-width: 640px) { .principles { grid-template-columns: 1fr; } }

/* ---------- services ---------- */
.services { list-style: none; padding: 0; border-bottom: 1px solid var(--line); }
.service { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: .5rem var(--gap); padding: 1.6rem 0; border-top: 1px solid var(--line); }
.service:first-child { border-top: 0; }
.service::before { content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.service:hover::before { transform: scaleX(1); }
.service__title { font-size: clamp(1.2rem, 2.1vw, 1.65rem); font-weight: 600; font-stretch: 108%; line-height: 1.15; letter-spacing: -.015em; transition: color .25s; }
.service:hover .service__title { color: var(--red-text); }
.service__text { color: var(--muted); max-width: 46ch; }
@media (max-width: 640px) { .service { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact { padding-block: clamp(4rem, 10vw, 9rem); }
.contact__title { margin-bottom: 1.5rem; font-size: clamp(2.5rem, 8.5vw, 8rem); font-weight: 800; font-stretch: 125%; line-height: .93; letter-spacing: -.045em; }
.contact__text { max-width: 46ch; margin-bottom: 2rem; color: var(--muted); font-size: 1.1rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.contact__mail, .contact__social { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; color: var(--muted); }
.copy { color: var(--text); border-bottom: 1px solid var(--line-strong); padding-bottom: .05rem; transition: border-color .2s, color .2s; }
.copy:hover { border-color: var(--red); color: var(--red-text); }
.contact__social a { color: var(--text); border-bottom: 1px solid var(--line-strong); transition: border-color .2s, color .2s; }
.contact__social a:hover { border-color: var(--red); color: var(--red-text); }
@media (max-width: 520px) { .contact__actions .btn { width: 100%; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem; color: var(--muted); font-size: .9rem; }
.site-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a:hover { color: var(--text); }

/* ==========================================================================
   VIDEO WINDOW (lightbox)
   ========================================================================== */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(8, 8, 10, .92); }
.lightbox[open]::backdrop { animation: fade .25s var(--ease); }
.lightbox[open] .lightbox__inner { animation: pop .3s var(--ease); }
.lightbox__inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: 94vw; }
.lightbox__stage { position: relative; background: #000; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.lightbox__stage--horizontal { aspect-ratio: 16 / 9; width: min(94vw, 1200px, calc((100svh - 9rem) * 16 / 9)); }
.lightbox__stage--vertical { aspect-ratio: 9 / 16; height: min(calc(100svh - 9rem), 860px, calc(94vw * 16 / 9)); }
.lightbox__cap { text-align: center; max-width: 60ch; }
.lightbox__title { font-weight: 600; }
.lightbox__note { margin-top: .15rem; color: var(--muted); font-size: .9rem; }
.lightbox__close {
  position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.lightbox__close .icon { width: 1.2rem; height: 1.2rem; }
.lightbox__close:hover { background: var(--red); border-color: var(--red); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .line__in, .js .clip { transform: none !important; }
  .js [data-in] { opacity: 1 !important; }
}
