/* Global stuff */
:root {
  /* Structure Sizes */
  --header-h: 3.5rem;
  --home-logo-size: clamp(2rem, 3vw, calc(var(--header-h) - 1rem));
  --hero-h: 120vh;
  --hero-tb-padding: 25vh;

  /* Colour Palette — Mission Control / Space theme */
  --c-primary: #1b1f4b;
  --c-secondary: #d8e3f7;
  --c-tertiary: #a9b8e8;
  --c-accent: #f2b134;
  --c-top-main: #0a0e27;
  --c-bot-main: #04050f;
  --c-strong: #7a2048;

  /* Fonts */
  --f-heading: 'Orbitron', sans-serif;
  --f-subheading: 'Space Mono', monospace;
  --f-main: 'DM Sans', sans-serif;
}

a {
  all: unset;
  cursor: pointer;
}

h1 {
  font-family: var(--f-heading);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 3rem);
  font-family: var(--f-subheading);
  font-weight: 500;
}

p {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

h3 {
  font-size: clamp(1.2rem, 2.1vw, 2.5rem);
}

.bg-box {
  background-color: var(--c-primary);
  box-shadow: var(--c-accent) 5px 5px 0px 0px;
  padding: 0.5rem 0.25rem;
  border: solid 2px var(--c-strong);
}

.button {
  width: clamp(8rem, 22vw, 10rem);
  aspect-ratio: 6 / 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  color: white;
  font-family: var(--f-subheading);
  font-size: clamp(1rem, 8vw, 1.5rem);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button-wide {
  width: clamp(10rem, 30vw, 14rem);
}

.button-madness {
  width: clamp(12rem, 32vw, 15rem);
  white-space: nowrap;
  font-size: clamp(0.8rem, 3.5vw, 1.25rem);
}

.hero-nav .button {
  height: clamp(3rem, 8vw, 3.5rem);
  aspect-ratio: auto;
  box-sizing: border-box;
}

.icon {
  width: 1.5em;
  height: 1.5em;
}

.st0 {
  fill: white;
}

.st1 {
  fill: var(--c-accent);
}

/* Specific styles */
body {
  /* Theme variables (duplicated here because the file started with an invalid selector `::root`) */
  --header-h: 3.5rem;
  --home-logo-size: clamp(2rem, 3vw, calc(var(--header-h) - 1rem));
  --hero-h: 120vh;
  --hero-tb-padding: 25vh;

  --c-primary: #1b1f4b;
  --c-secondary: #d8e3f7;
  --c-tertiary: #a9b8e8;
  --c-accent: #f2b134;
  --c-top-main: #0a0e27;
  --c-bot-main: #04050f;
  --c-strong: #7a2048;

  --f-heading: 'Orbitron', sans-serif;
  --f-subheading: 'Space Mono', monospace;
  --f-main: 'DM Sans', sans-serif;

  font-family: var(--f-main);
  font-weight: 300;
}

header {
  position: sticky;
  top: 0;
  background-color: var(--c-top-main);
  height: var(--header-h);
  z-index: 5;
  color: var(--c-secondary);

  & > nav {
    display: flex;
    align-items: center;
    height: 100%;

    & > a {
      padding: 0.5rem;
    }

    & > ul {
      display: flex;
      width: 100%;
      justify-content: space-around;
      padding: 0;

      & > li {
        display: block;
        flex: 1 1 0;
        text-align: center;
      }
    }
  }
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 120vh;
  padding: var(--hero-tb-padding) 1rem;
  background-color: var(--c-top-main);
  background-image:
    linear-gradient(rgba(10, 14, 39, 0.55), rgba(4, 5, 15, 0.85)),
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 90px 80px, #ffffff 100%, transparent 100%),
    radial-gradient(2px 2px at 150px 40px, var(--c-accent) 100%, transparent 100%),
    radial-gradient(1px 1px at 200px 150px, #ffffff 100%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60px 170px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 240px 90px, var(--c-tertiary) 100%, transparent 100%),
    radial-gradient(2px 2px at 280px 210px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 120px 230px, #ffffff 100%, transparent 100%);
  background-size: auto, 300px 300px, 300px 300px, 300px 300px, 300px 300px, 300px 300px, 300px 300px, 300px 300px, 300px 300px;
  background-position: center;

  & > hgroup > .hero-logo {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    width: clamp(3.5rem, 9vw, 5.5rem);
    height: auto;
    margin: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--c-accent), 8px 8px 0 var(--c-strong);
  }

  & > hgroup {
    text-align: center;

    & > .title-container {
      & > h1 {
        width: 100%;
        font-size: clamp(2.5rem, 10vw, 7rem);
        color: var(--c-accent);
        text-shadow: var(--c-strong) 2px 2px 0px;
        line-height: 1.05;
      }
    }

    & > p {
      font-family: var(--f-subheading);
      font-size: clamp(1rem, 3vw, 2rem);
      font-weight: 200;
      color: var(--c-secondary);
    }
  }

  & > #countdown {
    display: flex;
    justify-content: center;
    column-gap: clamp(0.5rem, 3vw, 2rem);
    text-align: center;
    width: 90vw;
    max-width: 25rem;
    margin: 1.5rem 0;

    & > .cd-col {
      flex: 0 0 25%;

      & > .value {
        font-size: clamp(2.5rem, 10vw, 5rem);
        color: var(--c-accent);
        text-shadow: var(--c-strong) 2px 2px;
        font-family: var(--f-heading);
        font-weight: 800;
      }

      & > .label {
        color: var(--c-secondary);
        font-family: var(--f-subheading);
        font-size: clamp(0.75rem, 2vw, 1rem);
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
    }
  }

  & > nav {
    & > ul {
      padding: 0;

      & > li {
        display: block;
      }

      li + li {
        margin-top: 1rem;
      }
    }
  }
}

/* ---------- extra space decoration ---------- */
.star-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(1.5px 1.5px at 30px 50px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 110px 20px, var(--c-accent) 100%, transparent 100%),
    radial-gradient(1.5px 1.5px at 190px 90px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 250px 40px, #ffffff 100%, transparent 100%);
  background-size: 320px 320px;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.25; }
  100% { opacity: 0.9; }
}

.deco-planet,
.deco-moon {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  animation: drift 8s ease-in-out infinite;
}

.deco-planet {
  width: clamp(60px, 10vw, 120px);
  top: 12%;
  right: 6%;
}

.deco-moon {
  width: clamp(30px, 5vw, 60px);
  bottom: 16%;
  left: 8%;
  animation-delay: 2s;
  animation-duration: 6.5s;
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

.shooting-star {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px 1px #ffffff;
  z-index: 2;
  opacity: 0;
  animation: shoot 7s linear infinite;
}
.shooting-star::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 90px;
  height: 1px;
  background: linear-gradient(to left, #ffffff, transparent);
  transform: translateY(-50%);
}
.shooting-star.s1 { top: 12%; left: 8%; animation-delay: 0.5s; }
.shooting-star.s2 { top: 32%; left: 55%; animation-delay: 3.2s; }
.shooting-star.s3 { top: 55%; left: 20%; animation-delay: 5.6s; }

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0); }
  2% { opacity: 1; }
  16% { opacity: 0; transform: translate(220px, 140px); }
  100% { opacity: 0; transform: translate(220px, 140px); }
}

