/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: #0d1821;
}

/* All sizes are in rem, so this scales the whole site. 16px up to a 1440px
   wide screen, then growing linearly to 24px at 2560px and above. */
html {
  font-size: clamp(100%, 0.7143vw + 5.714px, 150%);
}

body {
  color: #fff;
  font-family: 'Source Code Pro', monospace;
  min-height: 100vh;
  line-height: 1.6;
  background-image: url('/img/stars-background.png'), linear-gradient(180deg, #11101e, #1f1e2b);
  overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  display: flex;
  align-items: center;
  top: 0;
  width: 100%;
  padding: 0.625rem 1.875rem;
  z-index: 100;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(6px);
}
header .header-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2.75rem;
}

header .logo-text-container {
  display: flex;
  align-items: center;
  min-width: 0;
}

header .logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
}
header .logo-container span {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.25rem, 6.5vw - 1.875rem, 3.75rem);
}

header .logo-brace {
  color: #6c93c0;
}
header .logo-text {
  color: #00fefc;
  white-space: nowrap;
}

header .logo-text .logo-extra {
  display: inline-block;
  vertical-align: bottom;
  white-space: pre;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition:
    max-width 0.15s ease,
    opacity 0.15s ease;
  transition-delay: calc((21 - var(--i)) * 15ms);
}

header .logo-container:hover {
  cursor: pointer;
  transition: all 0.5s ease;
  will-change: transform;
  transform: scale(1.1);
  transform-origin: 0%;

  .logo-extra {
    max-width: 1ch;
    opacity: 1;
    transition-delay: calc(var(--i) * 30ms);
  }
}

@media (prefers-reduced-motion: reduce) {
  header .logo-text .logo-extra {
    transition: none;
  }
}

@media (max-width: 768px), (hover: none) {
  header .logo-container:hover {
    transform: none;
  }
  header .logo-container .logo-extra,
  header .logo-container:hover .logo-extra {
    max-width: 0;
    opacity: 0;
    transition: none;
  }
}

p {
  color: #d0d0d0;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

h1 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 2.75rem;
  color: #00fefc;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.menu-icon {
  color: #00fefc;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  margin-left: auto;
}

.menu-icon:hover {
  color: #fff;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -18.75rem;
  width: 17.5rem;
  height: 100vh;
  background: #0d1821;
  border-left: 2px dashed #616161;
  z-index: 200;
  transition: right 0.3s ease;
  padding: 5rem 2.5rem 2.5rem;
}

.mobile-menu.open {
  right: 0;
}

.menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.875rem;
  color: #00fefc;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.menu-close:hover {
  color: #fff;
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu li {
  margin-bottom: 1.5rem;
}

.mobile-menu li::before {
  display: none;
}

.mobile-menu a {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.125rem;
  transition: color 0.2s;
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px dashed transparent;
}

.mobile-menu a:hover {
  color: #00fefc;
  border-bottom-color: #00fefc;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== FOOTER ===== */
footer {
  padding: 2.5rem 2.5rem;
  font-size: 0.625rem;
  color: #616161;
  text-align: center;
  border-top: 2px dashed #616161;
  background-color: #0d1821;
  position: relative;
  z-index: 10;
}

footer a {
  color: #616161;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: #00fefc;
}

.footer-container {
  max-width: 50rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.875rem;
}

.footer-nav ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, auto);
  justify-content: center;
  gap: 1.875rem;
  padding: 0;
  margin: 0;
}

.footer-container .footer-nav ul li {
  margin: 0;
  padding-left: 0;
}

.footer-container .footer-nav ul li::before {
  display: none;
}

.footer-nav a {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.125rem;
  transition: color 0.2s;
  text-transform: uppercase;
  border-bottom: 1px dashed transparent;
  padding-bottom: 0.125rem;
}

.footer-nav a:hover {
  color: #00fefc;
  border-bottom-color: #00fefc;
}

.footer-copyright {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.8125rem;
}

/* ===== FALLING STARS ===== */
.falling-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.falling-star {
  position: absolute;
  width: 3px;
  height: 200px;
  background: url('/img/fallingstar.png') no-repeat center / 100% 100%;
  clip-path: inset(0 0 100% 0);
  animation: falling-star-reveal 1.6s ease-in-out forwards;
}

/* Reveal top-to-bottom, then let the tail disappear the same direction */
@keyframes falling-star-reveal {
  0% {
    clip-path: inset(0 0 100% 0);
    opacity: 1;
  }
  50% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(100% 0 0 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .falling-stars {
    display: none;
  }
}

main {
  position: relative;
  z-index: 1;
}

main .mountains {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 2;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* About XC */
.xc-content-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3.75rem;
  width: 80%;
  min-height: 90vh;
  align-content: flex-start;
  margin: 2.5rem auto 0 auto;
}

/* Only sections followed by a scroll arrow target need to fill the screen */
.xc-content-container:last-child {
  min-height: 0;
}

.xc-content {
  flex: 1 0 0;
  display: flex;
  flex-direction: column;
  height: max-content;
}
.xc-content .xc-heading {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 2rem;
  color: #00fefc;
  line-height: 1.2;
}

.xc-content .xc-subheading {
  font-family: 'Space Mono', monospace;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.xc-content .xc-content-number {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 2.625rem;
  color: #dfaa63;
  line-height: 1.2;
}

.xc-content .highlight-orange {
  color: #dfaa63;
  font-weight: 700;
}

.xc-content .heading-pink {
  color: #c29eba;
  font-weight: 700;
  line-height: 1.2;
}
.xc-content .heading-blue {
  font-weight: 700;
  color: #00fefc;
  line-height: 1.2;
}
/* Above the mountains so the arrow stays clickable */
.scroll-indicator-container {
  display: flex;
  justify-content: center;
  align-items: start;
  width: 100%;
  position: relative;
  z-index: 3;
}
.scroll-indicator {
  cursor: pointer;
  width: 2rem;
  height: auto;
  opacity: 0.7;
  animation: bounce 2s ease-in-out infinite;
  transition: opacity 0.2s;
}

.scroll-indicator:hover {
  opacity: 1;
}

@keyframes bounce-vertical {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* ===== SUBPAGE STYLES ===== */
body.page-sub .container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3.75rem 2.5rem;
  position: relative;
  z-index: 1;
}

body.page-sub h1 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #00fefc;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  font-size: 2.0625rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

body.page-sub h2 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #00fefc;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  font-size: 1.4375rem;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

body.page-sub h3 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #00fefc;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  font-size: 1.4375rem;
  margin-bottom: 0.75rem;
  margin-top: 1.875rem;
}

body.page-sub p {
  color: #d0d0d0;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

body.page-sub .section {
  margin-bottom: 3.125rem;
}

body.page-sub ul {
  list-style: none;
  margin: 1rem 0;
}

body.page-sub ul li {
  color: #d0d0d0;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
}

body.page-sub ul li::before {
  content: '•';
  color: #00fefc;
  position: absolute;
  left: 0;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }

  .footer-nav ul {
    grid-template-columns: repeat(1, auto);
    gap: 2rem;
  }

  .footer-nav a {
    font-size: 1.25rem;
    padding: 0.625rem 0;
  }

  /* Subpage mobile */
  body.page-sub .container {
    padding: 5rem 1.25rem 2.5rem 1.25rem;
  }

  body.page-sub h1 {
    font-size: 1.625rem;
  }

  /* Home mobile: one section per row, no scroll arrows */
  .xc-content-container {
    flex-direction: column;
    min-height: 0;
    gap: 3rem;
  }

  .xc-content {
    flex: none;
  }

  .scroll-indicator-container {
    display: none;
  }
}
