:root {
  --paper: #f2f0ea;
  --ink: #171717;
  --accent: #a43a2f;
  --muted: rgba(23, 23, 23, 0.58);
  --line: rgba(23, 23, 23, 0.18);
  --soft: rgba(23, 23, 23, 0.055);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 200ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Loader */

.loader {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-content: center;
  gap: 22px;
  padding: 32px;
  background: var(--paper);
  text-align: center;
  transition:
    opacity 700ms var(--ease),
    visibility 700ms;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-size: clamp(34px, 8vw, 92px);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.loader-line {
  width: min(260px, 62vw);
  height: 1px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--line);
}

.loader-line span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--ink);
  transition: width 300ms var(--ease);
}

.loader-caption {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Shell */

.site {
  position: relative;
  height: 100svh;
  opacity: 0;
  transition: opacity 700ms ease;
}

body.is-ready .site {
  opacity: 1;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 34px;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.menu-toggle {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  pointer-events: auto;
  transition:
    transform 500ms var(--ease),
    background 300ms ease;
}

.menu-toggle:hover {
  transform: rotate(8deg);
}

.menu-toggle__lines {
  position: relative;
  display: block;
  width: 19px;
  height: 9px;
}

.menu-toggle__lines i {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition:
    top 400ms var(--ease),
    transform 400ms var(--ease);
}

.menu-toggle__lines i:first-child {
  top: 1px;
}

.menu-toggle__lines i:last-child {
  top: 7px;
}

body.menu-open .menu-toggle__lines i:first-child {
  top: 4px;
  transform: rotate(45deg);
}

body.menu-open .menu-toggle__lines i:last-child {
  top: 4px;
  transform: rotate(-45deg);
}

/* Hero */

.home {
  position: relative;
  height: 100%;
  transition:
    filter 600ms var(--ease),
    transform 600ms var(--ease);
}

body.menu-open .home,
body.has-view .home {
  filter: blur(7px);
  transform: scale(1.012);
}

.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.36), transparent 48%),
    var(--paper);
}

#filmCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#filmCanvas:active {
  cursor: grabbing;
}

.hero-meta {
  position: absolute;
  bottom: 31px;
  z-index: 2;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  line-height: 1.5;
  text-transform: uppercase;
  pointer-events: none;
}

.hero-meta--left {
  left: 34px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  max-width: 55vw;
}

#frameTitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-dot {
  color: var(--accent);
}

.hero-meta--right {
  right: 34px;
  text-align: right;
}

.hero-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  z-index: 2;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateX(-50%);
  pointer-events: none;
  animation: hint-away 9s ease 2s forwards;
}

.hero-hint.is-hidden {
  opacity: 0;
}

@keyframes hint-away {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Menu */

.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(242, 240, 234, 0.1);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 500ms var(--ease);
}

.menu-scrim.is-open {
  opacity: 1;
}

.menu-panel {
  position: fixed;
  top: 108px;
  right: 34px;
  z-index: 60;
  width: 306px;
  padding: 30px 30px 24px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: translateY(-14px) scale(0.97);
  transform-origin: top right;
  visibility: hidden;
  transition:
    opacity 450ms var(--ease),
    transform 450ms var(--ease),
    visibility 450ms;
}

.menu-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.menu-nav {
  display: grid;
  gap: 2px;
}

.menu-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(242, 240, 234, 0.1);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    color 250ms ease,
    padding-left 350ms var(--ease);
}

.menu-link span {
  color: rgba(242, 240, 234, 0.38);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.menu-link:hover {
  padding-left: 7px;
  color: #d8b28d;
}

.menu-foot {
  display: grid;
  gap: 9px;
  padding-top: 24px;
  color: rgba(242, 240, 234, 0.5);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.menu-foot a {
  color: var(--paper);
  transition: color 200ms ease;
}

.menu-foot a:hover {
  color: #d8b28d;
}

/* Close button */

.close-button {
  position: fixed;
  top: 30px;
  right: 34px;
  z-index: 80;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  transition:
    transform 500ms var(--ease),
    background 250ms ease;
}

.close-button:hover {
  transform: rotate(90deg);
  background: var(--accent);
}

.close-button span {
  transform: translateY(-1px);
}

/* Content views */

.view {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4%);
  transition:
    opacity 500ms var(--ease),
    transform 700ms var(--ease),
    visibility 700ms;
}

.view.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.view-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 104px;
  padding: 0 34px;
  background: linear-gradient(var(--paper) 55%, rgba(242, 240, 234, 0));
  pointer-events: none;
}

.view-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.view-bar .close-button {
  position: relative;
  top: auto;
  right: auto;
  pointer-events: auto;
}

.view-content {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 132px 34px 74px;
  overscroll-behavior: contain;
}

.view.is-open .view-content > * {
  animation: view-rise 650ms var(--ease) both;
}

.view.is-open .view-content > *:nth-child(2) {
  animation-delay: 60ms;
}

@keyframes view-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-title {
  max-width: 900px;
  margin: 0;
  font-size: clamp(54px, 9vw, 124px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.84;
}

.view-intro {
  max-width: 520px;
  margin: 28px 0 64px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

/* Index */

.index-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.index-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 62px 26px;
  padding-top: 34px;
}

.index-card {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
}

.index-card:nth-child(3n + 2) {
  margin-top: 40px;
}

.index-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--soft);
}

.index-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 900ms var(--ease),
    filter 600ms ease;
}

.index-card__image::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  content: "";
  pointer-events: none;
}

.index-card:hover .index-card__image img {
  transform: scale(1.035);
}

.index-card.is-grayscale img {
  filter: grayscale(1) contrast(1.03);
}

.index-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
}

