/* Base styles for the application */
:root {
  --primary-color: #6b4226; /* Rich brown */
  --secondary-color: #a67c52; /* Earthy tan */
  --accent-color: #deb876; /* Soft gold */
  --background-color: #f4f1ee; /* Light earth */
  --text-colo: #dacccc;
  --text-color2: #2c1b0f;
}

/* Global styles */
html {
  margin: 0;
  padding: 0;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth !important;
}
body {
  width: 100%;
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  margin: 0 auto;
  padding: 0;
  color: var(--text-colo);
  background: var(--background-color);
  scroll-behavior: smooth;
}

h1, h2, h3 {
  font-family: "Poppins", sans-serif;
}

a {
  text-decoration: none;
  color: var(--text-colo);
}

/* Common header styles */
.header {
  position: sticky;
  top: 0;
  display: flex;
  flex: auto;
  justify-content: space-between;
  padding: 15px 10px 0 30px;
  transition: all 0.8s ease;
  z-index: 999;
}

.header a:first-of-type {
  place-self: center;
}
.logo {
  width: 100px;
  height: auto;
  margin-bottom: 2px;
}

.parallelogram {
  width: 100%;
  /* height: 150px; */
  background-color: var(--primary-color);
  clip-path: polygon(
    10% 0,
    /* top-left */ 100% 0,
    /* top-right */ 100% 100%,
    /* lower-right offset */ 100% 100%,
    /* bottom right inner corner */ 25% 100%,
    /* bottom left inner corner */ 0 100% /* lower-left offset */
  );
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  overflow: hidden;
  font-weight: bold;
  margin: 4rem 0 10px 100px;
}

nav {
  gap: 10px;
  padding: 10px 8px 10px 60px;
}

nav a {
  color: var(--accent-color);
  padding: 10px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

nav a:hover {
  color: var(--secondary-color);
  border-bottom: 2px solid var(--text-colo);
}

header .active {
  color: var(--text-colo);
  border-bottom: 4px solid var(--text-colo);
}

/* hamburger */
#menu {
  display: none;
}

/* triggered on scroll: start*/
.scroll {
  background-color: var(--background-color);
}

/* Light theme after scroll */
.header.scrolled {
  background-color: #f9f9f9;
  color: #0c1e29;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hidden when scrolling down */
.header.hide {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.scroll-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.snap-section {
  scroll-snap-align: start;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  box-sizing: border-box;
}
/* triggered on scroll: end*/

/* Footer */
footer {
  display: grid;
  grid-template-rows: 4fr 1fr;
  padding: 20px 30px 20px 30px;
  background: var(--background);
  color: var(--text-color2);
  place-items: center;
  gap: 20px;
  border-top: 2px solid var(--primary-color);
}

footer a {
  color: var(--text-color2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 8fr;
  gap: 7rem;
}

#footer-logo {
  width: 180px;
  height: auto;
}
.footer-social img {
  width: 100%;
  height: auto;
}

.social-icons {
  display: flex;
  justify-content: space-between;
}
.social-icons a {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-info {
  display: flex;
  justify-content: flex-end;
  gap: 100px;
}

.footer-info h2 {
  border-bottom: 2px solid var(--primary-color);
  width: 130px;
}

.links {
  display: flex;
  flex-direction: column;
}

.links a,
.links p {
  line-height: 30px;
  margin: 0;
}

.links a:hover {
  border-bottom: 2px solid var(--primary-color);
}

/* Animations */

/* Write letter by letter animation: buggy */
.typewriter {
  overflow: hidden;
  border-right: 2px solid #e7b06c;
  white-space: nowrap;
  letter-spacing: 2px;
  animation: typing 3s steps(30, end), blink 0.75s step-end infinite;
  width: 0; /* Start with no width */
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Slide in from the left animation */
.slide-in-left {
  opacity: 0;
  transform: translateX(-200px);
  animation: slideLeft 2s ease-out forwards;
}

@keyframes slideLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from the right animation */
.slide-in-right {
  opacity: 0;
  transform: translateX(100px);
  animation: slideRight 2s ease-out forwards;
}

@keyframes slideRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animated-headline span {
  opacity: 0;
  transform: translateY(20px);
  display: inline-block;
  animation: fadeInWords 0.6s ease forwards;
}

.animated-headline span:nth-child(1) {
  animation-delay: 0.2s;
}
.animated-headline span:nth-child(2) {
  animation-delay: 0.4s;
}
.animated-headline span:nth-child(3) {
  animation-delay: 0.6s;
}
.animated-headline span:nth-child(4) {
  animation-delay: 0.8s;
}
.animated-headline span:nth-child(5) {
  animation-delay: 1s;
}
.animated-headline span:nth-child(6) {
  animation-delay: 1.2s;
}

@keyframes fadeInWords {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* media queries */

/* Base styles for the application */
@media screen and (max-width: 500px) {
  body {
    max-width: 500px;
  }

  /* header and nav */
  .header {
    position: relative;
    padding: 15px 10px 0 20px;
    font-size: 20px;
  }
  .logo {
    width: 80px;
    margin-bottom: 10px;
  }

  /* hamburger */
  #menu {
    display: block;
    position: absolute;
    top: 1px;
    text-decoration: none;
    right: 30px;
  }
  #menu::before {
    content: "≡";
    font-size: 3rem;
    font-weight: 700;
    padding-right: 0;
    background-color: inherit;
    color: var(--card-color);
  }
  #menu.show::before {
    content: "✖";
    font-size: 2.5rem;
  }

  /* nav */
  .parallelogram {
    clip-path: none;
    background: none;
    display: grid;
    grid-template-rows: 0fr;
    transition: all 0.5s ease-out;
  }
  nav a {
    display: none;
  }
  .show.parallelogram {
    margin: 0;
    padding: 0;
    grid-template-rows: 1fr;
    position: absolute;
    top: 100px;
    right: 0;
    width: 100%;
    z-index: 20;
    background-image: linear-gradient(to right, var(--primary-color), #e4e6e5);
  }
  nav.show a {
    display: block;
    text-align: center;
    color: var(--text-color2);
    padding: 10px;
  }

  /* footer */
  footer {
    padding: 20px 10px;
    font-size: 0.8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }

  .social-icons {
    justify-content: center;
    gap: 60px;
  }

  .footer-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer-contact {
    align-items: flex-start;
  }
}
