/* Base: reset, shared tokens, header, footer, utilities */

:root {
  --font-hind: "Hind Madurai", system-ui, sans-serif;
  --font-lora: "Lora", Georgia, serif;
  --font-montserrat: "Montserrat", system-ui, sans-serif;

  --color-black: #000;
  --color-white: #fff;
  --color-footer-bg: #121212;
  --color-footer-text: rgba(255, 255, 255, 0.8);

  /* Side padding of the content column (40 px in all mockups) */
  --gutter: 40px;
  /* Max width of the content column without gutters; each page overrides it */
  --content-max: 1200px;
}

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

/* Reset */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-hind);
  color: var(--color-black);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Utilities */

.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Small uppercase links: header contacts, footer contacts, "Back to portfolio" */

.nav-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-hind);
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.nav-link:hover {
  opacity: 0.7;
}

.nav-link__light {
  font-weight: 300;
}

.back-link {
  gap: 8px;
}

/* Header */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.contacts {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Home: black text over the hero gradient, no background */
.site-header--home {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  padding-top: 69px;
}

.site-header--home .site-header__inner {
  justify-content: flex-end;
}

/* Case studies: black bar, 104 px tall */
.site-header--case {
  background: var(--color-black);
  color: var(--color-white);
  padding-block: 40px;
}

@media (max-width: 767px) {
  .site-header--home {
    padding-top: 32px;
  }

  .site-header--case {
    padding-block: 24px;
  }

  .site-header--case .site-header__inner {
    flex-wrap: wrap;
  }
}

/* Footer */

.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding-block: 120px 160px;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.site-footer__title {
  max-width: 791px;
  font-family: var(--font-lora);
  font-style: italic;
  font-weight: 400;
  font-size: 48px;
  line-height: 52px;
}

.site-footer__text {
  max-width: 586px;
  font-size: 20px;
  line-height: 28px;
}

.site-footer .contacts {
  flex-wrap: wrap;
  row-gap: 8px;
}

.site-footer .contacts .nav-link {
  gap: 2px;
}

/* Case studies: "Back to portfolio or" above the title */
.site-footer--case {
  padding-top: 54px;
}

.site-footer__back {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  color: var(--color-white);
}

.site-footer__back .nav-link:not(a):hover {
  opacity: 1;
}

@media (max-width: 767px) {
  .site-footer {
    padding-block: 80px 96px;
  }

  .site-footer--case {
    padding-top: 40px;
  }

  .site-footer__title {
    font-size: 40px;
    line-height: 44px;
  }
}
