/*
Color Variables
*/

:root {
  font-size: clamp(14px, 2vw, 18px);
  /* Core colors */
  --primary: hsl(39, 100%, 50%);
  --secondary: hsl(33, 100%, 50%);
  --accent: hsl(34, 78%, 91%);

  /* Color variations using opacity/lightness */
  --primary-100: hsl(39, 100%, 90%);
  --primary-200: hsl(39, 100%, 80%);
  --primary-300: hsl(39, 100%, 70%);
  --primary-400: hsl(39, 100%, 60%);
  --primary-500: var(--primary);
  --primary-600: hsl(39, 100%, 50%);
  --primary-700: hsl(39, 100%, 40%);
  --primary-800: hsl(39, 100%, 30%);
  --primary-900: hsl(39, 100%, 20%);

  --secondary-100: hsl(33, 100%, 90%);
  --secondary-200: hsl(33, 100%, 80%);
  --secondary-300: hsl(33, 100%, 70%);
  --secondary-400: hsl(33, 100%, 60%);
  --secondary-500: var(--secondary);

  --accent-100: hsl(34, 78%, 90%);
  --accent-200: hsl(34, 78%, 80%);
  --accent-300: hsl(34, 78%, 70%);
  --accent-400: hsl(34, 78%, 60%);
  --accent-500: var(--accent);

  /* Background colors */
  --bg-primary: hsl(0, 0%, 10%); /* Main background */
  --bg-secondary: hsl(0, 0%, 15%); /* Secondary background for contrast */

  --bg-light-primary: hsl(0, 0%, 90%); /* Light background for contrast */
  --bg-light-secondary: hsl(0, 0%, 95%); /* Light background for contrast */

  /* Text colors */
  --text-primary: hsl(34, 78%, 91%);
  --text-secondary: hsl(0, 0%, 96%);

  --text-light-primary: hsl(34, 78%, 91%);
  --text-light-secondary: hsl(0, 0%, 96%);

  /* Interactive elements */
  --link: var(--primary);
  --link-hover: var(--secondary);

  /* Optional: semantic colors */
  --success: hsl(120, 60%, 50%);
  --warning: hsl(40, 100%, 50%);
  --error: hsl(0, 100%, 50%);
}

.vue-link {
  color: #42b883;
}
.nuxt-link {
  color: #00dc82;
}
.node-link {
  color: #339933;
}
.ts-link {
  color: #3178c6;
}
.pg-link {
  color: #336791;
}
.supabase-link {
  color: #3ecf8e;
}
.python-link {
  color: #3572a5;
}
.deno-link {
  color: #2b7489;
}
.htmx-link {
  color: #8a2be2;
}
.aws-link {
  color: #ff9900;
}
.shopify-link {
  color: #96bf48;
}

.vue-link:hover,
.nuxt-link:hover,
.node-link:hover,
.ts-link:hover,
.pg-link:hover,
.python-link:hover,
.deno-link:hover,
.htmx-link:hover,
.aws-link:hover,
.shopify-link:hover,
.supabase-link:hover {
  text-shadow: 0 0 2px currentColor;
}