@media (prefers-reduced-motion: reduce) {
  .star-layer,
  .deco-planet,
  .deco-moon,
  .shooting-star {
    animation: none;
  }
}

@media (max-width: 700px) {
  .deco-planet,
  .deco-moon {
    display: none;
  }
}

.top-screen {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 10;

  & > #animated-gear-container {
    position: absolute;
    bottom: 2vh;
    left: -120vw;

    & > svg {
      height: 14vh;
      filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.4));
    }
  }

  & > .fairing-frame {
    position: fixed;
    bottom: 0;
    width: 100%;
    pointer-events: none;

    & > .left,
    & > .right {
      position: absolute;
      bottom: 0;
      width: 50%;
      height: 18vh;
      border-top: 3px solid var(--c-accent);
      opacity: 0.7;

      &::before {
        content: '';
        position: absolute;
        top: 1rem;
        width: 60%;
        height: 2px;
        background: repeating-linear-gradient(
          90deg,
          var(--c-secondary) 0,
          var(--c-secondary) 8px,
          transparent 8px,
          transparent 16px
        );
      }
    }

    & > .left {
      left: 0;
      border-right: 3px solid var(--c-accent);

      &::before {
        left: 1rem;
      }
    }

    & > .right {
      right: 0;
      border-left: 3px solid var(--c-accent);

      &::before {
        right: 1rem;
      }
    }
  }
}