.index-card__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.index-card__place {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.index-card__code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Journal */

.journal-list {
  max-width: 1000px;
  border-bottom: 1px solid var(--line);
}

.journal-entry {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.journal-entry__date {
  display: block;
  margin-bottom: 17px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.journal-entry__title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(26px, 3.8vw, 52px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.journal-entry__excerpt {
  max-width: 560px;
  margin: 16px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.journal-entry details {
  max-width: 620px;
}

.journal-entry summary {
  width: max-content;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.journal-entry summary::-webkit-details-marker {
  display: none;
}

.journal-entry summary::after {
  content: " +";
}

.journal-entry details[open] summary::after {
  content: " −";
}

.journal-body {
  padding-top: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-line;
}

/* Info */

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.7fr);
  gap: clamp(50px, 10vw, 160px);
  align-items: start;
}

.info-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(50px, 8vw, 112px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.86;
}

.info-copy {
  max-width: 450px;
  padding-top: 5px;
}

.info-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-line;
}

.info-copy p:first-child {
  color: var(--ink);
}

.info-links {
  display: grid;
  gap: 9px;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.info-links a,
.info-links span {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-transform: uppercase;
}

.info-links a {
  transition: color 200ms ease;
}

.info-links a:hover {
  color: var(--accent);
}

.info-links small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.info-copyright {
  margin-top: 80px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Project detail */

.project-view {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4%);
  transition:
    opacity 500ms var(--ease),
    transform 700ms var(--ease),
    visibility 700ms;
}

.project-view.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.project-image-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #161616;
}

.project-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: rgba(23, 23, 23, 0.84);
  color: var(--paper);
  transform: translate(-50%, -50%);
  transition:
    background 250ms ease,
    transform 350ms var(--ease);
}

.project-play[hidden] {
  display: none;
}

.project-play::before {
  margin-left: 5px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid currentColor;
  content: "";
}

.project-play:hover {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.06);
}

.project-image-wrap img,
.project-image-wrap video {
  width: 100%;
  height: 100vh;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 700ms ease,
    transform 1200ms var(--ease);
}

.project-view.is-open .project-image-wrap img,
.project-view.is-open .project-image-wrap video {
  opacity: 1;
  transform: scale(1);
}

.project-copy {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  padding: 104px 54px 38px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.project-copy__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-title {
  max-width: 520px;
  margin: 26px 0 18px;
  font-size: clamp(46px, 6.4vw, 96px);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.project-place {
  margin: 0 0 36px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-description {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.78;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-nav button {
  padding: 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.project-nav button:hover {
  color: var(--accent);
}

.project-nav button:disabled {
  color: var(--muted);
  opacity: 0.35;
  pointer-events: none;
}

.project-copy__foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 34px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.close-button--project {
  position: fixed;
  z-index: 90;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 14px);
  visibility: hidden;
  transition:
    opacity 250ms ease,
    transform 350ms var(--ease),
    visibility 350ms;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Empty state */

.empty-state {
  max-width: 460px;
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* Responsive */

@media (max-width: 1000px) {
  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .index-card:nth-child(3n + 2) {
    margin-top: 0;
  }

  .index-card:nth-child(2n) {
    margin-top: 32px;
  }

  .project-view {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.82fr);
  }

  .project-copy {
    padding-right: 38px;
    padding-left: 38px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 19px 20px;
  }

  .brand {
    padding-top: 7px;
    font-size: 12px;
  }

  .menu-toggle {
    width: 54px;
    height: 54px;
  }

  .menu-panel {
    top: 88px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: calc(100svh - 104px);
    overflow-y: auto;
  }

  .hero {
    min-height: 520px;
  }

  .hero-meta {
    bottom: 22px;
    font-size: 8px;
  }

  .hero-meta--left {
    left: 20px;
    max-width: 65vw;
  }

  .hero-meta--right {
    right: 20px;
  }

  .hero-hint {
    bottom: 54px;
  }

  .view-bar {
    height: 78px;
    padding: 0 20px;
  }

  .view-bar .close-button,
  .close-button {
    top: 19px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 23px;
  }

  .view-content {
    padding: 100px 20px 56px;
  }

  .view-title {
    font-size: clamp(50px, 16vw, 86px);
  }

  .index-head {
    display: block;
    padding-bottom: 22px;
  }

  .index-count {
    margin-top: 16px;
  }

  .index-grid {
    gap: 38px 14px;
    padding-top: 24px;
  }

  .index-card:nth-child(2n) {
    margin-top: 20px;
  }

  .index-card__meta {
    display: block;
    padding-top: 9px;
  }

  .index-card__place,
  .index-card__code {
    display: block;
    margin-top: 6px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .info-title {
    font-size: clamp(48px, 15vw, 84px);
  }

  .info-copyright {
    margin-top: 50px;
  }

  .project-view {
    display: block;
    overflow-y: auto;
  }

  .project-image-wrap img,
  .project-image-wrap video {
    height: 58svh;
    min-height: 360px;
  }

  .project-play {
    width: 62px;
    height: 62px;
  }

  .project-copy {
    height: auto;
    min-height: 42svh;
    padding: 32px 22px 28px;
    overflow: visible;
  }

  .project-title {
    margin-top: 20px;
    font-size: clamp(44px, 14vw, 76px);
  }

  .project-place {
    margin-bottom: 26px;
  }

  .project-nav {
    margin-top: 34px;
  }

  .project-copy__foot {
    margin-top: 46px;
  }

  .close-button--project {
    top: 14px;
    right: 14px;
    position: fixed;
  }
}

@media (max-width: 520px) {
  .index-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .index-card:nth-child(2n) {
    margin-top: 0;
  }

  .hero-meta--right {
    max-width: 34vw;
  }

  .hero-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero-hint {
    animation: none;
  }
}
