/* Mateusz portfolio — "the edit room".
   A cool studio cyclorama with the work laid out as a 3D timeline (js/stage.js).
   Colours borrow an NLE's vocabulary: cobalt video clips, green audio, an orange playhead. */

:root {
  --cyc: #d9dadc;        /* studio cove: page + 3D background */
  --cyc-2: #c9cbcf;      /* track bed, rules */
  --ink: #17181b;        /* text, screen bezels */
  --ink-2: #55585f;      /* secondary text */
  --cobalt: #2f5fd0;     /* video clips, links */
  --audio: #3e9b6b;      /* audio track */
  --playhead: #ff5a1f;   /* playhead, the one hot colour */

  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --tc: "Martian Mono", ui-monospace, monospace;   /* timecode only */
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--cyc); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.5;
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video, canvas { display: block; max-width: 100%; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--playhead); outline-offset: 3px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  background: var(--ink); color: var(--cyc);
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--cobalt); }
.btn::before {   /* play triangle */
  content: ""; border-left: 8px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--ghost::before { content: none; }
.btn--ghost:hover { background: var(--ink); color: var(--cyc); }

.chip {
  padding: 9px 14px; border-radius: 999px; font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.75);
}
.chip:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.chip.is-active { background: #fff; color: var(--ink); }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(217, 218, 220, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bar__name {
  font-weight: 700; font-size: 17px; text-decoration: none;
  font-variation-settings: "wdth" 85, "opsz" 24;
}
.bar__nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: 15px; }
.bar__nav a { text-decoration: none; display: none; }
.bar__nav a:hover { color: var(--cobalt); }
@media (min-width: 640px) { .bar__nav a { display: inline; } }
.bar__reel {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: var(--playhead); color: #fff; font-weight: 600;
}
.bar__reel span { font-family: var(--tc); font-size: 12px; opacity: 0.85; }

/* ==========================================================================
   THE EDIT — sticky stage, page height set in main.js from the program length
   ========================================================================== */
.edit { position: relative; height: 900svh; }
.edit__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.edit__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }

/* without WebGL the active clip's poster stands in for the 3D scene */
.edit__poster {
  position: absolute; left: 50%; top: 50%; translate: -50% -55%;
  height: 56svh; width: auto; border-radius: 14px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
}
.edit__poster:not([src]), .webgl .edit__poster { display: none; }

