* { box-sizing: border-box; }

:root {
  --placeholder-1: #efefef;
  --placeholder-2: #dddddd;
  --placeholder-3: #d1d1d1;
  --placeholder-4: #c5c5c5;
  --placeholder-5: #e8e8e8;
  --header-height: 80px;
  --cursor-png: none;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #fff;
  color: #111;
  font-family: var(--ui-font);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base);
}

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

body { overflow: hidden; }

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 300000;
  height: var(--header-height);
  background: transparent;
  backdrop-filter: none;
  transform: translateX(-50%);
  align-items: start;
  pointer-events: none;
}

body.project-detail-open .site-header,
body.about-page-open .site-header {
  transition: transform 300ms ease, opacity 220ms ease;
}

body.project-detail-open .site-header.is-hidden,
body.about-page-open .site-header.is-hidden {
  transform: translate(-50%, -110%);
  opacity: 0;
  pointer-events: none;
}

body.project-detail-open .site-header.is-hidden > *,
body.about-page-open .site-header.is-hidden > * {
  pointer-events: none;
}

.header-link,
.header-logo,
.header-secondary {
  pointer-events: auto;
}

.header-link {
  display: inline-block;
  margin-top: 24px;
  color: rgba(0,0,0,.66);
  font-size: var(--font-size-base);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.header-link:hover,
.header-link:focus-visible {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.header-projects { grid-column: 1; }
.header-contact { grid-column: 5; justify-self: end; }
.header-instagram,
.header-contacts,
.header-secondary { display: none; }
.header-logo {
  grid-column: 3;
  justify-self: center;
  width: clamp(132px, 28vw, 280px);
  margin-top: 10px;
  display: block;
}
.header-logo img { width: 100%; height: 58px; object-fit: contain; }

.viewport { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: #fff; }

.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
  cursor: none;
}

.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.item {
  position: absolute;
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: none;
  overflow: hidden;
  user-select: none;
  transform-origin: center;
  transition: transform 120ms cubic-bezier(.22,1,.36,1), opacity 120ms ease;
}

.item img,
.item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.item[data-tone="1"] { background: transparent; }
.item[data-tone="2"] { background: transparent; }
.item[data-tone="3"] { background: transparent; }
.item[data-tone="4"] { background: transparent; }
.item[data-tone="5"] { background: transparent; }

.hover-title {
  position: fixed;
  z-index: 400000;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 3px 5px 2px;
  opacity: 0;
  pointer-events: none;
  color: #111;
  background: transparent;
  font-family: var(--ui-font);
  font-size: var(--font-size-base);
  line-height: 1;
  white-space: nowrap;
  border-radius: 0;
  transform: translate3d(18px, 18px, 0);
  transition: opacity 90ms ease, transform 90ms ease;
}
.hover-title::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: rgba(255, 255, 255, 0.01);
  -webkit-backdrop-filter: invert(1);
  backdrop-filter: invert(1);
  pointer-events: none;
}
.hover-title span {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 1px #fff;
}
.hover-title.is-visible { opacity: 1; }

.custom-cursor {
  position: fixed;
  z-index: 400001;
  width: 21px;
  height: 21px;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-20px,-20px,0);
}

.custom-cursor::before,
.custom-cursor::after {
  content: "";
  position: absolute;
  background: #111;
}
.custom-cursor::before { left: 10px; top: 0; width: 1px; height: 21px; }
.custom-cursor::after { left: 0; top: 10px; width: 21px; height: 1px; }
.custom-cursor.is-visible { opacity: 1; }

.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 250000;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.992);
  transition: opacity 260ms cubic-bezier(.22,1,.36,1), transform 260ms cubic-bezier(.22,1,.36,1), visibility 260ms;
}
.project-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1); }
.project-scroller { width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fff; }

.project-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 300001;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111;
  font: 300 22px/32px var(--ui-font);
  cursor: pointer;
}

.project-page { width: 100%; min-height: 100%; padding: 106px 0 80px; }

.project-title.grid-a {
  display: block;
  margin: 0 auto 45px;
  font-family: var(--display-font);
  font-size: var(--font-size-base);
  line-height: 1.2;
  font-weight: var(--font-weight-base);
  letter-spacing: 0;
}

.project-sequence {
  display: flex;
  flex-direction: column;
  gap: var(--project-spacing, 45px);
  width: 100%;
}

.project-description.grid-a {
  display: block;
  max-width: none;
  margin: 0 auto;
  font-family: var(--ui-font);
  font-size: var(--font-size-base);
  line-height: 1.35;
}

.project-image.grid-a,
.project-image.grid-b {
  display: grid;
  margin: 0 auto;
}

.project-image img {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
}

.project-video.grid-a,
.project-video.grid-b {
  display: block;
  margin: 0 auto;
}

.project-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
  color-scheme: light;
}

body.project-is-open { overflow: hidden; }

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 260000;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.992);
  transition: opacity 260ms cubic-bezier(.22,1,.36,1), transform 260ms cubic-bezier(.22,1,.36,1), visibility 260ms;
}

.about-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.about-story {
  display: flex;
  flex-direction: column;
  gap: var(--project-spacing, 45px);
  padding: 106px 0 80px;
}

.about-visual.grid-a {
  display: block;
  margin: 0 auto;
}

.about-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.about-copy.grid-a {
  display: block;
  margin: 0 auto;
  color: rgba(0,0,0,.72);
  font-family: var(--ui-font);
  font-size: var(--font-size-base);
  line-height: 1.45;
}

.about-contact.grid-a {
  display: block;
  margin: 0 auto;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.about-contact h2 {
  margin: 0 0 14px;
  font-size: var(--font-size-base);
  line-height: 1;
  font-weight: var(--font-weight-base);
  letter-spacing: .12em;
}

.about-contact .about-copy { margin: 0 0 18px; }

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-base);
}

.contact-list a { color: inherit; text-decoration: none; }
.contact-list a:hover,
.contact-list a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .grid-a { width: var(--grid-a-width); min-width: 0; }
}

@media (max-width: 700px) {
  :root { --header-height: 74px; }
  .grid-a { width: var(--grid-a-width); }
  .header-link { font-size: var(--font-size-base); }
  .header-secondary { display: none; }
  .header-instagram { grid-column: 5; justify-self: end; }
  .project-page {
    padding-top: 90px;
  }

  .about-story {
    padding-top: 90px;
  }
}
