/* Konrad Luis portfolio */
:root {
  --bg: #FFFFFF;
  --surface: #F2F2F2;
  --text: #000000;
  --muted: #9A9A9A;
  --accent: #000000;
  --line: #E6E6E6;
  --font: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-head: "Instrument Serif", Georgia, serif;
  --pad: clamp(16px, 2vw, 28px);
  --fs: 11.5px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs)/1.35 var(--font);
  letter-spacing: .01em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
img, video { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
a:hover, button:hover { color: var(--accent); }
a:hover, button:hover { opacity: .6; }
.wordmark:hover, .filters button:hover, .views button:hover, .index a:hover { opacity: 1; }

/* ---------- frame: top bar + corners ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--pad);
  padding: var(--pad); align-items: start;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.wordmark {
  font: 400 26px/0.9 var(--font-head);
  text-transform: none; letter-spacing: .14em; white-space: nowrap;
}
.wordmark:hover { color: var(--text); }
.role { padding-top: 2px; }
.filters { justify-self: end; text-align: right; display: grid; gap: 14px; justify-items: end; }
.filters li { display: block; }
.filters button { position: relative; padding: 1px 0; color: var(--muted); transition: color .2s; }
.filters button sup { font-size: 8px; margin-left: 2px; vertical-align: 4px; }
.filters button[aria-pressed="true"] { color: var(--text); }
.filters button[data-filter][aria-pressed="true"]::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 5px; height: 5px; margin-top: -3px;
  border-radius: 50%; background: var(--accent);
}
.filters button:hover { color: var(--text); }
.views { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.views button { color: var(--muted); }
.views button[aria-pressed="true"] { color: var(--text); text-decoration: line-through; text-decoration-thickness: 1px; }

.bottom {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: end;
  padding: var(--pad); pointer-events: none;
}
.bottom > * { pointer-events: auto; }
.corner { display: grid; gap: 1px; }
.corner--right { text-align: right; }

/* ---------- index list ---------- */
.page-index main { min-height: 100vh; }
.index {
  position: relative; z-index: 5;
  width: max-content; max-width: calc(100vw - 2 * var(--pad));
  margin: 0 auto; text-align: center;
  padding: max(120px, calc(50vh - var(--rows, 37) * 8px)) 0 30vh;
}
.index li { display: block; }
.index a {
  display: inline-flex; gap: 14px; align-items: baseline; justify-content: center; padding: 1.5px 0;
  transition: opacity .25s var(--ease), color .2s;
}
.index .num, .index .tags { display: none; }
/* over the hover media the type inverts (difference blend), so it reads on white and on dark frames */
@media (min-width: 901px) and (hover: hover) {
  .page-index .index, .page-index .top, .page-index .bottom, .page-index .shuffle {
    mix-blend-mode: difference;
    color: #fff; --text: #fff; --accent: #fff; --muted: #8a8a8a;
  }
}
.index .num { color: var(--muted); width: 2.2em; font-size: 9px; transition: color .2s; }
.index .tags { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .25s var(--ease); font-size: 9px; }
.index.is-hovering a { opacity: .3; }
.index.is-hovering a.is-active { opacity: 1; color: var(--text); }
.index a.is-active .num { color: var(--accent); }
.index a.is-active .tags { opacity: 1; transform: none; }
.index li.is-out { display: none; }
.index li.is-in a { animation: rowIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.index .thumb { display: none; }

/* ---------- hover preview ---------- */
.preview {
  position: fixed; z-index: 4; margin: 0;
  inset: 0;
  pointer-events: none; opacity: 0; transition: opacity .25s var(--ease);
}
.preview.is-on { opacity: 1; }
.preview__media { position: absolute; inset: 64px var(--pad) 52px; }
.preview__media img, .preview__media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center;
}
.preview__media video { opacity: 0; transition: opacity .3s; }
.preview__media video.is-playing { opacity: 1; }
.preview__cap { position: absolute; left: 0; right: 0; bottom: var(--pad); display: flex; gap: 14px; justify-content: center; }
.count { color: var(--accent); }

/* ---------- field view ---------- */
.field { position: fixed; inset: 0; z-index: 3; }
.field[hidden] { display: none; }
body[data-view="field"] .index { display: none; }
.field a {
  position: absolute; display: block; width: var(--w); transform: translate(-50%, -50%);
  animation: drift var(--d, 22s) ease-in-out infinite alternate; animation-delay: var(--dl, 0s);
  transition: opacity .3s var(--ease);
}
.field a img { width: 100%; height: auto; background: var(--surface); }
.field a.is-in { animation: fieldIn .7s var(--ease) both, drift var(--d, 22s) ease-in-out infinite alternate; animation-delay: calc(var(--i) * 6ms), var(--dl, 0s); }
.field.is-hovering a { opacity: .25; }
.field.is-hovering a.is-active { opacity: 1; z-index: 2; }
@keyframes fieldIn { from { opacity: 0; } }
@keyframes drift { to { translate: var(--dx, 6px) var(--dy, -6px); } }
.shuffle { position: fixed; right: var(--pad); bottom: calc(var(--pad) + 18px); z-index: 31; }
body[data-view="field"] .preview { z-index: 6; }
body[data-view="field"] .preview__media { inset: 90px 14vw 60px; }

/* ---------- project page ---------- */
.page-project { height: 100vh; height: 100svh; overflow: hidden; --notes-w: min(27vw, 380px); --media-top: 76px; --media-bottom: 96px; }
.page-project .top { grid-template-columns: 1fr 1.4fr 1fr; }
.proj-crumb { padding-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 26px; align-items: baseline; }
.proj-nav { justify-self: end; text-align: right; display: grid; gap: 1px; justify-items: end; }

/* notes: the write-up for this job, beside the work */
.notes {
  position: fixed; z-index: 12; left: var(--pad); top: var(--media-top); bottom: var(--media-bottom);
  width: var(--notes-w); overflow-y: auto; overscroll-behavior: contain;
  display: none; flex-direction: column; gap: 14px; padding-right: 10px;
  text-transform: none; letter-spacing: 0;
}
body.notes-open .notes { display: flex; }
/* centre the notes vertically; auto margins fall back to the top when the text is long */
.notes::before { content: ""; margin-top: auto; }
.notes::after { content: ""; margin-bottom: auto; }
.notes > * { flex: 0 0 auto; }
@keyframes notesIn { from { opacity: 0; transform: translateX(-10px); } }
.notes__title { margin: 0; font: 400 clamp(30px, 3vw, 44px)/0.95 var(--font-head); letter-spacing: .01em; }
.notes__sub { font-size: 15px; line-height: 1.3; margin-top: -4px; }
.notes__meta { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-transform: uppercase; font-size: var(--fs); letter-spacing: .01em; }
.notes__meta dt { color: var(--muted); }
.notes__meta dd { margin: 0; }
.notes__body { display: grid; gap: 9px; font-size: 13.5px; line-height: 1.45; }
.notes__body:empty, .notes__links:empty { display: none; }
.notes a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.notes a:hover { text-decoration-color: currentColor; opacity: 1; }
.notes__links { display: flex; flex-wrap: wrap; gap: 6px 18px; text-transform: uppercase; font-size: var(--fs); letter-spacing: .01em; }
.notes__links a { text-decoration: none; }

/* the work: fills whatever the notes leave free */
.stage { position: fixed; inset: 0; }
.stage-empty { position: absolute; top: 50%; left: calc(var(--pad) + var(--notes-w) + 56px); right: var(--pad); text-align: center; }
body.empty .pager, body.empty .vid-ui { display: none; }
.slide {
  position: absolute; top: var(--media-top); bottom: var(--media-bottom); left: var(--pad); right: var(--pad);
  display: flex; gap: clamp(10px, 1.6vw, 26px); align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s .45s, left .5s var(--ease);
}
body.notes-open .slide { left: calc(var(--pad) + var(--notes-w) + clamp(24px, 3vw, 56px)); }
.slide.is-current { opacity: 1; visibility: visible; transition: opacity .45s var(--ease), left .5s var(--ease); }
.slide > .item { height: 100%; display: flex; align-items: center; justify-content: center; min-width: 0; flex: 0 1 auto; }
.slide img, .slide video { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; background: var(--surface); }
.slide.is-pair > .item { max-width: calc(50% - 13px); }
.slide video { cursor: pointer; }

.zone { position: fixed; top: var(--media-top); bottom: var(--media-bottom); width: 50%; z-index: 8; }
.zone--prev { left: 0; cursor: w-resize; }
.zone--next { right: 0; cursor: e-resize; }
body.notes-open .zone--prev { left: calc(var(--pad) + var(--notes-w) + 20px); width: calc(50% - (var(--notes-w) + 20px) / 2); }
body.notes-open .zone--next { width: calc(50% - (var(--notes-w) + 20px) / 2); }
body.single .zone, body.single .pager button { display: none; }
.cursor-tag {
  position: fixed; z-index: 40; pointer-events: none; padding: 3px 6px;
  background: var(--text); color: var(--bg); font-size: 10px; opacity: 0; transform: translate(12px, 12px);
  transition: opacity .15s;
}
.cursor-tag.is-on { opacity: 1; }

/* in-project pager (bottom centre) vs project-to-project links (corners) */
.pager {
  position: fixed; z-index: 31; left: 50%; bottom: var(--pad); transform: translateX(-50%);
  display: flex; gap: 22px; align-items: baseline; white-space: nowrap;
}
body.notes-open .pager, body.notes-open .vid-ui { left: calc(50% + (var(--notes-w) + 40px) / 2); }
.pager__count b { font-weight: 400; }
.pager__group { margin-right: 14px; color: var(--muted); }
.pager button { padding: 6px 0; }
.vid-ui {
  position: fixed; left: 50%; bottom: calc(var(--pad) + 30px); transform: translateX(-50%); z-index: 31;
  display: none; gap: 16px; color: var(--muted);
}
.vid-ui button:hover { color: var(--text); }
.vid-ui.is-on { display: flex; }
.proj-step { display: grid; gap: 1px; }
.proj-step--next { text-align: right; }
.proj-step:hover { opacity: 1; }
.proj-step:hover .proj-step__name { text-decoration: underline; text-underline-offset: 3px; }

.overview {
  position: fixed; inset: 0; z-index: 25; background: var(--bg);
  padding: 96px var(--pad) 84px; overflow-y: auto;
  display: grid; gap: 44px; align-content: start;
}
.overview[hidden] { display: none; }
.ov-group__title { margin: 0 0 14px; font: inherit; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
.show-all { margin-left: 14px; color: var(--muted); }
.show-all:hover { color: var(--text); opacity: 1; }
body.overview-open .pager, body.overview-open .vid-ui, body.overview-open .bottom, body.overview-open .zone { display: none; }
.page-project .overview { padding-bottom: 40px; }
.overview button { display: grid; gap: 6px; text-align: left; }
.overview img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center; background: var(--surface); transition: opacity .2s; }
.overview button:hover img { opacity: .75; }
.overview .n { color: var(--muted); font-size: 9px; }

/* ---------- about ---------- */
.page-about main {
  display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--pad);
  padding: 16vh var(--pad) 18vh; min-height: 100vh;
}
.about-col { display: grid; gap: 34px; align-content: start; }
.about-col h2 { margin: 0 0 8px; font: inherit; color: var(--muted); }
.about-bio { text-transform: none; letter-spacing: 0; max-width: 54ch; display: grid; gap: 12px; font-size: 14px; line-height: 1.5; }
.about-bio h2 { text-transform: uppercase; letter-spacing: .01em; font-size: var(--fs); }
.about-bio__lead { font: 400 clamp(22px, 1.9vw, 28px)/1.15 var(--font-head); margin-bottom: 6px; }
.about-bio strong { font-weight: 500; }
.clients { text-transform: uppercase; line-height: 1.5; max-width: 52ch; }
.clients span:not(:last-child)::after { content: ",  "; color: var(--muted); }
.about-img img { width: 100%; height: auto; background: var(--surface); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- tablet & phone ---------- */
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; row-gap: 10px; background: var(--bg); position: sticky; }
  .role { grid-column: 1 / -1; grid-row: 2; }
  .filters { grid-column: 2; grid-row: 1; }
  .index { margin: 0; width: 100%; max-width: none; padding: 28px var(--pad) 120px; }
  .preview { display: none; }
  .bottom { background: linear-gradient(to top, var(--bg) 60%, rgba(255,255,255,0)); }
  .page-about main { grid-template-columns: 1fr; padding-top: 32px; }
  .page-project .notes { width: auto; right: var(--pad); z-index: 26; background: var(--bg); padding-bottom: 20px; }
  body.notes-open .slide { left: var(--pad); }
  body.notes-open .zone { display: none; }
  body.notes-open .pager, body.notes-open .vid-ui { left: 50%; }
  .pager { bottom: calc(var(--pad) + 40px); }
  .vid-ui { bottom: calc(var(--pad) + 72px); }
  .page-project .bottom { background: var(--bg); }
  .about-img { max-width: 260px; }
}
@media (max-width: 900px), (hover: none) {
  .index a { display: grid; grid-template-columns: 2.2em 1fr 64px; gap: 10px; align-items: center; width: 100%; padding: 6px 0; border-top: 1px solid var(--line); min-height: 44px; }
  .index li:last-child a { border-bottom: 1px solid var(--line); }
  .index .tags { display: none; }
  .index .num { display: block; }
  .index { text-align: left; }
  .index .thumb { display: block; width: 64px; height: 44px; object-fit: cover; background: var(--surface); }
  .index.is-hovering a { opacity: 1; }
}
@media (max-width: 640px) {
  :root { --fs: 11px; }
  .top { grid-template-columns: 1fr; }
  .filters { grid-column: 1; grid-row: 3; justify-self: start; text-align: left; justify-items: start; gap: 10px; }
  .filters ul { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .filters button { min-height: 32px; }
  .filters button[data-filter][aria-pressed="true"]::before { left: auto; right: -8px; top: 9px; }
  .views button { min-height: 32px; }
  .wordmark { font-size: 24px; }
  .page-project { --media-top: 92px; --media-bottom: 120px; }
  .page-project .top { grid-template-columns: 1fr auto; row-gap: 6px; background: var(--bg); }
  .page-project .proj-crumb { grid-column: 1 / -1; grid-row: 2; }
  .page-project .proj-nav { grid-column: 2; grid-row: 1; }
  .page-project .wordmark { font-size: 20px; }
  .slide.is-pair > .item:nth-child(2) { display: none; }
  .slide.is-pair > .item { max-width: 100%; }
  .field a { width: calc(var(--w) * .7); }
  body[data-view="field"] .preview { display: none; }
}

/* event block in the notes, only when arriving from the Events filter */
.notes__event { padding: 10px 0 2px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.notes__event[hidden] { display: none; }
.notes__event-label { text-transform: uppercase; font-size: var(--fs); letter-spacing: .01em; color: var(--muted); }
.notes__event-name { font: 400 22px/1.15 var(--font-head); }
.notes__event-text { font-size: 13.5px; line-height: 1.45; }
.vid-ui button.is-strong { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