main {
  background:
    radial-gradient(1px 1px at 40px 60px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 180px 220px, #ffffff 100%, transparent 100%),
    radial-gradient(1.5px 1.5px at 260px 100px, var(--c-accent) 100%, transparent 100%),
    radial-gradient(1px 1px at 100px 300px, #ffffff 100%, transparent 100%),
    radial-gradient(1px 1px at 320px 180px, var(--c-tertiary) 100%, transparent 100%),
    linear-gradient(to bottom, var(--c-top-main) 0, var(--c-bot-main) 100%);
  background-size: 380px 380px, 380px 380px, 380px 380px, 380px 380px, 380px 380px, auto;
  padding-bottom: 5rem;

  & > article {
    display: grid;
    place-items: center;
    row-gap: 10rem;

    & > .jump-section {
      padding-top: calc(var(--header-h) + 1rem);
    }

    & > section {
      display: grid;
      place-items: center;
      width: 100%;

      & > .section-container {
        min-width: 15rem;

        & > h2 {
          display: block;
          padding: 0.5rem;
          font-weight: 700;
          color: var(--c-accent);
        }

        & > .section-content {
          display: flex;
          flex-direction: column;
          gap: 1rem;
          padding: 0.5rem;

          & > h3 {
            color: var(--c-secondary);
          }

          & > p {
            color: white;

            & > a {
              color: var(--c-accent);
              text-decoration: underline;
              cursor: pointer;
            }
          }

          & strong {
            font-weight: 900;
          }
        }

        & > .section-footer {
          display: flex;
          flex-wrap: wrap;
          justify-content: space-evenly;
          gap: 1rem;
          padding: 1rem 0;

          & > * {
            flex: 0 1 200px;
          }
        }
      }
    }
  }
}

.section-container h2::before {
  content: '// TRANSMISSION';
  display: block;
  font-family: var(--f-subheading);
  font-size: clamp(0.65rem, 1.5vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-secondary);
  opacity: 0.7;
  margin-bottom: 0.35rem;
}
.section-container > h2 {
  color: var(--c-accent);
}
.section-container > p {
  color: var(--c-secondary);
}
.week-overview {
  width: min(100%, 72rem);
}

.week-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
}

.week-day {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 8rem;
  justify-content: center;
  padding: 0.85rem 0.65rem;
  border: 2px solid var(--c-strong);
  background: rgba(27, 31, 75, 0.8);
  color: var(--c-secondary);
  font-size: 0.85rem;
}

.week-day strong {
  color: var(--c-accent);
  font-family: var(--f-subheading);
  font-size: 0.95rem;
}

.week-day-label {
  color: var(--c-tertiary);
  font-family: var(--f-subheading);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.week-day-featured {
  border-color: var(--c-accent);
  box-shadow: 4px 4px 0 var(--c-accent);
}

.overview-note {
  margin-top: 1rem;
}

.faq-discord-note {
  max-width: 42rem;
  margin: 0 auto 1rem;
  color: var(--c-secondary);
  text-align: center;
}

.faq-discord-note a {
  color: var(--c-accent);
  text-decoration: underline;
}
#mm-hero .section-content > p {
  color: var(--c-secondary);
}
#mm-hero {
  position: relative;
}

.mm-corner-logo {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 1;
  width: clamp(3.5rem, 9vw, 5.5rem);
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--c-accent), 5px 5px 0 var(--c-strong);
}
#about .section-container h2::before { content: '01 // MISSION OVERVIEW'; }
.section-container h2.crew-heading::before { content: '02 // FLIGHT CREW'; }
#schedule .section-container h2::before { content: '03 // FLIGHT PLAN'; }
#faq .section-container h2::before { content: '04 // MISSION BRIEFING'; }
#register .section-container h2::before { content: '05 // BOARDING PASS'; }

#faq {
  & > .section-container {
    & > .section-content {
      & > p {
        margin-bottom: 3rem;
      }
    }
  }
}

.gallery {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 1rem;
}

.photo-grid {
  width: 100%;
  max-width: 60rem;
  padding: 0 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.photo-tile {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 4px solid var(--c-accent);
  box-shadow: 5px 5px 7px black;
  background: var(--c-top-main);
  position: relative;
}

.photo-tile > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Crop controls: set per tile using CSS variables */
  object-position: var(--pos-x, 50%) var(--pos-y, 50%);
  display: block;
}

.mm-hype-featured {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.mm-hype-gallery .photo-grid {
  max-width: 68rem;
}

.mm-two-photo-gallery .photo-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 2px solid rgba(200, 217, 234, 0.35);
  background-color: rgba(42, 74, 107, 0.35);
  border-radius: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: var(--c-accent);
  font-family: var(--f-subheading);
  font-weight: 700;
  text-align: left;
}

