:root {
  --color-background: #151515;
  --color-text: #fff;
  --color-primary: #99ffc0;
  --color-secondary: #888;
  --color-border: #555;
  --color-shadow: rgba(2, 2, 4, 0.79);
  --color-overlay: rgba(0, 0, 0, 0.65);

  --font-main: "Inter", sans-serif;
  --font-secondary: "Gilroy", sans-serif;

  --transition-default: all 0.3s ease;
  --transition-fast: all 0.25s ease;

  --border-radius-small: 10px;
  --border-radius-medium: 14px;
  --border-radius-large: 20px;
  --border-radius-xlarge: 30px;
  --border-radius-xxlarge: 50px;
}

/* Reset and base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

body {
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  margin: 0;
  padding: 40px 80px;
  background: var(--color-background);
  color: var(--color-text);
  scrollbar-width: thin;
  scrollbar-color: var(--color-secondary) var(--color-text);
}

h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

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

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

textarea:not([rows]) {
  min-height: 10em;
}

a {
  text-decoration: none;
}

:target {
  scroll-margin-block: 5ex;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-background);
}

::-webkit-scrollbar-thumb {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius-small);
  transition: var(--transition-default);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Typography */
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Light.woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("assets/fonts/Gilroy-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Header */
header {
  max-width: 100%;
  margin-top: 20px;
  padding: 20px 80px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transform: translateX(-50%);
  left: 50%;
  transition: var(--transition-default);
}

header.scrolled {
  max-width: 1440px;
  transform: translateX(-50%);
  left: 50%;
  padding: 20px 38px;
  background: var(--color-overlay);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-xlarge);
  border-top: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-background);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 40px;
  display: block;
}

.logo img {
  height: 40px;
  display: block;
}

.nav {
  flex-grow: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.nav__link {
  color: var(--color-text);
  font-size: 16px;
  font-style: normal;
  min-width: 50px;
  font-weight: 500;
  line-height: 125%;
  text-decoration: none;
  transition: var(--transition-default);
}

.nav__link:hover {
  color: var(--color-primary);
}

.cta-button {
  background: transparent;
  border-radius: var(--border-radius-medium);
  border: 2px solid var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
  display: flex;
  height: 40px;
  padding: 0 15px 2px 15px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 125%;
}

.cta-button:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-background);
}

/* Hero section */
.hero {
  padding: 180px 0 140px;
  text-align: center;
}

.hero__content {
  padding: 0;
  max-width: 1440px;
  margin: 0 auto;
}

.hero h1 {
  color: var(--color-text);
  text-align: center;
  font-family: var(--font-secondary);
  font-size: 100px;
  font-style: normal;
  font-weight: 400;
  line-height: 125%;
  margin: 0 0 30px;
}

.hero p {
  color: var(--color-primary);
  text-align: center;
  font-size: 28px;
  font-style: normal;
  font-weight: 300;
  line-height: 125%;
}

.hero-bg {
  position: relative;
  height: 1250px;
  width: 100%;
  margin-top: 140px;
  border-radius: var(--border-radius-xxlarge);
  background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.2) 100%
    ),
    url(assets/hero-bg.webp) var(--color-background) 50% / cover no-repeat;
  box-shadow: 0 370.669px 103.35px 0 rgba(2, 2, 4, 0.01),
    0 237.506px 94.406px 0 rgba(2, 2, 4, 0.12),
    0 133.162px 79.5px 0 rgba(2, 2, 4, 0.4),
    0 59.625px 59.625px 0 rgba(2, 2, 4, 0.68),
    0 14.906px 32.794px 0 var(--color-shadow);
}

.hero-bg::after {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: "";
  background: url(assets/hero-bg.webp) var(--color-background) 50% / cover
    no-repeat;
  filter: blur(200px);
  z-index: -1;
}

.hero-logo {
  position: absolute;
  display: block;
  width: 900px;
  height: 310px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Typography */
h2 {
  margin-bottom: 30px;
  color: #f2f2f2;
  text-align: center;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 125%;
  margin: 0 0 60px;
}

/* Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 30px;
  width: 100%;
  margin: 0 auto;
}

.grid-item {
  cursor: pointer;
  width: 100%;
  height: 465px;
  background-color: #222;
  border-radius: var(--border-radius-large);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: var(--transition-default);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.grid-item:nth-child(1) {
  border-radius: 50px 20px 20px 20px;
}

.grid-item:nth-child(4) {
  border-radius: 20px 50px 20px 20px;
}

.grid-item:nth-child(5) {
  border-radius: 20px 20px 50px 20px;
}

.grid-item:nth-child(8) {
  border-radius: 20px 20px 20px 50px;
}

.grid-item img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.grid-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Clients section */
.clients-container {
  overflow: hidden;
  position: relative;
  margin: 140px 0;
}

.clients-wrapper {
  display: flex;
  width: max-content;
}

.clients {
  display: flex;
  align-items: center;
}

.clients img {
  flex-shrink: 0;
  margin-right: 90px;
}

.clients-container::before,
.clients-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  z-index: 2;
}

.clients-container::before {
  left: 0;
  background: linear-gradient(to right, var(--color-background), transparent);
}

.clients-container::after {
  right: 0;
  background: linear-gradient(to left, var(--color-background), transparent);
}

/* Service section */
.service {
  background: var(--color-text);
  border-radius: var(--border-radius-xxlarge);
  padding: 100px 80px;
  margin-bottom: 140px;
}

