@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/source-sans-pro/SourceSansPro-Regular.otf');
  font-weight: 400;
}

@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/source-sans-pro/SourceSansPro-Semibold.otf');
  font-weight: 600;
}

:root {
  --page: #f4f1ea;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --text: #1d2733;
  --muted: #5c6875;
  --line: #d9d0c3;
  --accent: #0e7c86;
  --accent-strong: #095b63;
  --warm: #c65d3b;
  --shadow: 0 18px 45px rgba(29, 39, 51, 0.14);
}

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

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 124, 134, 0.14), transparent 32rem),
    linear-gradient(180deg, #fffaf1 0%, var(--page) 52%, #ece7de 100%);
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  text-align: center;
}

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

img {
  max-width: 100%;
}

.container {
  width: min(100% - 32px, 1100px);
  margin-right: auto;
  margin-left: auto;
}

.nav {
  width: min(100% - 32px, 780px);
  margin: 28px auto 22px;
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: rgba(255, 250, 241, 0.82);
  box-shadow: 0 10px 30px rgba(29, 39, 51, 0.08);
}

.list__item {
  display: block;
  list-style-type: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.list__item a {
  display: block;
  min-width: 82px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.list__item:hover a,
.list__item.active a {
  color: #fff !important;
  background-color: var(--accent) !important;
  transform: translateY(-1px);
}

.welcome,
.about,
.contacts,
.work {
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 32px, 760px);
  margin: 44px auto 0;
  padding: 42px;
}

.welcome__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.05;
}

.welcome__description {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 19px;
}

.welcome img {
  width: min(100%, 360px);
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background-color: var(--surface-strong);
}

.about {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 34px;
}

.about p,
.contacts p,
.works__description,
.work__description {
  color: var(--muted);
}

.about p {
  max-width: 650px;
  margin: 0 auto 18px;
}

.about p:last-child {
  margin-bottom: 0;
}

.technology {
  color: var(--accent-strong);
  font-weight: 600;
}

.contacts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 38px 32px;
}

.contacts__title,
.works__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.1;
}

.contacts p {
  max-width: 520px;
  margin: 0 auto;
}

.contacts__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 4px auto 0;
  padding: 0;
}

.border-wrapper {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: #d7edf0;
  box-shadow: inset 0 0 0 1px rgba(14, 124, 134, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.border-wrapper:hover {
  box-shadow:
    inset 0 0 0 1px rgba(14, 124, 134, 0.18),
    0 14px 28px rgba(29, 39, 51, 0.16);
  transform: translateY(-3px);
}

.contact_icon {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  background-color: #f8fcfc;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 64px;
  cursor: pointer;
}

.contact_icon--email {
  background-image: url('../img/email.png');
}

.contact_icon--github {
  background-image: url('../img/github.png');
}

.contact_icon--tg {
  background-image: url('../img/tg.png');
}

.works {
  width: min(100% - 32px, 760px);
  margin: 0 auto 26px;
}

.works__title {
  margin-bottom: 12px;
}

.works__description {
  max-width: 560px;
  margin: 0 auto;
  font-size: 18px;
}

.works__slider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100% - 70px, 760px);
  margin: 0 auto;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(100%, 680px);
  min-height: 650px;
  margin: 0 auto;
  padding: 36px;
}

.work__title {
  min-height: 31px;
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.work__description {
  max-width: 560px;
  min-height: 112px;
  margin: 0;
}

.work__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
}

.work__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 8px;
  border: 1px solid rgba(14, 124, 134, 0.22);
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 10px 22px rgba(29, 39, 51, 0.14);
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.work__link:hover {
  border-color: var(--accent-strong);
  background-color: var(--accent-strong);
  transform: translateY(-1px);
}

.work__link-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.work__image,
.preview-slider {
  width: 100%;
  max-width: 560px;
  height: 330px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background-color: var(--surface-strong);
  box-shadow: 0 10px 28px rgba(29, 39, 51, 0.1);
}

.work__image {
  display: block;
  object-fit: contain;
  cursor: zoom-in;
}

