/* RESET */
/* https://www.joshwcomeau.com/css/custom-css-reset/ */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* BASE STYLES */

:root {
  --accent-color: #f6ce31;
  --background-color: #fff;
  --border-color: #ddd;
  --inverse-background-color: #222;
  --inverse-text-color: #fff;
  --text-color: #222;
}

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  color: var(--text-color);
  cursor: url('../img/cursor.svg'), auto;
  font-family: "futura-pt", sans-serif;
  font-style: normal;
  font-weight: 400;
}

h1, h2 {
  font-family: "clarendon-urw-extra-wide", serif;
  font-weight: 300;
}

a.button {
  align-items: center;
  background-color: var(--inverse-background-color);
  color: var(--inverse-text-color);
  cursor: url('../img/triangle.svg'), auto;
  display: flex;
  font-size: 1.5rem;
  gap: 1rem;
  padding: 1rem 3rem;
  text-decoration: none;
  text-transform: uppercase;
  width: fit-content;
}

a.button img {
  height: 1.5rem;
  width: auto;
}

a.button:hover {
  background-color: var(--accent-color);
  color: var(--text-color);
  cursor: url('../img/alt-triangle.svg'), auto;
}

a.button:hover img {
  fill: var(--text-color);
}

/* HEADER STYLES */

header {
  align-items: center;
  background-color: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  padding: 2rem 8rem;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
}

header a {
  color: var(--text-color);
  cursor: url('../img/triangle.svg'), auto;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

header a:hover {
  color: var(--accent-color);
}

h1 {
  font-size: 2rem;
  transition: all 0.2s ease-out;
}

h1:hover {
  color: var(--accent-color);
}

nav ul {
  display: flex;
  font-size: 1.25rem;
  gap: 2rem;
  letter-spacing: 0.1rem;
  list-style: none;
  text-transform: uppercase;
}

#menu-button {
  display: none;
}

/* MAIN STYLES */

main, main section {
  display: flex;
  flex-direction: column;
}

main {
  gap: 8rem;
  padding: 4rem 8rem;
}

main section {
  align-items: center;
  gap: 2rem;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 1.5rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
}

p {
  font-size: 1.75rem;
  max-width: 30em;
}

/* FORM STYLES */

form {
  align-items: center;
  display: flex;
  font-size: 1.5rem;
  flex-direction: column;
  padding: 1rem 0;
  gap: 2rem;
}

form input, form textarea {
  border: 1px solid var(--border-color);
  padding: 1rem;
  width: 30em;
}

form input:focus, form textarea:focus {
  border-color: var(--accent-color);
  outline: none;
}

form textarea {
  resize: vertical;
}

form button {
  background-color: var(--inverse-background-color);
  border: none;
  color: var(--inverse-text-color);
  cursor: url('../img/cursor.svg'), auto;
  padding: 1rem 3rem;
  text-transform: uppercase;
  width: fit-content;
}

form button:hover {
  background-color: var(--accent-color);
  color: var(--text-color);
  cursor: url('../img/alt-triangle.svg'), auto;
}

/* HERO STYLES */

#hero p {
  padding-top: 2rem;
}

#letters {
  display: flex;
  gap: 100px;
  position: relative;
}

#d, #t, #t-top, #t-vert {
  overflow: hidden;
  position: relative;
}

#d, #t {
  height: 300px;
  transition: all 1s ease-out;
  width: 200px;
}

#d {
  background-color: var(--inverse-background-color);
  border-radius: 0 150px 150px 0;
}

#letters:after {
  background: radial-gradient(circle closest-side, var(--accent-color), transparent);
  content: "";
  height: 60px;
  left: 200px;
  position: absolute;
  top: 40px;
  width: 60px;
  transform: scale(0);
}

#letters:hover {
  cursor: url('../img/square.svg'), auto;
}

#letters:hover:after {
  animation: shine 1s ease-out 0.5s forwards;
}

#letters:hover #d {
  transform: rotate(5deg) translateX(60px);
}

#letters:hover #t {
  transform: rotate(-5deg) translateX(-60px);
}

#t-top, #t-vert {
  background-color: var(--inverse-background-color);
}

#t-top {
  height: 60px;
  width: 100%;
}

#t-vert {
  height: 241px;
  margin: 0 auto;
  position: relative;
  top: -1px;
  width: 60px;
}

/* FOOTER STYLES */

footer {
  background-color: var(--inverse-background-color);
  color: var(--inverse-text-color);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 2rem 8rem;
}

footer a {
  color: var(--inverse-text-color);
  cursor: url('../img/cursor.svg'), auto;
}

footer a:hover {
  color: var(--accent-color);
  cursor: url('../img/triangle.svg'), auto;
}

/* ANIMATIONS */

@keyframes move-left {
  100% {
    transform: rotate(-5deg) translateX(-30px);
  }
}

@keyframes move-right {
  100% {
    transform: rotate(5deg) translateX(30px);
  }
}

@keyframes shine {
  30% {
    opacity: 1;
    transform: scale(1);
  }
  99% {
    opacity: 0;
    transform: scale(25);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

/* PHONE */

@media (max-width: 599px) {
  header {
    flex-direction: column;
    transition: all 0.2s ease-out;
  }

  #top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    transition: all 0.2s ease-out;
    width: 100%;
  }

  h1 {
    font-size: 1.5rem;
  }

  #menu-button {
    background-color: var(--accent-color);
    display: block;
    transition: transform 0.2s ease-out;
  }

  nav {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.2s ease-out;
  }

  nav ul {
    align-items: center;
    flex-direction: column;
    gap: 4rem;
    padding: 4rem 0;
  }

  header.active #top {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
  }

  header.active #menu-button {
    transform: rotate(90deg);
  }

  header.active nav {
    height: auto;
    opacity: 1;
  }

  main {
    padding: 4rem 2rem;
    text-align: center;
    overflow-x: hidden;
  }

  h2 { 
    font-size: 2.5rem;
  }

  #letters {
    gap: 50px;
  }

  #d, #t {
    height: 150px;
    transition: none;
    width: 100px;
  }

  #d {
    border-radius: 0 75px 75px 0;
  }

  #letters:after {
    height: 30px;
    left: 100px;
    top: 20px;
    width: 30px;
  }

  #letters:hover:after {
    animation: none;
  }

  #letters:hover #d, #letters:hover #t {
    transform: none;
  }

  #letters:after {
    animation: shine 1s ease-out 0.5s forwards;
  }

  #letters #d {
    animation: move-right 1s ease-out forwards;
  }

  #letters #t {
    animation: move-left 1s ease-out forwards;
  }

  #t-top {
    height: 30px;
  }

  #t-vert {
    height: 121px;
    width: 30px;
  }

  form input, form textarea {
    width: 100%;
  }
}

/* TABLET */

@media (max-width: 899px) {
  header, footer {
    padding: 2rem;
  }
}