.services-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
}

.service h2 {
  color: var(--color-background);
}

.service-item__cover {
  flex: 1;
  display: flex;
  align-items: flex-start;
  flex-flow: column nowrap;
  justify-content: flex-start;
}

.service-item__cover img {
  height: 100%;
  max-height: 180px;
  max-width: 180px;
}

.service-item h3 {
  font-size: 28px;
  line-height: 125%;
  margin-bottom: 0;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
}

.service-item p {
  max-width: 70%;
  width: 100%;
  font-size: 14px;
  color: #333;
}

.service-item {
  display: flex;
  flex-flow: column nowrap;
  justify-content: flex-end;
  min-height: 440px;
  background: rgba(0, 0, 0, 0.15);
  padding: 40px;
  border-radius: 40px;
  flex: 1;
}

.service-item:nth-child(1) {
  background: #ddffa3;
}

.service-item:nth-child(2) {
  background: #fdf0da;
}

.service-item:nth-child(3) {
  background: #d7dfff;
}

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

/* Contact form */
.contact-form {
  padding: 100px 0;
  text-align: center;
}

#contactForm {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.form-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-column {
  flex: 1;
}

/* Contact form (continued) */
.form-group:not(:last-child) {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-small);
  background: var(--color-background);
  color: var(--color-text);
  font-size: 16px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-secondary);
}

.form-group textarea {
  height: 100%;
  min-height: 165px;
  resize: vertical;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.consent-text {
  font-size: 14px;
  color: var(--color-secondary);
  flex: 1;
  margin-right: 20px;
}

.submit-button {
  background: var(--color-primary);
  color: var(--color-background);
  border: none;
  padding: 15px 30px;
  border-radius: var(--border-radius-medium);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-default);
}

.submit-button:hover {
  background: #77cc99;
}

.form-message {
  margin-top: 20px;
  color: var(--color-primary);
  font-size: 18px;
}

/* Footer */
.footer {
  background: var(--color-background);
  padding: 40px 80px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.footer-logo img {
  height: 40px;
}

.scroll-to-top {
  color: var(--color-primary);
  font-size: 24px;
  text-decoration: none;
}

.contact-info {
  color: var(--color-text);
  font-size: 16px;
}

.contact-info a {
  color: var(--color-primary);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Modal */
.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a1a;
  padding: 1rem;
  border-radius: var(--border-radius-small);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  max-width: 80vw;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  transform-origin: center;
  will-change: transform, opacity;
}

.modal-content img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.modal-content p {
  color: var(--color-text);
  margin-top: 1rem;
  font-size: 16px;
  line-height: 1.5;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: var(--color-text);
  border: none;
  font-size: 24px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-default);
}

.close-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal {
  background: transparent;
  border: none;
  padding: 0;
}

/* Media queries */
@media (max-width: 1024px) {
  .service {
    padding: 80px 40px;
  }

  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-item {
    height: 385px;
  }

  .service-item {
    padding: 30px;
    min-height: auto;
  }

  .service-item__cover {
    max-height: 180px;
  }

  .service-item__cover img {
    height: 180px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 20px 40px;
  }

  header {
    padding: 20px 30px;
  }

  header.scrolled {
    padding: 10px 20px;
  }

  .logo {
    min-width: 80px;
    margin-right: 15px;
  }

  .nav {
    margin-right: 15px;
    gap: 20px;
  }

  .cta-button {
    text-align: center;
    padding: 0 10px;
    line-height: 1;
  }
  .hero h1 {
    font-size: 40px;
  }

  .hero-bg {
    height: 60vh;
  }

  .hero-logo {
    height: auto;
  }

  .hero p {
    font-size: 20px;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }

  .grid-item {
    height: 305px;
  }

  .services-container {
    padding: 40px 30px;
    flex-direction: column;
    align-items: center;
  }

  .service h2 {
    margin: 0 0 10px;
  }

  .service {
    padding: 30px 0;
  }

  .service-item {
    padding: 30px;
    min-height: auto;
  }

  .service-item__cover {
    max-height: 100px;
  }

  .service-item__cover img {
    height: 100px;
  }

  .service-item h3 {
    margin-top: 10px;
  }
  .service-item p {
    max-width: 90%;
  }

  #contactForm {
    width: 90%;
  }

  .form-container {
    flex-direction: column;
  }

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

  .consent-text {
    margin-right: 0;
    margin-bottom: 20px;
    text-align: center;
  }

  .submit-button {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
  }

  .modal-content {
    flex-direction: column;
    padding: 0.5rem;
  }

  .modal-content img {
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .modal-content p {
    margin-left: 0;
  }

  .close-button {
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 20px 30px;
  }

  .services-container {
    padding: 30px 20px
  }
  .service {
    margin-bottom: 70px;
  }
  .service h2 {
    margin: 0;
  }

  .hero {
    padding: 120px 0 100px;
  }

  .hero-bg {
    margin-top: 100px;
  }

  .portfolio h2 {
    margin-bottom: 30px;
  }

  .grid-container {
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-item {
    height: 200px;
  }

  .contact-form {
    padding-bottom: 50px;
  }
}


@media (max-width: 410px) {
  .header.scrolled {
    padding: 10px 10px;
  }

  .nav__link,
  .cta-button{
    font-size: 14px;
  }

  .nav {
    gap: 10px
  }
}