/*
Global Styles
*/
* {
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
  display: none;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(active-nav-marker),
::view-transition-new(active-nav-marker) {
  height: 100%;
  width: 100%;
  animation: none;
  mix-blend-mode: normal;
}

html {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Noto Serif", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Montserrat", sans-serif;
  line-height: 1.5;
}

h1 {
  font-size: 3rem;
  line-height: 1.618; /* Perfect fifth */
  color: var(--accent-300);
}

h2 {
  font-size: 2.618rem;
  line-height: 1.5; /* Perfect fourth */
  color: var(--accent-300);
}

h3 {
  font-size: 2rem;
  line-height: 1.333; /* Perfect third/major third */
  color: var(--accent-200);
}

h4 {
  font-size: 1.618rem;
  line-height: 1.25; /* Major second */
  color: var(--accent-200);
}

h5 {
  font-size: 1.333rem;
  line-height: 1.2; /* Minor second */
  color: var(--accent-100);
}

h6 {
  font-size: 1.2rem;
  line-height: 1.15; /* Minor second */
  color: var(--accent-100);
}

.subtitle,
a {
  font-family: "Lora", sans-serif;
  font-size: 1.5rem;
  line-height: 1.618; /* Golden ratio */
  letter-spacing: -0.02em;
}

p {
  font-family: "Noto Serif", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  word-spacing: 0.05em;
}

small {
  font-family: "Noto Serif", sans-serif;
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

a text tspan {
  fill: var(--primary-400);
  transition: fill 0.2s;
}
a:hover text:hover tspan:hover {
  fill: var(--primary-300);
}
tspan.active {
  fill: var(--primary-100);
}

body {
  display: grid;
  grid-template-columns: minmax(2rem, 1fr) minmax(340px, 60rem) minmax(
      2rem,
      1fr
    );

  header {
    margin-top: 2rem;
    text-align: center;
    grid-column: 2;

    .ascii-logo {
      width: 100%;
      max-width: 100%; /* Adjust this value based on your needs */
      margin: 0 auto;

      svg {
        width: 100%;
        height: auto;
        max-height: 15rem;

        text {
          fill: var(--primary-400);
        }

        a {
          font-size: 1rem;
        }
      }
    }

    menu {
      list-style: none;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 2rem;
      font-size: 1.5rem;

      li {
        list-style: none;

        a {
          text-decoration: none;
          color: var(--primary-400);
          transition: transform 0.2s ease;
          display: inline-block;
          position: relative;
        }

        .active-nav::before {
          content: "";
          position: absolute;
          top: 1rem;
          background-color: var(--primary);
          height: 40%;
          width: 60%;
          z-index: -1;
          clip-path: polygon(0% 0%, 90% 10%, 100% 90%, 10% 100%);
          transform: rotate(-3deg);
          box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
          view-transition-name: active-nav-marker;
        }

        .active-nav {
          color: var(--text-light-primary);
        }
      }
    }
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  main {
    grid-column: 2;
    position: relative;
    overflow: scroll;
    margin-bottom: 5rem;
    .htmx-indicator {
      text-align: center;
      font-size: 2rem;
      grid-column: 1 / -1;
    }
  }

  footer {
    width: 100%;
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    background-color: var(--bg-primary);

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

.pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: center;
  color: var(--text-light-primary);

  button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 1.25rem;

    &:only-of-type {
      grid-column: 1 / -1;
    }
  }

  span {
    color: gray;
    grid-column: 1 / -1;
  }
}

/*
Global effects and stuff
*/

/* First, wrap your text in a container with this class */
.typing-effect {
  width: fit-content;
  /* Adjust width as needed, or use ch unit for monospace precision */

  /* Hide overflow while typing */
  overflow: hidden;

  /* Create space for the cursor */
  border-right: none;

  /* The typing animation */
  animation: typing 0.5s steps(50, end);

  /* Preserve whitespace and prevent wrapping */
  white-space: nowrap;
}

/* The typing animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* The cursor blink animation */
@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #ffa500;
  }
}
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in:nth-child(1) {
  animation-delay: 0.2s;
}
.fade-in:nth-child(2) {
  animation-delay: 0.4s;
}
.fade-in:nth-child(3) {
  animation-delay: 0.6s;
}
.fade-in:nth-child(4) {
  animation-delay: 0.8s;
}
.fade-in:nth-child(5) {
  animation-delay: 1s;
}
.fade-in:nth-child(6) {
  animation-delay: 1.2s;
}
.fade-in:nth-child(7) {
  animation-delay: 1.4s;
}
.fade-in:nth-child(8) {
  animation-delay: 1.6s;
}
.fade-in:nth-child(9) {
  animation-delay: 1.8s;
}
.fade-in:nth-child(10) {
  animation-delay: 2s;
}
.fade-in:nth-child(11) {
  animation-delay: 2.2s;
}
.fade-in:nth-child(12) {
  animation-delay: 2.4s;
}
.fade-in:nth-child(13) {
  animation-delay: 2.6s;
}
.fade-in:nth-child(14) {
  animation-delay: 2.8s;
}
.fade-in:nth-child(15) {
  animation-delay: 3s;
}
.fade-in:nth-child(16) {
  animation-delay: 3.2s;
}
.fade-in:nth-child(17) {
  animation-delay: 3.4s;
}
.fade-in:nth-child(18) {
  animation-delay: 3.6s;
}
.fade-in:nth-child(19) {
  animation-delay: 3.8s;
}
.fade-in:nth-child(20) {
  animation-delay: 4s;
}
