@font-face {
  font-family: "Roboto Mono";
  src: url("assets/RobotoMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111;
  --soft-ink: rgba(17, 17, 17, 0.58);
  --paper: #f4f4f1;
  --edge-x: clamp(18px, 3vw, 42px);
  --edge-y: clamp(18px, 3vw, 36px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 360;
  letter-spacing: 0;
}

a,
button {
  font: inherit;
}

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

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

.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;
}

.site-header {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.menu-wrap {
  position: absolute;
  top: var(--edge-y);
  left: var(--edge-x);
  pointer-events: auto;
}

.menu-button {
  display: grid;
  align-content: center;
  gap: 7px;
  width: 34px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-button span:not(.sr-only) {
  display: block;
  width: 34px;
  height: 1px;
  background: currentColor;
  transform-origin: left center;
  transition: opacity 220ms ease, transform 220ms ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(-1px) scaleX(0.64);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
  transform: scaleX(0.86);
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(1px) scaleX(0.5);
}

.menu-button:focus-visible {
  outline: none;
}

.menu-button:focus-visible span:not(.sr-only) {
  height: 2px;
}

.site-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  margin-top: 32px;
  color: var(--soft-ink);
  font-size: clamp(0.9rem, 1.2vw, 1.08rem);
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-12px, -4px, 0);
  clip-path: inset(0 100% 0 0);
  transition:
    opacity 260ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-menu.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 0 0 0);
}

body.menu-open .library__nav {
  opacity: 0;
  pointer-events: none;
}

.site-menu a,
.menu-text-button {
  display: block;
  position: relative;
  padding: 1px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.site-menu a::after,
.menu-text-button::after,
.project-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.site-menu a:hover,
.site-menu a:focus-visible,
.menu-text-button:hover,
.menu-text-button:focus-visible,
.project-link:hover,
.project-link:focus-visible {
  color: var(--ink);
  outline: none;
}

.site-menu a:hover::after,
.site-menu a:focus-visible::after,
.menu-text-button:hover::after,
.menu-text-button:focus-visible::after,
.project-link:hover::after,
.project-link:focus-visible::after {
  transform: scaleX(1);
}

.logo {
  position: absolute;
  top: var(--edge-y);
  right: var(--edge-x);
  width: clamp(58px, 7vw, 104px);
  line-height: 0;
  pointer-events: auto;
}

.logo img {
  width: 100%;
  height: auto;
}

.home {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.home picture {
  position: absolute;
  inset: 0;
}

.home__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.library {
  display: grid;
  grid-template-columns: minmax(140px, 18vw) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 96px);
  min-height: 100svh;
  padding: clamp(112px, 15vw, 188px) var(--edge-x) clamp(54px, 8vw, 96px);
}

.library__nav {
  position: sticky;
  top: clamp(104px, 12vw, 150px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-height: 220px;
  transition: opacity 180ms ease;
}

.section-label,
.project__header p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 0.84rem;
  line-height: 1;
}

.project-link {
  position: relative;
  width: fit-content;
  color: var(--soft-ink);
  font-size: clamp(0.92rem, 1.2vw, 1.05rem);
  line-height: 1.2;
}

.project {
  display: grid;
  gap: clamp(28px, 5vw, 58px);
}

.project__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.project__header h1 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 4.2rem);
  font-weight: 360;
  line-height: 0.98;
  letter-spacing: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}

.photo-tile {
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.photo-tile--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease, transform 240ms ease;
}

.photo-tile:hover img,
.photo-tile:focus-visible img {
  opacity: 0.72;
  transform: scale(1.015);
}

.photo-tile:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 5px;
}

.lightbox {
  max-width: min(1180px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  padding: 0;
  border: 0;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(244, 244, 241, 0.92);
}

.lightbox img {
  width: auto;
  max-width: min(1180px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  object-fit: contain;
}

.lightbox__close {
  position: fixed;
  top: var(--edge-y);
  right: var(--edge-x);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__arrow {
  position: fixed;
  top: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.lightbox__arrow--prev {
  left: var(--edge-x);
}

.lightbox__arrow--next {
  right: var(--edge-x);
}

.lightbox__arrow:hover,
.lightbox__arrow:focus-visible,
.lightbox__close:hover,
.lightbox__close:focus-visible {
  outline: none;
  color: var(--soft-ink);
}

.about {
  display: grid;
  align-content: space-between;
  min-height: 100svh;
  padding: clamp(112px, 15vw, 188px) var(--edge-x) var(--edge-y);
}

.about__inner {
  display: grid;
  grid-template-columns: minmax(140px, 18vw) minmax(0, 760px);
  gap: clamp(34px, 6vw, 96px);
}

.about h1 {
  margin: 0 0 34px;
  font-size: clamp(1.5rem, 4.2vw, 4.2rem);
  font-weight: 360;
  line-height: 0.98;
  letter-spacing: 0;
}

.about p {
  margin: 0;
  max-width: 72ch;
  color: var(--ink);
  font-size: clamp(0.95rem, 1.25vw, 1.12rem);
  line-height: 1.55;
}

.contact-footer {
  padding-top: 72px;
}

.contact-footer p {
  color: var(--soft-ink);
  font-size: clamp(0.88rem, 1vw, 1rem);
}

.contact-footer a,
.links-popover a {
  position: relative;
  color: inherit;
}

.links-popover {
  width: min(280px, calc(100vw - 36px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.links-popover::backdrop {
  background: rgba(244, 244, 241, 0.78);
}

.links-popover[open] {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.links-popover__close {
  align-self: flex-start;
  width: 34px;
  height: 34px;
  margin: 0 0 12px -6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 800px) {
  :root {
    --edge-x: 18px;
    --edge-y: 18px;
  }

  .home__photo {
    object-position: center top;
  }

  .site-menu {
    gap: 12px;
    margin-top: 30px;
    font-size: 0.95rem;
  }

  .logo {
    width: 64px;
  }

  .library {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 112px;
  }

  .library__nav {
    position: static;
    min-height: 0;
    gap: 18px;
  }

  .project__header {
    align-items: start;
    flex-direction: column;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-tile--wide {
    grid-column: auto;
  }
}

.footer-text-button {
  margin-left: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cookie-banner[hidden],
.cookie-banner.is-hidden {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  right: var(--edge-x);
  bottom: var(--edge-y);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  width: min(640px, calc(100vw - (var(--edge-x) * 2)));
  padding: 16px 0 0;
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.45;
}

.cookie-banner p {
  margin: 0;
}

.cookie-banner div {
  display: flex;
  gap: 14px;
}

.cookie-banner button,
.privacy-dialog button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.privacy-dialog {
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  padding: clamp(22px, 4vw, 42px);
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.privacy-dialog::backdrop {
  background: rgba(244, 244, 241, 0.86);
}

.privacy-dialog__close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  font-size: 2rem;
  line-height: 1;
}

.privacy-dialog h1 {
  margin: 18px 0 26px;
  font-size: clamp(1.45rem, 4vw, 3rem);
  font-weight: 360;
  line-height: 1;
}

.privacy-dialog h2 {
  margin: 28px 0 10px;
  font-size: 1rem;
  font-weight: 420;
}

.privacy-dialog p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.55;
}

.privacy-dialog a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 800px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 12px;
    font-size: 0.74rem;
  }
}
