:root {
  --pad: 16px;
  --ink: #000;
  --paper: #fff;
  --soft: rgba(0, 0, 0, .55);
  --serif: "Newsreader", "Times New Roman", Times, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 300 16px/1.2 var(--serif);
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  transition: color .6s var(--ease);
}

a, button { color: inherit; font: inherit; letter-spacing: inherit; text-decoration: none; background: none; border: 0; cursor: pointer; }
a:hover, button:hover { text-decoration: underline; text-underline-offset: 3px; }
ul { list-style: none; }

.mono { font: 400 11px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--pad);
  padding: 0 var(--pad);
}

/* ---------- reel ---------- */

#strip {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  transition: opacity .7s var(--ease);
}
#strip.is-drag { cursor: grabbing; }
#strip.is-hit { cursor: pointer; }

.cap {
  position: fixed; left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
}
.cap.on { opacity: 1; }
.cap__dir { color: var(--soft); margin-top: 2px; }
.cap__meta { margin-top: 10px; display: flex; }
.cap__meta span, .index__meta span { border: 1px solid currentColor; padding: 3px 4px 2px; margin-left: -1px; }

/* ---------- chrome ---------- */

.top, .bottom { position: fixed; left: 0; right: 0; z-index: 5; align-items: center; }
.top { top: 0; height: 42px; }
.bottom { bottom: 0; height: 50px; }

.name { grid-column: 1 / span 4; display: grid; grid-template-columns: subgrid; }
.name span { grid-column: span 2; }
.name b { font-weight: 400; }
.name i { font-style: normal; opacity: 0; transition: opacity .35s; }
.name:hover { text-decoration: none; }
.name:hover i, body[data-view="about"] .name i { opacity: 1; }

.role { grid-column: 8 / -1; display: flex; justify-content: space-between; color: var(--soft); transition: color .6s; }

.tc { grid-column: 1; justify-self: start; border: 1px solid currentColor; padding: 3px 4px 2px; }
.views { grid-column: 2 / span 5; display: flex; gap: 2.2em; }
.links { grid-column: 8 / -1; display: flex; justify-content: space-between; }

[data-go] { text-underline-offset: 3px; }
body[data-view="featured"] .views [data-go="featured"],
body[data-view="index"] .views [data-go="index"],
body[data-view="about"] .links [data-go="about"] { text-decoration: underline; }

.filterbtn { display: none; }
body[data-view="index"] .filterbtn { display: block; }

.filters {
  position: absolute; bottom: 100%; left: 0; right: 0;
  padding: 0 var(--pad) 14px;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--pad);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .3s, transform .4s var(--ease), visibility .3s;
}
.filters li { grid-column: 3 / span 4; line-height: 1.6; }
.filters button { opacity: .6; }
.filters button.on, .filters button:hover { opacity: 1; }
.filters.open { opacity: 1; visibility: visible; transform: none; }
body:not([data-view="index"]) .filters { opacity: 0; visibility: hidden; }

/* ---------- all projects ---------- */

.bg { position: fixed; inset: 0; opacity: 0; transition: opacity .8s var(--ease); background: #111; }
.bg__layer {
  position: absolute; inset: -3%;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity .9s var(--ease);
  animation: drift 26s ease-in-out infinite alternate;
}
.bg__layer.on { opacity: 1; }
.bg__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06) translateX(-1%); } }

.index {
  position: fixed; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
  touch-action: none;
}
.drum {
  position: absolute; inset: 0;
  perspective: 900px;
  transform-style: preserve-3d;
}
.drum__item {
  position: absolute; left: 50%; top: 50%;
  width: max-content; max-width: 92vw;
  font-size: clamp(26px, 3.6vw, 54px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.drum__item:hover { text-decoration: none; }

.index__dir, .index__meta { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.index__dir { left: var(--pad); max-width: 22vw; }
.index__meta { right: var(--pad); display: flex; }

body[data-view="index"] { color: #fff; }
body[data-view="index"] .role { color: rgba(255, 255, 255, .6); }
body[data-view="index"] .bg { opacity: 1; }
body[data-view="index"] .index { opacity: 1; visibility: visible; }
body[data-view="index"] #strip,
body[data-view="about"] #strip { opacity: 0; pointer-events: none; }

/* ---------- about ---------- */

.about {
  position: fixed; inset: 0;
  display: grid; align-items: center;
  overflow-y: auto;
  padding: 80px 0;
  opacity: 0; visibility: hidden;
  transition: opacity .6s var(--ease), visibility .6s;
}
body[data-view="about"] .about { opacity: 1; visibility: visible; }
.about__bio { grid-column: 3 / span 4; font-size: 20px; line-height: 1.25; letter-spacing: 0; }
.about__links { margin-top: 2em; display: flex; gap: 2em; font-size: 16px; }
.about__links a { text-decoration: underline; text-underline-offset: 3px; }
.about__awards { grid-column: 8 / -1; }
.about__awards h2 { color: var(--soft); margin-bottom: 14px; }
.about__awards li { padding: 7px 0; border-top: 1px solid rgba(0, 0, 0, .12); display: flex; justify-content: space-between; gap: 2em; }
.about__awards li span:last-child { color: var(--soft); }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 15px; }
  .name { grid-column: 1 / span 6; }
  .name span { grid-column: span 3; }
  .role { grid-column: 9 / -1; }
  .tc { display: none; }
  .views { grid-column: 1 / span 7; gap: 1.2em; }
  .links { grid-column: 8 / -1; gap: 1.2em; justify-content: flex-end; }
  .filters li { grid-column: 1 / -1; }
  .index__dir { top: 64px; transform: none; max-width: none; }
  .index__meta { top: auto; bottom: 64px; right: auto; left: calc(var(--pad) + 1px); transform: none; }
  .about { align-items: start; }
  .about__bio, .about__awards { grid-column: 1 / -1; }
  .about__awards { margin-top: 48px; }
  .about__awards li { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg__layer { animation: none; }
}
