body {
  font-family: "Cormorant Garamond", serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

/* ASCII Animation Layer */
.ascii-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 500;
}

.ascii-art {
  position: absolute;
  font-family: "Courier New", Courier, monospace;
  font-size: 6px;
  line-height: 1.1;
  color: #80cbc4;
  opacity: 0;
  filter: blur(5px);
  transition: opacity 1.5s ease, filter 1.5s ease;
  white-space: pre;
  will-change: opacity, filter;
}

.ascii-art.active {
  opacity: 0.8;
  filter: blur(0);
}

.ascii-art.fading {
  opacity: 0;
  filter: blur(8px);
}

/* Gradient Sidebar Styles */
.gradient-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 90px;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(20, 1fr);
  gap: 0;
  z-index: 1000;
}

.sidebar-row {
  background-color: #2a2a2a;
  opacity: 0.2;
  transition: opacity 0.4s ease, box-shadow 0.4s ease;
}

.sidebar-row.lit-2 {
  opacity: 0.5;
}

.sidebar-row.lit-1 {
  opacity: 0.75;
}

.sidebar-row.lit {
  opacity: 1;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.sidebar-row.random-lit {
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Row 1 (top) - Teal */
.sidebar-row:nth-child(1), .sidebar-row:nth-child(2), .sidebar-row:nth-child(3) { background: #4db6ac; }

/* Row 2 */
.sidebar-row:nth-child(4), .sidebar-row:nth-child(5), .sidebar-row:nth-child(6) { background: #5abbb2; }

/* Row 3 */
.sidebar-row:nth-child(7), .sidebar-row:nth-child(8), .sidebar-row:nth-child(9) { background: #66c0b8; }

/* Row 4 */
.sidebar-row:nth-child(10), .sidebar-row:nth-child(11), .sidebar-row:nth-child(12) { background: #73c5be; }

/* Row 5 */
.sidebar-row:nth-child(13), .sidebar-row:nth-child(14), .sidebar-row:nth-child(15) { background: #80cbc4; }

/* Row 6 */
.sidebar-row:nth-child(16), .sidebar-row:nth-child(17), .sidebar-row:nth-child(18) { background: #8dd0ca; }

/* Row 7 */
.sidebar-row:nth-child(19), .sidebar-row:nth-child(20), .sidebar-row:nth-child(21) { background: #9ad5d0; }

/* Row 8 */
.sidebar-row:nth-child(22), .sidebar-row:nth-child(23), .sidebar-row:nth-child(24) { background: #a7dbd6; }

/* Row 9 */
.sidebar-row:nth-child(25), .sidebar-row:nth-child(26), .sidebar-row:nth-child(27) { background: #b4e0dc; }

/* Row 10 */
.sidebar-row:nth-child(28), .sidebar-row:nth-child(29), .sidebar-row:nth-child(30) { background: #c1e5e2; }

/* Row 11 - Transition zone */
.sidebar-row:nth-child(31), .sidebar-row:nth-child(32), .sidebar-row:nth-child(33) { background: #d5ebe7; }

/* Row 12 */
.sidebar-row:nth-child(34), .sidebar-row:nth-child(35), .sidebar-row:nth-child(36) { background: #ffe5dc; }

/* Row 13 */
.sidebar-row:nth-child(37), .sidebar-row:nth-child(38), .sidebar-row:nth-child(39) { background: #ffddd0; }

/* Row 14 */
.sidebar-row:nth-child(40), .sidebar-row:nth-child(41), .sidebar-row:nth-child(42) { background: #ffd4c4; }

/* Row 15 */
.sidebar-row:nth-child(43), .sidebar-row:nth-child(44), .sidebar-row:nth-child(45) { background: #ffc8b4; }

/* Row 16 */
.sidebar-row:nth-child(46), .sidebar-row:nth-child(47), .sidebar-row:nth-child(48) { background: #ffb8a0; }

/* Row 17 */
.sidebar-row:nth-child(49), .sidebar-row:nth-child(50), .sidebar-row:nth-child(51) { background: #ffa88c; }

/* Row 18 */
.sidebar-row:nth-child(52), .sidebar-row:nth-child(53), .sidebar-row:nth-child(54) { background: #ff9878; }

/* Row 19 */
.sidebar-row:nth-child(55), .sidebar-row:nth-child(56), .sidebar-row:nth-child(57) { background: #ff7f5c; }

/* Row 20 (bottom) - Orange */
.sidebar-row:nth-child(58), .sidebar-row:nth-child(59), .sidebar-row:nth-child(60) { background: #ff5722; }

/* Hide cells 61-100 on desktop (only used on mobile) */
.sidebar-row:nth-child(n+61) { display: none; }

@media (max-width: 900px) {
  .gradient-sidebar {
    width: 60px;
  }
}

@media (max-width: 768px) {
  /* Transform sidebar to horizontal header */
  .gradient-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100px;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
    z-index: 0;
  }

  /* Mobile gradient remapping: 5 rows × 20 columns = 100 cells */
  /* Row 1: Teal start (cells 1-20) */
  .sidebar-row:nth-child(1), .sidebar-row:nth-child(2), .sidebar-row:nth-child(3), .sidebar-row:nth-child(4) { background: #4db6ac !important; }
  .sidebar-row:nth-child(5), .sidebar-row:nth-child(6), .sidebar-row:nth-child(7), .sidebar-row:nth-child(8) { background: #5abbb2 !important; }
  .sidebar-row:nth-child(9), .sidebar-row:nth-child(10), .sidebar-row:nth-child(11), .sidebar-row:nth-child(12) { background: #66c0b8 !important; }
  .sidebar-row:nth-child(13), .sidebar-row:nth-child(14), .sidebar-row:nth-child(15), .sidebar-row:nth-child(16) { background: #73c5be !important; }
  .sidebar-row:nth-child(17), .sidebar-row:nth-child(18), .sidebar-row:nth-child(19), .sidebar-row:nth-child(20) { background: #80cbc4 !important; }

  /* Row 2: Teal to light teal (cells 21-40) */
  .sidebar-row:nth-child(21), .sidebar-row:nth-child(22), .sidebar-row:nth-child(23), .sidebar-row:nth-child(24) { background: #8dd0ca !important; }
  .sidebar-row:nth-child(25), .sidebar-row:nth-child(26), .sidebar-row:nth-child(27), .sidebar-row:nth-child(28) { background: #9ad5d0 !important; }
  .sidebar-row:nth-child(29), .sidebar-row:nth-child(30), .sidebar-row:nth-child(31), .sidebar-row:nth-child(32) { background: #a7dbd6 !important; }
  .sidebar-row:nth-child(33), .sidebar-row:nth-child(34), .sidebar-row:nth-child(35), .sidebar-row:nth-child(36) { background: #b4e0dc !important; }
  .sidebar-row:nth-child(37), .sidebar-row:nth-child(38), .sidebar-row:nth-child(39), .sidebar-row:nth-child(40) { background: #c1e5e2 !important; }

  /* Row 3: Transition zone (cells 41-60) */
  .sidebar-row:nth-child(41), .sidebar-row:nth-child(42), .sidebar-row:nth-child(43), .sidebar-row:nth-child(44) { background: #d5ebe7 !important; }
  .sidebar-row:nth-child(45), .sidebar-row:nth-child(46), .sidebar-row:nth-child(47), .sidebar-row:nth-child(48) { background: #ffe5dc !important; }
  .sidebar-row:nth-child(49), .sidebar-row:nth-child(50), .sidebar-row:nth-child(51), .sidebar-row:nth-child(52) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(53), .sidebar-row:nth-child(54), .sidebar-row:nth-child(55), .sidebar-row:nth-child(56) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(57), .sidebar-row:nth-child(58), .sidebar-row:nth-child(59), .sidebar-row:nth-child(60) { background: #ffddd0 !important; }

  /* Row 4: Peach tones (cells 61-80) */
  .sidebar-row:nth-child(61), .sidebar-row:nth-child(62), .sidebar-row:nth-child(63), .sidebar-row:nth-child(64) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(65), .sidebar-row:nth-child(66), .sidebar-row:nth-child(67), .sidebar-row:nth-child(68) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(69), .sidebar-row:nth-child(70), .sidebar-row:nth-child(71), .sidebar-row:nth-child(72) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(73), .sidebar-row:nth-child(74), .sidebar-row:nth-child(75), .sidebar-row:nth-child(76) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(77), .sidebar-row:nth-child(78), .sidebar-row:nth-child(79), .sidebar-row:nth-child(80) { background: #ffddd0 !important; }

  /* Row 5: Peach tones (cells 81-100) */
  .sidebar-row:nth-child(81), .sidebar-row:nth-child(82), .sidebar-row:nth-child(83), .sidebar-row:nth-child(84) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(85), .sidebar-row:nth-child(86), .sidebar-row:nth-child(87), .sidebar-row:nth-child(88) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(89), .sidebar-row:nth-child(90), .sidebar-row:nth-child(91), .sidebar-row:nth-child(92) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(93), .sidebar-row:nth-child(94), .sidebar-row:nth-child(95), .sidebar-row:nth-child(96) { background: #ffddd0 !important; }
  .sidebar-row:nth-child(97), .sidebar-row:nth-child(98), .sidebar-row:nth-child(99), .sidebar-row:nth-child(100) { background: #ffddd0 !important; }

  /* Show all cells on mobile */
  .sidebar-row:nth-child(n+61) { display: block !important; }

  .ascii-layer {
    display: none; /* Hide ASCII animations on mobile */
  }

  .ascii-art {
    font-size: 4px; /* Smaller on tablets */
  }
}

.fixed-width {
  display: inline-block;
  width: 1ch; /* Ensures each character span has a fixed width */
  text-align: center; /* Centers the text within the width */
}

.projects p {
  margin: 0;
}

.projects a {
  text-decoration: underline;
  text-decoration-color: #d11e06;
  text-decoration-thickness: 2px;
}

/* Fixed container width */
.container {
  width: 60%; /* Optional, as the key is the min-width and max-width */
  margin: 0 auto;
  padding: 0 15px;
  min-width: 576px; /* Minimum width set to 600px */
  max-width: 576px; /* Maximum width set to 600px */
}

/* Adjustments for very small screens */
@media (max-width: 576px) {
  .container {
    width: 90%;
    padding: 0 5px;
    min-width: auto; /* Override the fixed width for smaller screens */
    max-width: auto; /* Override the fixed width for smaller screens */
  }
}

@media (max-width: 300px) {
  .container {
    width: 95%;
    padding: 0 2px;
  }
}

header {
  padding-top: 3rem;
  font-size: 2.25rem; /* Default header size */
  position: relative;
  z-index: 1001; /* Above gradient sidebar/header */
}

nav {
  width: 100%;
  box-sizing: border-box; /* Ensure no overflow caused by padding or margin */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: #000;
  margin: 0 1rem; /* Default margin */
  text-decoration: none;
  font-size: 1.4rem; /* Default nav link size */
  transition: opacity 0.3s ease;
}

.a-margin {
  margin: 0 0rem;
}

.toggle-wrapper {
  height: 1.5rem;
  width: 2rem;
  position: relative;
  margin: 0 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}

.toggle-icon-display {
  line-height: 0.8;
  font-size: 1rem;
  font-family: monospace;
  color: #000;
  margin: 0;
  padding: 0;
  transform: scale(0.05);
  transform-origin: center center;
  white-space: pre;
  position: absolute;
}


main {
  padding: 1rem 0; /* Adjust padding as needed */
  font-size: 1.3rem; /* Default main content size */
}

main p {
  line-height: 1.5;
}

footer {
  color: #000;
  text-align: center;
  padding: 1rem;
  width: 70%;
  margin: 0 auto; /* Center the footer */
  position: relative; /* Ensure it's not fixed for better layout */
  font-size: 1rem; /* Default footer size */
}

@media (max-width: 576px) {
  header a {
    margin: 0 0.5rem;
  }
  footer {
    width: 100%;
    padding: 0 5px;
  }
}

nav a:hover {
  text-decoration: underline;
  text-decoration-color: #d11e06;
  text-decoration-thickness: 2px;
}

.responsive-img {
  max-width: 100%;
  height: auto;
}

/* Contact page styles */
.social-links {
  list-style-type: none;
  padding: 0;
}

.social-links li {
  display: inline;
  margin-right: 10px;
}

.social-links a {
  text-decoration: none;
  color: #d11e06;
  font-weight: 600;
}

social-links a:hover {
  text-decoration: underline;
  text-decoration-color: #d11e06;
  text-decoration-thickness: 2px;
}

@keyframes fadeUp {
  0% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.fade-in-1 {
  animation: fadeUp 0.1s ease-out forwards;
}

.fade-in-2 {
  animation: fadeUp 0.2s ease-out forwards;
}

.fade-in-3 {
  animation: fadeUp 0.3s ease-out forwards;
}

.cormorant-garamond-light {
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-style: normal;
}

.cormorant-garamond-light-italic {
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-style: italic;
}

.cormorant-garamond-regular {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-style: normal;
}

.cormorant-garamond-regular-italic {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-style: italic;
}

.cormorant-garamond-medium {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: normal;
}

.cormorant-garamond-medium-italic {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-style: italic;
}

.cormorant-garamond-semibold {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-style: normal;
}

.cormorant-garamond-semibold-italic {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-style: italic;
}

.cormorant-garamond-bold {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-style: normal;
}

.cormorant-garamond-bold-italic {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-style: italic;
}
