@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 430;
  font-style: normal;
  font-feature-settings:
    "cv01" 1,
    "ss07" 1,
    "ss08" 1;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
  font-weight: 430;
  font-style: italic;
  font-feature-settings:
    "cv01" 1,
    "ss07" 1,
    "ss08" 1;
}

:root {
  --color-background: #f5f5f5;
  --color-text: #222425;
  --color-text-weak: #858f8f;

  --color-foreground: #222425;
  --color-border-weak: #dbe0e0;

  --font-size-small: 13px;
  --line-height-small: 18px;

  --font-size-medium: 19px;
  --line-height-medium: 26px;

  --font-size-large: 48px;
  --line-height-large: 56px;

  --spacing-000: 0px;
  --spacing-012: 2px;
  --spacing-025: 4px;
  --spacing-037: 6px;
  --spacing-050: 8px;
  --spacing-075: 12px;
  --spacing-100: 16px;
  --spacing-150: 20px;
  --spacing-200: 24px;
  --spacing-300: 32px;
  --spacing-400: 48px;
  --spacing-500: 64px;
  --spacing-800: 96px;
}

a,
a:hover,
a:focus,
a:active {
  cursor: pointer;
}

img {
  border-radius: 1.5px;
}

.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;
}

html {
  background-color: var(--color-background);
  color: var(--color-text);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh; /* Use 100vh as a fallback if needed */
  width: auto;
  max-width: 1728px;
  margin: 0 auto;

  font-family: "Inter", sans-serif;
  font-size: var(--font-size-medium);
  line-height: var(--line-height-medium);
}

/* Main grid */

article,
footer {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  column-gap: var(--spacing-100);
  grid-auto-flow: row;
}

main {
  flex: 1; /* Takes up all available vertical space */
  align-items: start;
  padding: 0 var(--spacing-400);
}

h1 {
  font-size: var(--font-size-large);
  line-height: var(--line-height-large);
  margin-bottom: calc(var(--line-height-large) * 2);
}

header {
  padding: var(--spacing-200) var(--spacing-400) 0 var(--spacing-400);
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.menu ul {
  list-style: none;
}

.menu ul li {
  padding: var(--spacing-050) 0;
}

.logout-button {
  color: var(--color-text-weak);
}

.logout-button:hover {
  color: red;
  background: #e43a15; /* fallback 2 */
  background: -webkit-linear-gradient(
    to right,
    #e65245,
    #e43a15
  ); /* Fallback */
  background: linear-gradient(to right, #e65245, #e43a15);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

footer {
  font-size: var(--font-size-large);
  line-height: var(--line-height-large);
  color: var(--color-text-weak);
  padding: var(--spacing-200) var(--spacing-400);
  padding-top: var(--line-height-large);
}

footer * {
  grid-column: span 2;
}

footer a:hover {
  color: #0077b5;
  background: #7474bf; /* fallback 2 */
  background: -webkit-linear-gradient(
    to right,
    #0077b5,
    #7474bf
  ); /* Fallback */
  background: linear-gradient(to right, #0077b5, #7474bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

em {
  font-style: italic;
}

.site-title {
  font-size: var(--font-size-large);
  line-height: var(--line-height-large);
}

.about-section {
  font-size: var(--font-size-large);
  line-height: var(--line-height-large);
  color: var(--color-text-weak);
}

.about-section {
  margin-bottom: calc(var(--line-height-large) * 3);
}

.about-section a {
  color: var(--color-text-weak);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 0.03em;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.11em;
  text-decoration-color: var(--color-border-weak);
}

.about-section a:hover {
  text-decoration-color: inherit;
  background: #f2709c; /* fallback 2 */
  background: -webkit-linear-gradient(
    to right,
    #ff9472,
    #f2709c
  ); /* Fallback */
  background: linear-gradient(to right, #ff9472, #f2709c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-section,
.clients-section {
  margin-bottom: calc(var(--line-height-large) * 2);
}

.projects-section {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: start;
}

.projects-section h2 {
  grid-column: 1 / span 2;
  position: sticky;
  top: var(--spacing-200);
}

.project-list {
  grid-column: 3 / span 8;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--spacing-100);
  grid-auto-flow: row;
}

.project-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-050);
}

.project-card-title {
  text-wrap: balance;
}

.project-card figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.15s ease-in-out;
}

.project-card:hover figure img {
  transform: scale(1.015);
}

.project-card .project-card-client {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  color: var(--color-text-weak);
  margin-top: var(--spacing-012);
}

.clients-section {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
}

.clients-section > h2 {
  margin-top: var(--spacing-050);
  grid-column: 1 / span 2;
}

.client-list {
  grid-column: 3 / span 8;
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--spacing-050) var(--spacing-400);
}

.client-logo img {
  max-height: var(--line-height-large);
  width: auto;
}

/* login form */

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-100);
}

.login-form > * {
  max-width: 400px;
  width: 100%;
}

.login-form div {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-025);
}

.login-form input,
.login-form button {
  height: var(--spacing-400);
  border-radius: var(--spacing-050);
}

.login-form input[type="email"],
.login-form input[type="password"] {
  border: 1px solid var(--color-border-weak);
  padding: 0 var(--spacing-100);
  box-sizing: border-box;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  outline: solid var(--color-text) 2px;
}

.login-button input {
  background-color: var(--color-foreground);
  color: var(--color-background);
  text-align: center;
  display: inline-block;
  font-size: var(--font-size-medium);
  cursor: pointer;
}

.login-button input:active {
  opacity: 0.9;
}

.alert {
  color: red;
}

@media screen and (max-width: 1200px) {
  .project-article > .cards,
  .project-article > h1,
  .project-article > p,
  .project-info {
    grid-column: 2 / span 8;
    max-width: 680px;
  }
}

@media screen and (max-width: 800px) {
  :root {
    --font-size-small: 12px;
    --line-height-small: 17px;

    --font-size-medium: 18px;
    --line-height-medium: 24px;

    --font-size-large: 32px;
    --line-height-large: 37px;
  }

  main {
    padding: 0 var(--spacing-100);
  }

  header {
    padding: var(--spacing-075) var(--spacing-100) 0 var(--spacing-100);
  }

  .menu ul li {
    padding: var(--spacing-012) 0;
  }

  footer {
    padding: var(--spacing-050) var(--spacing-100);
  }

  footer * {
    grid-column: span 5;
  }

  .projects-section,
  .clients-section {
    display: flex;
    flex-direction: column;
  }

  .projects-section h2,
  .clients-section h2 {
    position: static;
    margin-bottom: var(--line-height-medium);
  }

  .project-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-200);
  }

  .client-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-037) var(--spacing-150);
  }

  .project-content {
    margin-top: var(--line-height-large);
  }

  .project-article > .cards,
  .project-article > h1,
  .project-article > p,
  .project-info,
  .project-article > figure {
    grid-column: 1 / span 10;
  }

  .project-article > .cards {
    display: flex;
    flex-direction: column;
  }
}
