/* Lukas Masak — portfolio */
:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #6d6d6d;
  --soft: #f3f2ee;
  --gutter: clamp(16px, 3vw, 40px);
  --radius: 10px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --line-soft: #d4d4d4;
  --on-ink: #ffffff;
  --footer-bg: #0b0b0b;
  --footer-ink: #ffffff;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --ink: #f0eee8;
  --muted: #9b9b9b;
  --soft: #1a1a1a;
  --nav-bg: rgba(13, 13, 13, 0.85);
  --line-soft: #2e2e2e;
  --on-ink: #0d0d0d;
  --footer-bg: #000000;
  --footer-ink: #f0eee8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
p { margin: 0 0 1em; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--ink);
}
.nav__brand { font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.03em; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { text-decoration: none; font-size: 15px; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav__links a:hover::after, .nav__links a[aria-current]::after { transform: scaleX(1); }
.theme-toggle {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1.5px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
  transition: transform .3s ease;
}
.theme-toggle:hover { transform: rotate(180deg); }

/* ---------- buttons, tags ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--bg); text-decoration: none; font-weight: 500; font-size: 15px;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn--dark { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn--dark:hover { background: var(--bg); color: var(--ink); box-shadow: none; transform: none; }

.tag {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 4px 11px; border: 1.5px solid var(--ink); border-radius: 7px;
  background: var(--bg); font-size: 14px; font-weight: 500; line-height: 1.3;
  box-shadow: 3px 3px 0 var(--ink);
}

.label, .h-label {
  font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: lowercase; color: var(--muted);
}
.h-label { margin-bottom: 20px; }
.link { font-weight: 500; text-decoration: none; border-bottom: 1.5px solid; }
.lead { font-size: clamp(21px, 2.2vw, 30px); line-height: 1.25; letter-spacing: -0.02em; font-weight: 500; }

.mega {
  font-size: clamp(54px, 10.5vw, 168px);
  line-height: 1.02; letter-spacing: -0.055em; font-weight: 800;
}

/* ---------- hero: floating project reel ---------- */
.reel {
  position: relative; overflow: hidden;
  height: min(calc(100svh - 58px), 1040px); min-height: 520px;
  background: var(--bg); border-bottom: 1.5px solid var(--ink);
}
.reel__field { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gutter); padding: var(--gutter); overflow: hidden; }
.js .reel__field { display: block; padding: 0; }
.reel__tile { display: block; text-decoration: none; }
.reel__tile--big { width: clamp(300px, 44vw, 820px); }
.reel__tile--mid { width: clamp(220px, 30vw, 520px); }
.reel__tile--small { width: clamp(150px, 18vw, 320px); }
.js .reel__tile { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform; transition: opacity .8s ease; }
.js .reel.is-ready .reel__tile { opacity: 1; }
.reel__tile img { width: 100%; height: auto; border-radius: 6px; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.reel__tile:hover img { transform: scale(1.03); }
.reel__cap {
  position: absolute; left: 10px; bottom: 10px; z-index: 1; max-width: calc(100% - 20px);
  padding: 4px 10px; border: 1.5px solid var(--ink); border-radius: 7px; background: var(--bg); color: var(--ink);
  font-size: 13px; line-height: 1.3; box-shadow: 3px 3px 0 var(--ink);
  opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease;
}
.reel__cap b { font-weight: 700; }
.reel__tile:hover .reel__cap, .reel__tile:focus-visible .reel__cap { opacity: 1; transform: none; }
.reel__name {
  position: absolute; left: var(--gutter); bottom: clamp(8px, 2vw, 24px); z-index: 2; margin: 0;
  font-size: clamp(64px, 15.5vw, 280px); font-weight: 800; letter-spacing: -0.06em; line-height: .9;
  color: #ffffff; mix-blend-mode: difference; pointer-events: none; white-space: nowrap;
}
.reel__logo { position: absolute; top: var(--gutter); right: var(--gutter); z-index: 3; width: clamp(150px, 17vw, 260px); }
.reel__more {
  position: absolute; right: var(--gutter); bottom: calc(clamp(8px, 2vw, 24px) + 1.6vw); z-index: 3;
  padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--bg);
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.reel__more:hover { background: var(--ink); color: var(--on-ink); }
.reel > *, .intro > *, .about > *, .project__body > *, .grid > *, .featured > * { min-width: 0; }
.logo-block {
  display: block;
  background: #0e0e0e; border: 1.5px solid var(--ink); border-radius: 18px;
  overflow: hidden;
}
.logo-block img { width: 100%; height: auto; mix-blend-mode: normal; }
a.logo-block { display: block; transition: transform .2s ease, box-shadow .2s ease; }
a.logo-block:hover { transform: translate(-2px, -2px) rotate(-2deg); }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 8vw, 120px) var(--gutter) 0; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }

/* ---------- cards ---------- */
.featured { display: grid; grid-template-columns: 1fr 1fr; gap: 56px var(--gutter); }
.card { display: block; text-decoration: none; }
.card--big { grid-column: 1 / -1; }
.cover {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 3; background: var(--soft);
}
.card--big .cover { aspect-ratio: 16 / 8; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card:hover .cover img, .card:hover .cover__title { transform: scale(1.04); }
.card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.card__meta h3 { font-size: clamp(24px, 2.6vw, 38px); }
.card__sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* typographic covers for projects without an image */
.cover--type { display: flex; align-items: flex-end; padding: clamp(16px, 2.5vw, 28px); }
.cover__title {
  font-weight: 800; letter-spacing: -0.05em; line-height: 1;
  font-size: clamp(36px, 5.5vw, 84px); transform-origin: left bottom;
  transition: transform .6s cubic-bezier(.2,.7,.2,1); overflow-wrap: anywhere;
}
.cover__year { position: absolute; top: clamp(14px, 2vw, 22px); right: clamp(16px, 2.5vw, 28px); font-weight: 500; font-size: 15px; }
.cover--type { background: var(--soft); color: var(--ink); }
.cover--type::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(currentColor 1px, transparent 1.2px); background-size: 14px 14px;
}

/* ---------- category tiles ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1.5px;
  background: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden;
}
.cat-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 260px;
  padding: 24px; text-decoration: none; background: var(--bg);
  transition: background .25s ease, color .25s ease;
}
.cat-tile__count { font-size: 15px; font-weight: 500; }
.cat-tile__name { margin-top: auto; font-size: clamp(28px, 2.8vw, 42px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.cat-tile__desc { color: var(--muted); font-size: 15px; line-height: 1.35; transition: color .25s ease; }
.cat-tile__arrow { position: absolute; top: 20px; right: 24px; font-size: 22px; transition: transform .25s ease; }
.cat-tile:hover .cat-tile__arrow { transform: translateX(4px) rotate(-45deg); }
.cat-tile:hover { background: var(--ink); color: var(--bg); }
.cat-tile:hover .cat-tile__desc { color: inherit; }

/* ---------- intro ---------- */
.intro { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.intro__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }

/* ---------- page heads ---------- */
.page-head { padding: clamp(48px, 7vw, 100px) var(--gutter) clamp(24px, 4vw, 48px); }
.page-head__lead { max-width: 820px; margin-top: 32px; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; }

/* ---------- work ---------- */
.filters {
  position: sticky; top: 57px; z-index: 40;
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  padding: 14px var(--gutter); background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--bg); color: var(--ink);
}
.chip sup { font-size: 11px; color: var(--muted); }
.chip.is-active { background: var(--ink); color: var(--on-ink); }
.chip.is-active sup { color: var(--muted); }
.work-cat { padding: clamp(48px, 6vw, 88px) var(--gutter) 0; scroll-margin-top: 120px; }
.work-cat[hidden] { display: none; }
.work-cat__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 28px; border-bottom: 1.5px solid var(--ink); }
.work-cat__head h2 { font-size: clamp(36px, 5vw, 72px); }
.work-cat__head p { margin: 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 44px var(--gutter); }
.grid .cover__title { font-size: clamp(34px, 4vw, 56px); }
.grid .cover__title--long { font-size: clamp(28px, 3vw, 42px); }
.grid .tag { display: none; }