.faq-plus {
  flex: 0 0 auto;
  font-family: var(--f-subheading);
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--c-accent);
  line-height: 1;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0 1rem;
}

.faq-a p {
  color: white;
  padding-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.4;
}

#calendar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;

  & > .bg-box {
    width: 90%;
    padding: 1rem;

    & > h3 {
      color: var(--c-accent);
    }

    & > h4 {
      color: var(--c-secondary);
      font-family: var(--f-subheading);
      font-size: clamp(1rem, 2vw, 1.4rem);
      margin-top: 0.5rem;
    }

    & > .event-meta {
      color: var(--c-tertiary);
      font-size: 0.95rem;
      margin: 0.25rem 0;
    }

    & > p {
      color: var(--c-tertiary);
      font-size: 1rem;
      margin-top: 0.75rem;
    }

    & > .event-divider {
      border: none;
      border-top: 1px dashed rgba(200, 217, 234, 0.3);
      margin: 1rem 0;
    }
  }
}

.mm-event-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1rem;
}

.mm-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 7rem;
  padding: 1rem;
  background: rgba(27, 31, 75, 0.8);
  border: 2px solid var(--c-strong);
  border-top-color: var(--c-accent);
  box-shadow: 4px 4px 0 var(--c-accent);
  color: var(--c-secondary);
  font-family: var(--f-subheading);
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  line-height: 1.4;
}

.mm-detail time {
  color: var(--c-secondary);
}

.mm-detail-label {
  margin-bottom: 0.25rem;
  color: var(--c-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mm-hosted-by {
  color: var(--c-accent);
  font-family: var(--f-subheading);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  text-align: center;
}

.mm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.mm-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  background: rgba(27, 31, 75, 0.8);
  color: var(--c-secondary);
  font-size: 0.95rem;
}

.mm-table th,
.mm-table td {
  padding: 0.75rem;
  border: 1px solid rgba(216, 227, 247, 0.2);
  text-align: left;
  vertical-align: top;
}

.mm-table th {
  color: var(--c-accent);
  background: var(--c-primary);
  font-family: var(--f-subheading);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mm-table tbody tr:nth-child(even) {
  background: rgba(122, 32, 72, 0.22);
}

.mm-table td:first-child {
  color: var(--c-accent);
  font-family: var(--f-subheading);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .week-overview-grid {
    grid-template-columns: 1fr;
  }

  .week-day {
    min-height: auto;
  }

  .mm-event-details {
    grid-template-columns: 1fr;
  }

  .mm-detail {
    min-height: auto;
  }
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  color: var(--c-accent);
  background-color: var(--c-primary);

  .icons {
    display: flex;
    gap: 0.75rem;

    & .icon {
      width: 1.5em;
      height: 1.5em;
    }
  }
}

.eng-fact {
  display: none;
  background-color: var(--c-strong);
  padding: 1rem;

  & > h2 {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-family: var(--f-heading);
    color: var(--c-accent);
  }

  & > p {
    color: white;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
  }
}

.gallery-card {
  width: 25vw;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--c-primary), var(--c-top-main));
  border: 5px solid var(--c-accent);
  box-shadow: 5px 5px 7px black;
  color: var(--c-secondary);
  font-family: var(--f-subheading);
  font-weight: 600;
  font-size: clamp(0.8rem, 1.5vw, 1.1rem);
  text-align: center;
  padding: 1rem;

  & > .card-icon {
    font-size: 2.5rem;
    line-height: 1;
  }
}

/* Media Queries */

@media (min-width: 570px) {
  #calendar {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;

    & > .bg-box {
      width: 100%;
      flex: 1 1 45%;
    }
  }

  .section-container {
    max-width: 47rem;
  }
}

@media (min-width: 600px) {
  .hero-nav {
    width: 100%;

    & > ul {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      flex-direction: row;
      gap: 1rem;

      & > li {
        margin: 0 !important;
        padding: 0;
      }
    }
  }
}

@media (min-width: 1280px) {
  section {
    grid-template-columns: [left] 1fr [mid] auto [right] 1fr;
    grid-column-gap: 0.5rem;

    .section-container {
      grid-column: mid;
    }

    & > .eng-fact:first-child {
      grid-column: left;
      justify-self: end;
      align-self: start;
    }

    & > .eng-fact:last-child:not(:first-child) {
      grid-column: right;
      justify-self: start;
      align-self: start;
    }
  }

  .eng-fact {
    display: block;
    width: min(80%, 25rem);
  }

  .gallery {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 2rem;
  }
}
