:root {
  --color-surface-page: #faf8f5;
  --color-surface-subtle: #f3efe9;
  --color-surface-inverse: #803e28;
  --color-content-primary: #512a1d;
  --color-content-secondary: #63584b;
  --color-content-muted: #9a8c79;
  --color-content-inverse: #faf8f5;
  --color-content-accent: #2c7a5e;
  --color-content-on-media: #fff;
  --color-button-text: #2c7a5e;
  --font-serif: "EB Garamond", Georgia, serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
  --shadow-emboss: -1px -1px 0 0 rgb(255 255 255 / 0.9), 1px 1px 1px 0 rgb(125 112 95 / 0.3);
  --inset-shadow-deboss: inset 1px 1px 2px 0 rgb(125 112 95 / 0.25), inset -1px -1px 0 0 rgb(255 255 255 / 0.9);
  --page: 1280px;
  --pad: 80px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-surface-page);
  background-image: url("../img/pattern-tile.png");
  background-repeat: repeat;
  background-position: left top;
  background-size: calc(819 / 1440 * 100vw) auto;
  color: var(--color-content-primary);
  font-family: var(--font-serif);
}

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

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

button, input { font: inherit; }

.container {
  width: min(var(--page), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--color-surface-page);
  background-image: url("../img/pattern-tile.png");
  background-repeat: repeat;
  background-position: left top;
  background-size: calc(819 / 1440 * 100vw) auto;
  padding: 20px 0 50px;
}

.header__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 100px;
}

.header__phone,
.header__tools,
.header__tools a {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.header__phone { color: var(--color-content-primary); }

.header__tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  color: var(--color-content-secondary);
}

.header__search {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-content-primary);
  cursor: pointer;
}

.header__nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}

.header__nav a {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-content-primary);
}

.hero {
  position: relative;
  height: 810px;
  overflow: hidden;
  color: var(--color-content-on-media);
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 160px 84px;
  text-align: center;
}

.hero h1 {
  max-width: 544px;
  margin: 0;
  font-weight: 500;
  font-style: italic;
  font-size: 72px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-content-inverse);
}

.hero p {
  max-width: 460px;
  margin: 200px 0 0;
  font-weight: 500;
  font-style: italic;
  font-size: 24px;
  line-height: 1.25;
}

.hero__link {
  margin-top: 200px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.slogans {
  padding: 96px 240px;
  text-align: center;
}

.slogans h2,
.catalog__title,
.contacts h2 {
  margin: 0;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -0.005em;
}

.slogans__lead,
.catalog__more {
  margin: 24px 0 0;
  font-weight: 400;
  font-style: italic;
  font-size: 36px;
  line-height: 1.15;
}

.slogans__text {
  margin: 24px 0 0;
  color: var(--color-content-secondary);
  font-size: 24px;
  line-height: 1.45;
}

.directions { padding: 80px 0; }

.directions__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tile {
  position: relative;
  display: block;
  height: 420px;
  overflow: hidden;
  color: #fff;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile span {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  font-weight: 500;
  font-style: italic;
  font-size: 36px;
  line-height: 1.15;
}

.catalog { padding: 96px 0; }

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.card h3 {
  margin: 12px 0 0;
  font-weight: 500;
  font-style: normal;
  font-size: 24px;
  line-height: 1.25;
}

.card p {
  margin: 12px 0 0;
  color: var(--color-content-secondary);
  font-size: 18px;
  line-height: 1.5;
}

.card__photo {
  display: block;
  height: 520px;
  overflow: hidden;
  background: var(--color-surface-subtle);
}

.card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-content-muted);
}

.card__price {
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-content-accent);
}

.catalog__more { display: inline-block; }

.contacts {
  background: var(--color-surface-subtle);
  padding: 30px 0 96px;
}

.contacts__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.contacts__text p,
.contacts address {
  max-width: 600px;
  margin: 24px 0 0;
  font-size: 20px;
  line-height: 1.5;
  font-style: normal;
}

.contacts__text > p { color: var(--color-content-secondary); }

.contacts address {
  display: flex;
  flex-direction: column;
  color: var(--color-content-primary);
}

.contacts__messengers {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-content-accent);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 0;
}

.field { position: relative; }

.field input {
  width: 100%;
  padding: 16px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-content-primary);
  font-size: 18px;
  line-height: 1.5;
}

.field::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-emboss);
}

.field input::placeholder { color: var(--color-content-muted); }

.field input:focus {
  outline: none;
}

.btn {
  height: 61px;
  border-style: solid;
  border-width: 6px;
  border-color: transparent;
  border-image-source: url("../img/btn-rim.png");
  border-image-slice: 12;
  border-image-repeat: stretch;
  background: transparent;
  color: var(--color-button-text);
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.footer {
  background: var(--color-surface-inverse);
  color: var(--color-content-inverse);
  padding: 80px 0;
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer__nav,
.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__nav a {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer__contacts {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

.footer__legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 128px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer__legal p { margin: 0; }

.footer__mark { margin-top: 48px; }

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

.header__side {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__burger,
.header__search--tablet,
.header__call {
  display: none;
}

.header__burger {
  width: 22px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.header__burger span {
  display: block;
  height: 1.5px;
  background: var(--color-content-primary);
}

.header__call {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-content-primary);
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.menu__dim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(82 41 28 / 0.35);
  opacity: 0;
  transition: opacity 300ms ease-out;
  cursor: pointer;
}

.menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100%;
  background: var(--color-surface-page);
  transform: translateX(100%);
  transition: transform 300ms ease-out;
}

.menu.is-open .menu__dim { opacity: 1; }

.menu.is-open .menu__panel { transform: none; }

.header__top { position: relative; }

.header__find {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  gap: 14px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #d5cbbd;
  color: var(--color-content-primary);
  font-size: 18px;
}

.header.is-search .header__phone,
.header.is-search .header__logo,
.header.is-search .header__tools,
.header.is-search .header__burger,
.header.is-search .header__search--tablet { visibility: hidden; }

.header.is-search .header__find { display: flex; }

.header__find input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--color-content-primary);
  font-family: var(--font-serif);
  font-size: inherit;
  line-height: 1.5;
}

.header__find input::placeholder { color: var(--color-content-muted); }

.header__find input:focus { outline: none; }

.header__find-close {
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-content-primary);
  cursor: pointer;
}

.menu__top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 64px;
  padding: 0 40px;
}