.preview-slider {
  position: relative;
  overflow: hidden;
}

.preview-slider__viewport {
  width: 100%;
  height: 100%;
}

.preview-slider__image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  cursor: zoom-in;
}

.preview-slider__image.active {
  display: block;
}

.work__next,
.work__prev,
.preview-slider__button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(14, 124, 134, 0.22);
  border-radius: 50%;
  background-color: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(29, 39, 51, 0.16);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.work__next,
.work__prev {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
}

.work__next:hover,
.work__prev:hover,
.preview-slider__button:hover {
  border-color: var(--accent);
  background-color: #e8f3f2;
}

.work__next:hover {
  transform: translate(2px, -50%);
}

.work__prev:hover {
  transform: translate(-2px, -50%);
}

.work__next:focus,
.work__prev:focus,
.preview-slider__button:focus,
.preview-slider__dot:focus,
.image-viewer__close:focus {
  outline: 3px solid rgba(14, 124, 134, 0.28);
  outline-offset: 3px;
}

.work__next::before,
.work__prev::before,
.preview-slider__button::before {
  content: '';
  width: 12px;
  height: 12px;
  border-top: 3px solid var(--accent-strong);
  border-right: 3px solid var(--accent-strong);
}

.work__next::before,
.preview-slider__button--next::before {
  margin-left: -3px;
  transform: rotate(45deg);
}

.work__prev::before,
.preview-slider__button--prev::before {
  margin-right: -3px;
  transform: rotate(225deg);
}

.work__next {
  right: -26px;
}

.work__prev {
  left: -26px;
}

.preview-slider__button {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
}

.preview-slider__button--prev {
  left: 12px;
}

.preview-slider__button--next {
  right: 12px;
}

.preview-slider__dots {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.preview-slider__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background-color: rgba(29, 39, 51, 0.5);
  cursor: pointer;
}

.preview-slider__dot.active {
  background-color: var(--warm);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(29, 39, 51, 0.92);
}

.image-viewer.active {
  display: flex;
}

.image-viewer__image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  cursor: zoom-out;
}

.image-viewer__close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #fff;
  background-color: rgba(29, 39, 51, 0.78);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

footer {
  width: 100%;
  margin-top: 80px;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: var(--accent-strong);
  font-weight: 600;
}

.hide {
  display: none;
}

@media screen and (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .nav {
    margin-top: 16px;
  }

  .nav__list {
    border-radius: 18px;
  }

  .list__item a {
    min-width: auto;
    padding: 7px 10px;
  }

  .welcome,
  .about,
  .contacts,
  .work {
    border-radius: 16px;
  }

  .welcome {
    margin-top: 18px;
    padding: 28px 18px;
  }

  .welcome__description {
    font-size: 17px;
  }

  .about,
  .contacts {
    padding: 26px 18px;
  }

  .contacts__list {
    gap: 12px;
  }

  .contact_icon {
    width: 72px;
    height: 72px;
    background-size: 50px;
  }

  .works {
    margin-bottom: 18px;
  }

  .works__description {
    font-size: 16px;
  }

  .works__slider {
    width: min(100% - 32px, 680px);
  }

  .work {
    min-height: 590px;
    padding: 24px 16px;
  }

  .work__title {
    padding-right: 42px;
    padding-left: 42px;
    font-size: 21px;
  }

  .work__description {
    min-height: 146px;
  }

  .work__image,
  .preview-slider {
    height: 260px;
  }

  .work__next,
  .work__prev {
    top: 31px;
    width: 34px;
    height: 34px;
    transform: none;
  }

  .work__next:hover,
  .work__prev:hover {
    transform: none;
  }

  .work__next {
    right: 16px;
  }

  .work__prev {
    left: 16px;
  }

  .work__next::before,
  .work__prev::before,
  .preview-slider__button::before {
    width: 9px;
    height: 9px;
    border-top-width: 2px;
    border-right-width: 2px;
  }

  .preview-slider__button {
    width: 32px;
    height: 32px;
  }

  footer {
    margin-top: 50px;
  }
}