/* ---------- project detail ---------- */
.project { padding: 28px var(--gutter) 0; }
.back { display: inline-block; text-decoration: none; font-weight: 500; margin-bottom: clamp(28px, 5vw, 64px); }
.back:hover { text-decoration: underline; }
.project__head { margin-bottom: clamp(28px, 4vw, 48px); }
.project__head .tag { margin-bottom: 22px; }
.project__head .mega { overflow-wrap: anywhere; }
.project__cover { aspect-ratio: 16 / 8; }
.project__cover.cover--type .cover__title { font-size: clamp(56px, 11vw, 180px); }
.project__body { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(28px, 5vw, 80px); padding-top: clamp(32px, 5vw, 64px); }
.meta { margin: 0; display: grid; gap: 18px; align-content: start; position: sticky; top: 90px; }
.meta div { border-top: 1.5px solid var(--ink); padding-top: 10px; }
.meta dt { font-size: 14px; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 500; font-size: 18px; }
.prose { max-width: 760px; font-size: clamp(17px, 1.3vw, 19px); }
.prose p:first-child { font-size: clamp(21px, 2vw, 28px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 500; }
.prose a { font-weight: 500; text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.next {
  display: block; margin: clamp(64px, 9vw, 140px) var(--gutter) 0; padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1.5px solid var(--ink); text-decoration: none;
}
.next__title { display: block; margin-top: 8px; font-size: clamp(40px, 7vw, 110px); font-weight: 800; letter-spacing: -0.05em; line-height: 1.05; transition: transform .3s ease; }
.next:hover .next__title { transform: translateX(12px); }

.project__lead { margin: 0; background: var(--soft); border-radius: var(--radius); overflow: hidden; }
.project__lead img { width: 100%; height: auto; max-height: 90vh; object-fit: cover; }
.project__videos { display: grid; gap: var(--gutter); margin-top: clamp(48px, 6vw, 96px); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery { columns: 2; column-gap: var(--gutter); margin-top: clamp(48px, 6vw, 96px); }
.gallery__item { display: block; break-inside: avoid; margin-bottom: var(--gutter); border-radius: var(--radius); overflow: hidden; background: var(--soft); cursor: zoom-in; }
.gallery__item img { width: 100%; height: auto; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.gallery__item:hover img { transform: scale(1.02); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(8, 8, 8, .94); padding: 56px 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; border: 0; background: none; color: #fff; font: inherit; font-size: 32px; line-height: 1; padding: 12px 16px; cursor: pointer; }
.lightbox__close { top: 8px; right: 8px; }
.lightbox__prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 4px; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #aaa; font-size: 14px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); padding: 0 var(--gutter); }
.about__imgs { display: grid; gap: var(--gutter); align-content: start; }
.about__imgs img { width: 100%; border-radius: var(--radius); object-fit: cover; }
.about__imgs img:first-child { aspect-ratio: 4 / 5; }
.about__imgs img:last-child { aspect-ratio: 3 / 4; }
.about__text { max-width: 820px; }
.about__text .h-label { margin-top: 56px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.list li { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-weight: 500; }
.list li > span:last-child { color: var(--muted); font-weight: 400; white-space: nowrap; }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.footer { margin-top: clamp(80px, 10vw, 160px); padding: clamp(40px, 6vw, 80px) var(--gutter) 28px; background: var(--footer-bg); color: var(--footer-ink); border-top: 1.5px solid var(--ink); }
.footer__big a { font-size: clamp(48px, 10vw, 160px); font-weight: 800; letter-spacing: -0.055em; line-height: 1.02; text-decoration: none; transition: color .2s ease; }
.footer__big a:hover { color: #8a8a8a; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: clamp(40px, 6vw, 80px); padding-top: 24px; border-top: 1.5px solid #333; }
.footer__cols .label { color: #8a8a8a; margin-bottom: 8px; }
.footer__cols a { text-decoration: none; }
.footer__cols a:hover { text-decoration: underline; }
.footer__legal { margin: 48px 0 0; color: #8a8a8a; font-size: 14px; }

/* ---------- reveal on scroll (only when JS runs) ---------- */
/* "landing": drop in from below, tilted, and settle with a small overshoot */
.js .reveal {
  opacity: 0;
  transform: translateY(80px) rotate(var(--tilt, 1deg)) scale(.97);
  transform-origin: 50% 100%;
  transition: opacity .5s ease var(--d, 0ms), transform 1.05s cubic-bezier(.2, 1.35, .45, 1) var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }
/* the photo inside settles a moment later, from slightly zoomed in */
.js .reveal .cover img, .js .reveal.project__lead img, .js .reveal.gallery__item img, .js img.reveal, .js .reveal.intro__img img {
  transform: scale(1.18); transition: transform 1.6s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0ms) + 80ms);
}
.js img.reveal { transform: translateY(80px) rotate(var(--tilt, 1deg)) scale(1.05); }
.js .reveal.is-in .cover img, .js .reveal.is-in.project__lead img, .js .reveal.is-in.gallery__item img, .js img.reveal.is-in, .js .reveal.is-in.intro__img img { transform: none; }
.js .cat-tile.reveal {
  transition: opacity .5s ease var(--d, 0ms), transform 1.05s cubic-bezier(.2, 1.35, .45, 1) var(--d, 0ms), background .25s ease, color .25s ease;
}
.js .card.reveal.is-in:hover .cover img { transform: scale(1.04); transition-delay: 0ms; transition-duration: .6s; }
.js .gallery__item.reveal.is-in:hover img { transform: scale(1.02); transition-delay: 0ms; transition-duration: .6s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .reveal img, .js img.reveal { opacity: 1; transform: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .intro, .about, .project__body { grid-template-columns: 1fr; }
  .meta { position: static; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { gap: 14px; }
  .nav__links { gap: 14px; }
  .reel { height: min(calc(100svh - 56px), 760px); min-height: 460px; }
  .reel__tile--big { width: 86vw; }
  .reel__tile--mid { width: 64vw; }
  .reel__tile--small { width: 44vw; }
  .reel__logo { width: 120px; }
  .reel__more { display: none; }
  .featured { grid-template-columns: 1fr; gap: 40px; }
  .card--big .cover, .project__cover { aspect-ratio: 4 / 3; }
  .gallery { columns: 1; }
  .cat-tile { min-height: 170px; }
  .footer__cols { grid-template-columns: 1fr; }
  .filters { top: 55px; }
}
@media (max-width: 400px) {
  .btn--dark { padding: 7px 12px; }
}