.intro {
  position: absolute; left: var(--gutter); top: clamp(76px, 13svh, 140px);
  max-width: min(760px, 92vw);
  transition: opacity 0.5s var(--ease), translate 0.6s var(--ease);
}
.intro.is-off { opacity: 0; translate: 0 -24px; pointer-events: none; }
.intro__title {
  font-size: clamp(44px, 7.4vw, 116px); line-height: 0.9; font-weight: 750;
  letter-spacing: -0.025em; font-variation-settings: "wdth" 78, "opsz" 96;
  text-wrap: balance;
}
.intro__lede { margin-top: 22px; max-width: 46ch; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 19px); }
.intro__hint {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 10px; font-weight: 600;
}
.intro__hint::before {
  content: ""; width: 2px; height: 22px; background: var(--playhead);
  animation: hint 1.6s var(--ease) infinite;
}
@keyframes hint { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
.intro__skip {
  display: inline-block; margin-top: 10px; margin-left: 12px; font-size: 15px; color: var(--ink-2);
  text-underline-offset: 3px;
}
.intro__skip:hover { color: var(--cobalt); }

.tc {
  position: absolute; right: var(--gutter); top: 64px;
  font-family: var(--tc); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.tc [data-tc] { color: var(--playhead); }
.tc__total { color: var(--ink-2); }

/* clip info: the panel an editor reads while scrubbing */
.clip {
  position: absolute; left: var(--gutter); bottom: 92px; width: min(400px, calc(100vw - 2 * var(--gutter)));
  padding: 20px 22px 22px; border-radius: 18px;
  background: rgba(242, 243, 244, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -30px rgba(23, 24, 27, 0.45);
  opacity: 0; translate: 0 12px; pointer-events: none;
  transition: opacity 0.35s var(--ease), translate 0.45s var(--ease);
}
.clip.is-on { opacity: 1; translate: none; pointer-events: auto; }
.clip__n { font-size: 14px; color: var(--ink-2); }
.clip__title {
  margin-top: 4px; font-size: clamp(28px, 3vw, 40px); line-height: 1; font-weight: 750;
  letter-spacing: -0.02em; font-variation-settings: "wdth" 82, "opsz" 72;
}
.clip__cat { margin-top: 8px; font-weight: 600; }
.clip__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.clip__badges li {
  font-size: 13px; padding: 3px 10px; border-radius: 6px;
  background: var(--cobalt); color: #fff;
}
.clip__badges li:nth-child(n + 2) { background: transparent; color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.clip__desc { margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.clip .btn { margin-top: 16px; }
@media (max-width: 639px) {
  .clip { bottom: 76px; padding: 16px 18px 18px; }
  .clip__desc { display: none; }
  .clip .btn { margin-top: 12px; padding: 11px 18px; }
}

/* mini timeline: every clip at its real length, click to jump */
.mini {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px; height: 40px;
}
.mini__track { position: absolute; inset: 0; border-radius: 8px; background: rgba(23, 24, 27, 0.08); }
.mini__track li { position: absolute; top: 6px; bottom: 6px; }
.mini__track button {
  width: 100%; height: 100%; border-radius: 5px; background: var(--cobalt); color: #fff;
  font-size: 12px; font-weight: 600; text-align: left; padding: 0 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0.55; transition: opacity 0.2s;
}
.mini__track button:hover, .mini__track button[aria-current] { opacity: 1; }
.mini__head {
  position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px;
  background: var(--playhead); pointer-events: none;
}
.mini__head::before {
  content: ""; position: absolute; left: -5px; top: -2px;
  border: 6px solid transparent; border-top: 7px solid var(--playhead);
}
@media (max-width: 639px) { .mini__track button { color: transparent; } }

/* ==========================================================================
   ALL WORK — the timeline's clips as a grid
   ========================================================================== */
.index { max-width: 1280px; margin: 0 auto; padding: clamp(80px, 10vw, 140px) var(--gutter) 0; }
.index__title {
  font-size: clamp(36px, 5vw, 72px); line-height: 0.95; font-weight: 750; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 80, "opsz" 96; margin-bottom: 28px;
}
.index__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
@media (min-width: 720px) { .index__grid { grid-template-columns: repeat(3, 1fr); gap: 36px 24px; } }
@media (min-width: 1100px) { .index__grid { grid-template-columns: repeat(4, 1fr); } }
.card { display: grid; gap: 4px; width: 100%; text-align: left; }
.card__frame {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 12px;
  background: var(--cyc-2); margin-bottom: 8px;
}
.card__frame img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.5s var(--ease); }
.card:hover .card__frame img { scale: 1.04; }
.card__ratio {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 6px;
  background: rgba(23, 24, 27, 0.72); color: #fff; font-family: var(--tc); font-size: 11px;
}
.card__title {
  font-size: 20px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em;
  font-variation-settings: "wdth" 85, "opsz" 32;
}
.card:hover .card__title { color: var(--cobalt); }
.card__cat { font-size: 14px; color: var(--ink-2); }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about {
  display: grid; gap: 48px; max-width: 1280px; margin: 0 auto;
  padding: clamp(96px, 14vw, 180px) var(--gutter) 0;
}
.about__title {
  font-size: clamp(36px, 5vw, 72px); line-height: 0.95; font-weight: 750; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 80, "opsz" 96; max-width: 14ch; margin-bottom: 28px;
}
.about__lead p { max-width: 52ch; font-size: clamp(17px, 1.5vw, 20px); }
.about__lead p + p { margin-top: 16px; }
.about__lead .about__note { color: var(--ink-2); font-size: 16px; }
.about__sub { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.services li { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--cyc-2); }
.services__title { font-weight: 650; }
.services__line { color: var(--ink-2); font-size: 15px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; margin-top: 32px; }
.facts dt { font-size: 14px; color: var(--ink-2); }
.facts dd { font-weight: 600; }
.cv { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
@media (min-width: 960px) {
  .about { grid-template-columns: 1.15fr 1fr; gap: 80px; align-items: start; }
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact {
  max-width: 1280px; margin: 0 auto;
  padding: clamp(110px, 16vw, 220px) var(--gutter) clamp(80px, 10vw, 140px);
  display: grid; justify-items: start; gap: 20px;
}
.contact__title {
  font-size: clamp(52px, 10.5vw, 176px); line-height: 0.86; font-weight: 780; letter-spacing: -0.03em;
  font-variation-settings: "wdth" 76, "opsz" 96;
}
.contact__mail {
  margin-top: 16px; font-size: clamp(22px, 3.4vw, 44px); font-weight: 600; text-decoration: none;
  background: linear-gradient(var(--playhead), var(--playhead)) 0 100% / 100% 3px no-repeat;
  padding-bottom: 4px; transition: color 0.2s;
}
.contact__mail:hover { color: var(--cobalt); }
.contact__wa { color: var(--ink-2); text-decoration: none; }
.contact__wa:hover { color: var(--cobalt); }

.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px var(--gutter) 30px; border-top: 1px solid var(--cyc-2);
  font-size: 14px; color: var(--ink-2);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ==========================================================================
   PLAYER — a dark screening room over the light studio
   ========================================================================== */
.player {
  position: fixed; inset: 0; z-index: 90; background: #0e0f11; color: #fff;
  display: grid; grid-template-rows: 1fr auto; gap: 18px;
  padding: 60px var(--gutter) 20px;
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.player[hidden] { display: none; }
.player.is-open { opacity: 1; }
.player__stage { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.player__frame { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; }
.player.is-wide .player__frame { height: auto; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; }
.player__video { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; background: #000; cursor: pointer; }
.player__progress {
  position: absolute; left: 0; right: 0; bottom: -10px; height: 3px; background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
.player__progress span { display: block; height: 100%; width: 0; background: var(--playhead); }
.player__info { display: grid; gap: 6px; align-content: end; }
.player__index { font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.player__title {
  font-size: 28px; font-weight: 750; line-height: 1; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 82, "opsz" 72;
}
.player__cat { font-weight: 600; }
.player .clip__badges li:nth-child(n + 2) { color: #9db8ff; box-shadow: inset 0 0 0 1px #9db8ff; }
.player__desc { display: none; color: rgba(255, 255, 255, 0.7); font-size: 15px; max-width: 38ch; margin-top: 6px; }
.player__variants { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.player__variants:empty { display: none; }
.player__controls { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.player__close {
  position: absolute; top: 16px; right: var(--gutter); padding: 8px 0; font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}
.player__close:hover { color: #fff; }
@media (min-width: 900px) {
  .player { grid-template-columns: 1fr 340px; grid-template-rows: 1fr; gap: 48px; padding: 64px var(--gutter) 48px; }
  .player__title { font-size: 44px; }
  .player__desc { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
