:root {
  --bg: #fbfaf8;
  --text: #161616;
  --muted: #161616;
  --line: #e2e1dd;
  --focus: #1f4fd1;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Variable-latin.woff2") format("woff2"),
       url("assets/fonts/Inter-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 320;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.012em;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  z-index: 20;
}

.skip-link:focus-visible {
  top: 16px;
}

.page {
  max-width: 1200px;
  margin: 30px auto;
  padding: 76px 48px 88px;
  border: 1px solid #e6e5e1;
  border-radius: 12px;
  background: #fefefd;
}

.intro {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 44px;
  position: relative;
}

.intro::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #c9c9c5 18%, #c9c9c5 82%, transparent 100%);
}

h1,
h2,
h3 {
  font-size: 18px;
  font-weight: 340;
  letter-spacing: 0.035em;
}

h1,
h2 {
  font-weight: 560;
}

.intro-text > p {
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 24px;
}

.intro-name {
  color: var(--text) !important;
  font-weight: 430;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

.contact {
  font-style: normal;
  display: grid;
  gap: 4px;
}

.contact-gap {
  margin-top: 12px;
}

.contact a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.portrait {
  width: 100%;
  max-width: 140px;
  justify-self: end;
}

.portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.services {
  padding-top: 62px;
}

.service-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
}

.service-item picture {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0;
}

.service-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 360ms ease, filter 300ms ease;
}

.service-image-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: zoom-in;
  position: relative;
  margin-bottom: 10px;
}

.service-image-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(to top, rgba(17, 17, 17, 0.26), rgba(17, 17, 17, 0.02) 48%);
  opacity: 0;
  transition: opacity 260ms ease;
}

.service-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #ffffff;
  background: rgba(20, 20, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 4px 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.service-image-button:hover img,
.service-image-button:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.04) contrast(1.02);
}

.service-image-button:hover::after,
.service-image-button:focus-visible::after,
.service-image-button:hover .service-zoom-hint,
.service-image-button:focus-visible .service-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.service-item {
  border: 1px solid #e3e3de;
  border-radius: 10px;
  padding: 8px 8px 10px;
  background: #f9f8f6;
}

.service-item h3 {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #c9c9c5 18%, #c9c9c5 82%, transparent 100%);
}

.footer-link {
  color: var(--text);
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.copyright {
  color: var(--muted);
}

.footer-link:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.modal:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 10;
}

.modal-backdrop[hidden],
.modal[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  background: #fbfaf8;
  border-radius: 10px;
  border: 1px solid #ecece8;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-content {
  display: grid;
  gap: 8px;
  color: #2f2f2f;
  font-size: 16px;
  overflow-y: auto;
  padding-right: 6px;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.86);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 15;
}

.lightbox-backdrop[hidden] {
  display: none;
}

.lightbox {
  position: relative;
  margin: 0;
  max-width: min(1200px, 92vw);
  max-height: 88vh;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(24, 24, 24, 0.85);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 800px) {
  .page {
    margin: 12px;
    padding: 50px 20px 64px;
    border-radius: 10px;
  }

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

  .portrait {
    justify-self: start;
    max-width: 110px;
  }

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

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

  .modal {
    padding: 16px;
    max-height: calc(100vh - 24px);
  }

  .lightbox-backdrop {
    padding: 16px;
  }

  .lightbox-close {
    top: -12px;
    right: -6px;
  }
}