.menu__logo { display: none; }

.menu__close {
  border: 0;
  background: none;
  color: var(--color-content-primary);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.menu__nav {
  display: flex;
  flex-direction: column;
  padding: 32px 40px 0;
}

.menu__nav a {
  padding-top: 18px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  color: var(--color-content-primary);
}

.menu__nav a::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 14px;
  background: var(--color-surface-page);
  box-shadow: var(--shadow-emboss);
}

.menu__contacts {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 40px 40px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.5;
}

.menu__contacts a:nth-child(2) {
  color: var(--color-content-secondary);
  font-size: 17px;
}

.menu__contacts p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-content-accent);
}

body.menu-open { overflow: hidden; }

@media (max-width: 1023px) {
  :root { --pad: 40px; }

  .header { padding: 0; }

  .header__top { min-height: 72px; }

  .header__phone,
  .header__nav,
  .header__tools > a:not(.header__call),
  .header__tools > .header__search { display: none; }

  .header__burger,
  .header__search--tablet,
  .header__call { display: flex; }

  .header__find { font-size: 17px; }

  .header__logo img { width: 180px; height: auto; }

  .hero { height: 600px; }

  .hero__content { padding: 52px 40px 40px; }

  .hero h1 {
    max-width: 508px;
    font-size: 56px;
  }

  .hero p {
    max-width: 508px;
    margin-top: 160px;
    font-size: 22px;
  }

  .hero__link { margin-top: 160px; }

  .slogans { padding: 72px 40px; }

  .slogans h2,
  .catalog__title,
  .contacts h2 { font-size: 40px; }

  .slogans__lead,
  .catalog__more { font-size: 32px; }

  .slogans__text { font-size: 19px; }

  .directions { padding: 48px 0; }

  .directions__grid { gap: 16px; }

  .tile { height: 300px; }

  .tile span {
    left: 20px;
    right: 20px;
    bottom: 20px;
    font-size: 22px;
  }

  .catalog { padding: 72px 0; }

  .card__photo { height: 180px; }

  .card h3 { font-size: 22px; }

  .card p { font-size: 17px; }

  .contacts { padding: 72px 0; }

  .contacts__grid { gap: 40px; }

  .contacts__text p,
  .contacts address { font-size: 19px; }

  .footer { padding: 56px 0; }

  .footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-top: 48px;
  }

  .footer__mark { margin-top: 48px; }
}

@media (max-width: 767px) {
  :root { --pad: 20px; }

  .header__top { min-height: 64px; }

  .header__logo img { width: 140px; }

  .header__find { font-size: 16px; }

  .header__call { font-size: 13px; }

  .hero { height: 600px; }

  .hero__content { padding: 66px 20px 66px; }

  .hero h1 {
    max-width: 350px;
    font-size: 40px;
  }

  .hero p {
    max-width: 350px;
    margin-top: 120px;
    font-size: 20px;
  }

  .hero__link {
    margin-top: 140px;
    font-size: 13px;
  }

  .slogans { padding: 56px 20px; }

  .slogans h2,
  .catalog__title,
  .contacts h2 { font-size: 34px; }

  .slogans__lead,
  .catalog__more { font-size: 28px; }

  .slogans__text,
  .contacts__text p,
  .contacts address { font-size: 18px; }

  .directions { padding: 40px 0; }

  .directions__grid { grid-template-columns: 1fr; gap: 16px; }

  .tile { height: 300px; }

  .tile span {
    left: 32px;
    right: 32px;
    bottom: 32px;
    font-size: 28px;
  }

  .catalog { padding: 56px 0; }

  .catalog .container { width: calc(100% - 20px); margin-right: 0; margin-left: 20px; }

  .catalog__grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-top: 24px;
    padding-right: 20px;
  }

  .card {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }

  .card__photo { height: 260px; }

  .card h3 { font-size: 20px; }

  .card p { font-size: 16px; }

  .card__meta { font-size: 13px; }

  .contacts { padding: 56px 0; }

  .contacts__grid { grid-template-columns: 1fr; gap: 40px; }

  .field input { font-size: 16px; }

  .btn { font-size: 17px; }

  .footer { padding: 48px 0; }

  .footer__top {
    flex-direction: column;
    gap: 32px;
  }

  .footer__nav a,
  .footer__contacts { font-size: 13px; }

  .footer__contacts { text-align: left; }

  .footer__legal { font-size: 11px; }

  .menu__dim { display: none; }

  .menu__panel { width: 100%; }

  .menu__top {
    justify-content: space-between;
    padding: 0 20px;
  }

  .menu__logo {
    display: block;
    width: 140px;
    height: auto;
  }

  .menu__nav { padding: 32px 20px 0; }

  .menu__nav a { font-size: 28px; }

  .menu__contacts { padding: 0 20px 40px; }
}
