:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.58);
  --soft: rgba(0, 0, 0, 0.08);
  --accent: #dd3333;
  --header-h: 58px;
  --side: clamp(16px, 2vw, 28px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--side);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: transform 360ms var(--ease);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.brand,
.nav-link,
.work-seo h2,
.about-kicker,
.lightbox-close,
.back-to-top,
.image-label {
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.7em;
  font-size: 13px;
}

.brand-role {
  color: rgba(0, 0, 0, 0.42);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}

.nav-link {
  position: relative;
  font-size: 12px;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
}

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

.work-stage {
  padding: calc(var(--header-h) + 16px) var(--side) 42px;
}

.work-grid {
  position: relative;
  width: 100%;
  min-height: 80vh;
}

.work-seo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 84px);
  padding: 72px var(--side) 86px;
  color: rgba(0, 0, 0, 0.58);
}

.work-seo article {
  max-width: 680px;
}

.work-seo h2 {
  margin: 0 0 18px;
  color: rgba(0, 0, 0, 0.78);
  font-size: 11px;
}

.work-seo p {
  margin: 0;
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.65;
}

.work-seo p + p {
  margin-top: 14px;
}

.work-item {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--item-w, 30vw);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(82px);
  transition:
    opacity 760ms var(--ease),
    transform 760ms var(--ease);
  visibility: hidden;
}

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

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

.image-label {
  position: absolute;
  z-index: 2;
  bottom: 8px;
  max-width: calc(50% - 12px);
  padding: 5px 7px 4px;
  background: rgba(255, 255, 255, 0.82);
  color: #000;
  font-size: 9px;
  line-height: 1;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.image-label.project {
  left: 8px;
  text-align: left;
}

.image-label.type {
  right: 8px;
  text-align: right;
}

.work-item:hover .image-label,
.work-item:focus-visible .image-label {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 54px var(--side) 28px;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: var(--side);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.lightbox-nav {
  position: fixed;
  z-index: 2;
  top: 50%;
  border: 0;
  padding: 12px 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.62);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition: color 180ms ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  color: #000;
}

.lightbox-prev {
  left: var(--side);
}

.lightbox-next {
  right: var(--side);
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  transform: scale(0.985) translateY(10px);
  transition:
    opacity 300ms var(--ease),
    transform 300ms var(--ease);
}

.lightbox.is-open .lightbox-figure {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.lightbox img {
  display: block;
  max-width: min(94vw, 1500px);
  max-height: calc(100vh - 112px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-to-top {
  position: fixed;
  z-index: 18;
  right: var(--side);
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 10px 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.44);
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    color 180ms ease;
}

.back-to-top span[aria-hidden="true"] {
  font-size: 22px;
  line-height: 0.8;
  transform: translateY(-1px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: rgba(0, 0, 0, 0.82);
}

.about-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 42px) var(--side) 42px;
}

.about-panel {
  max-width: 860px;
}

.about-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 11px;
}

.about-panel h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(32px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

.about-seo {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 44px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-block a {
  border-bottom: 1px solid currentColor;
}

@media (max-width: 760px) {
  :root {
    --header-h: 62px;
    --side: 14px;
  }

  .site-header {
    align-items: flex-start;
    padding-top: 15px;
  }

  .brand {
    max-width: 170px;
    line-height: 1.1;
  }

  .brand-role {
    display: none;
  }

  .work-item {
    width: 100%;
  }

  .work-seo {
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .image-label {
    opacity: 1;
    transform: none;
    font-size: 8px;
  }

  .about-page {
    align-items: start;
  }

  .about-panel h1 {
    letter-spacing: -0.018em;
  }

  .contact-block {
    font-size: 12px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .back-to-top {
    bottom: 14px;
    font-size: 10px;
  }

  .lightbox-prev {
    left: var(--side);
  }

  .lightbox-next {
    right: var(--side);
  }
}

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

  .work-item {
    opacity: 1;
    transform: none;
  }
}
