/* =========================================================
   1. VARIABLES AND FONTS
   ========================================================= */

:root {
  --blue: #4a9bbe;
  --blue-bright: #6ab8d8;

  --bg: #090909;
  --bg3: #101014;
  --card: #0d0d10;
  --card-border: #1c1c22;

  --text: #d8dae0;
  --muted: #5a5e6b;

  --nav-h: 60px;
  --pad-x: 48px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

@font-face {
  font-family: "Akira Expanded";
  src: url("../fonts/autism_client.otf") format("opentype");
  font-display: swap;
}

/* =========================================================
   2. GLOBAL STYLES
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--blue) var(--bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(74, 155, 190, 0.4);
  color: #fff;
}

/* =========================================================
   3. NAVIGATION
   ========================================================= */

nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 max(var(--pad-x), calc((100% - 1400px) / 2 + var(--pad-x)));
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-right {
  gap: 0.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  image-rendering: pixelated;
}

.nav-wordmark {
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 15.2px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-divider {
  width: 1px;
  height: 20px;
  margin: 0 0.25rem;
  background: var(--card-border);
}

/* Navigation CTA */

.nav-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  padding: 8px 19.2px;
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: 2px;
  color: var(--blue);
  text-decoration: none;
  font-family: "Akira Expanded", sans-serif;
  font-size: 14px;
  font-weight: normal;
  transition:
    background var(--transition-fast),
    border-color 0.3s ease,
    color var(--transition-normal);
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: rgba(200, 50, 50, 0.15);
  border-color: #c83232;
  color: #c83232;
}

/* Navigation toggle */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.nav-toggle:hover,
.nav-toggle:focus-visible,
nav.nav-open .nav-toggle {
  background: var(--bg3);
  color: var(--text);
}

/* Social links */

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 2px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.social-link[href*="discord"] {
  --brand: #5865f2;
}

.social-link[href*="youtube"] {
  --brand: #ff0033;
}

.social-link[href*="tiktok"] {
  --brand: #e83e8c;
}

.social-link svg {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.social-link:hover,
.social-link:focus-visible {
  background: color-mix(in srgb, var(--brand, var(--text)) 12%, transparent);
  color: var(--brand, var(--text));
}


/* Navigation focus states */

.nav-cta:focus-visible,
.social-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* =========================================================
   4. HERO BANNER
   ========================================================= */

.hero-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50vh;
  margin-top: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--card-border);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  max-width: 1400px;
  padding: 24px var(--pad-x);
  object-fit: contain;
}

/* =========================================================
   5. MAIN CONTENT AND SECTION HEADINGS
   ========================================================= */

.main-content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 40px 2.5rem 4rem;
  background: var(--bg);
}

.section-title {
  margin-bottom: 0.6rem;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.section-sub {
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#about_us,
#achievements,
#videos {
  scroll-margin-top: calc(var(--nav-h) + 10px);
}

/* =========================================================
   6. ACHIEVEMENTS
   ========================================================= */

#achievements {
  padding-top: 1rem;
}

.achievements {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Achievement cards */

.achievement-card {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 320px;
  background: var(--card);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform 0.2s ease;
}

.achievement-card:hover,
.achievement-card:focus-visible {
  border-color: var(--blue);
  box-shadow:
    0 0 0 1px rgba(74, 155, 190, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
  outline: none;
}

/* Achievement images */

.card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 500px;
  min-width: 0;
  overflow: hidden;
  background: var(--bg3);
  border-right: 1px solid var(--card-border);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Achievement text */

.card-body-custom {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 2.25rem 2.75rem;
  background: var(--bg);
}

.card-title-custom {
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-desc-custom {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.card-tag {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.click-hint {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--blue);
  opacity: 0.6;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* =========================================================
   7. ACHIEVEMENT MODALS
   ========================================================= */

.modal-content {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  color: var(--text);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-body {
  padding: 0;
  container-type: inline-size;
}

.modal-text {
  padding: 1.75rem;
}

.modal-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.btn-close {
  box-shadow: none !important;
  filter: invert(1);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

/* Modal image sizing */

.modal-body .card-img {
  display: block !important;
  flex: none !important;
  width: 100% !important;
  height: min(56.25cqw, 360px) !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border-right: none !important;
  border-bottom: 1px solid var(--card-border) !important;
  background: var(--bg) !important;
}

.modal-body .card-img img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

/* =========================================================
   8. YOUTUBE VIDEO FEED
   ========================================================= */

#videos {
  margin-top: 4rem;
}

.video-master-card {
  position: relative;
  width: 100%;
  margin-top: 2rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.video-feed-scroll {
  max-height: 750px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.25rem;
}

.video-feed-scroll:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -3px;
}

.video-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform 0.2s ease;
}

.video-card:hover,
.video-card:focus-within {
  border-color: var(--blue);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.video-card:hover {
  transform: translateY(-3px);
}

/* No lift while playing, so the player doesn't shift under the cursor */
.video-card.is-playing:hover {
  transform: none;
}

.video-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg3);
  border-bottom: 1px solid var(--card-border);
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(0, 0, 0, 0.12);
  border: 0;
  cursor: pointer;
  transition: background var(--transition-normal);
}

.video-play:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -4px;
}

.video-play svg {
  width: 40px;
  height: 40px;
  padding: 10px;
  fill: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--blue);
}

.video-card:hover .video-play,
.video-play:focus-visible {
  background: rgba(74, 155, 190, 0.18);
}

.video-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
}

.video-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-title a {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.video-title a:hover,
.video-title a:focus-visible {
  color: var(--blue-bright);
}

.video-title a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.video-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.video-date {
  margin-top: auto;
  padding-top: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.video-feed-status {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.video-feed-status p {
  margin: 0;
  font-size: 0.9rem;
}

.video-retry {
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 2px;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.video-retry:hover,
.video-retry:focus-visible {
  background: var(--bg3);
  border-color: var(--blue);
  color: var(--text);
}

.video-retry:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.video-feed-notice {
  width: fit-content;
  max-width: calc(100% - 2.5rem);
  margin: 1.25rem auto;
  padding: 0.5rem 1rem;
  background: rgba(200, 160, 50, 0.1);
  border: 1px solid rgba(200, 160, 50, 0.3);
  border-radius: 2px;
  color: #d9bd6a;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.video-feed-notice + .video-feed-scroll {
  padding-top: 1.25rem;
  border-top: 1px solid var(--card-border);
}

/* =========================================================
   9. FOOTER
   ========================================================= */

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 28px 40px;
  background: var(--bg);
  border-top: 1px solid var(--card-border);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.5;
  text-align: center;
}

/* =========================================================
   10. TABLET AND SMALL LAPTOPS
   ========================================================= */

@media (max-width: 900px) {
  :root {
    --pad-x: 20px;
  }

  /* Hero */

  .hero-banner {
    height: clamp(240px, 45vw, 400px);
  }

  .hero-banner img {
    padding-block: 16px;
  }

  /* Main content */

  .main-content {
    padding: 2rem 1.25rem 3rem;
  }

  /* Achievements */

  .achievement-card {
    flex-direction: column;
  }

  .card-img {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }

  .card-body-custom {
    padding: 1.5rem;
  }

  .card-title-custom {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
  }

  .card-desc-custom {
    font-size: clamp(0.9rem, 2vw, 1rem);
  }

  /* Modals */

  .modal-title {
    padding-right: 1rem;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
  }

  .modal-text {
    padding: 1.25rem;
  }

  /* Video feed */

  .video-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-feed-scroll {
    max-height: 600px;
  }

  /* Footer */

  footer {
    padding: 24px 20px;
  }
}

/* =========================================================
   11. MOBILE NAVIGATION AND LAYOUT
   ========================================================= */

@media (max-width: 767.98px) {
  :root {
    --nav-h: 56px;
    --pad-x: 12px;
  }

  /* Navigation layout */

  nav {
    flex-wrap: wrap;
    column-gap: 0.25rem;
    row-gap: 0;
    height: var(--nav-h);
    overflow: hidden;
  }

  nav.nav-open {
    height: auto;
    max-height: 100dvh;
    overflow-y: auto;
    scrollbar-width: none;
  }

  nav.nav-open::-webkit-scrollbar {
    display: none;
  }

  .nav-left,
  .nav-right {
    display: contents;
  }

  .nav-brand {
    order: 0;
    height: var(--nav-h);
  }

  .nav-icon {
    width: 28px;
    height: 28px;
  }

  .nav-toggle {
    display: flex;
    order: 1;
    margin-left: auto;
  }

  .nav-divider {
    display: none;
  }

  nav:not(.nav-open) .social-link,
  nav:not(.nav-open) .nav-cta {
    visibility: hidden;
  }

  nav.nav-open .social-link,
  nav.nav-open .nav-cta {
    visibility: visible;
  }

  /* Mobile CTA */

  .nav-cta {
    order: 4;
    display: flex;
    flex: 0 0 100%;
    align-items: center;
    justify-content: center;
    height: 56px;
    margin: 0.25rem 0;
    padding: 0 19.2px;
    font-family: "Akira Expanded", sans-serif;
    font-size: 20px;
    font-weight: normal;
    line-height: 21px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  /* Mobile social links */

  .social-link {
    order: 5;
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 48px;
    min-width: 0;
    margin: 0.25rem 0;
    padding: 0;
    color: var(--brand, var(--text));
    background: color-mix(in srgb, var(--brand, var(--text)) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand, var(--text)) 40%, transparent);
    border-radius: 2px;
    transition: color var(--transition-fast), background var(--transition-fast), border-color 0.3s ease;
  } 

  .social-link svg {
    display: block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
  }

  .social-link:hover,
  .social-link:focus-visible {
    color: var(--brand, var(--text));
    background: color-mix(in srgb, var(--brand, var(--text)) 12%, transparent);
    border-color: var(--brand, var(--text));
  }

  /* Hero */

  .hero-banner {
    height: auto;
    min-height: 200px;
  }

  /* Main content */

  .main-content {
    padding: 1.75rem 0.75rem 2.5rem;
  }

  .section-title {
    margin-bottom: 0.5rem;
    font-size: clamp(1.25rem, 6vw, 1.6rem);
    line-height: 1.25;
  }

  .section-sub {
    margin-bottom: 1.5rem;
    font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    line-height: 1.6;
  }

  /* Achievements */

  .achievements {
    gap: 0.75rem;
  }

  .achievement-card {
    min-height: 0;
  }

  .card-body-custom {
    gap: 0.6rem;
    padding: 1.15rem;
  }

  .card-title-custom {
    font-size: clamp(1.1rem, 5.5vw, 1.4rem);
    line-height: 1.25;
  }

  .card-desc-custom {
    font-size: clamp(0.85rem, 3.8vw, 0.95rem);
    line-height: 1.6;
  }

  .card-tag {
    margin-bottom: 0.5rem;
    padding: 0.18rem 0.5rem;
    font-size: 0.65rem;
  }

  .click-hint {
    padding-top: 0.6rem;
    font-size: 0.65rem;
  }

  /* Video feed */

  #videos {
    margin-top: 2.5rem;
  }

  .video-feed-scroll {
    max-height: 65vh;
    padding: 0.75rem;
  }

  .video-feed {
    gap: 0.75rem;
  }

  .video-card-body {
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .video-title {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .video-date {
    font-size: 0.7rem;
  }

  .video-play svg {
    width: 38px;
    height: 38px;
    padding: 10px;
  }

  .video-feed-status {
    gap: 0.75rem;
  }

  .video-feed-status p {
    font-size: 0.85rem;
  }

  .video-feed-notice {
    max-width: calc(100% - 1.5rem);
    margin: 0.75rem auto;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
  }

  .video-feed-notice + .video-feed-scroll {
    padding-top: 0.75rem;
  }

  /* Modals */

  .modal-header {
    padding: 0.9rem 1rem;
  }

  .modal-title {
    font-size: clamp(1rem, 5vw, 1.25rem);
    line-height: 1.3;
  }

  .modal-text {
    padding: 1rem;
  }

  .modal-text p {
    font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    line-height: 1.65;
  }

  /* Footer */

  footer {
    padding: 20px 12px;
  }

  .footer-brand {
    font-size: 11.2px;
  }
}

/* =========================================================
   12. VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 420px) {
  .video-feed {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-feed-scroll {
    max-height: 60vh;
  }
}

@media (max-width: 400px) {
  .main-content {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }

  .card-body-custom {
    padding: 1rem;
  }

  .card-title-custom {
    font-size: 1.1rem;
  }

  .card-desc-custom {
    font-size: 0.85rem;
  }

  .modal-header {
    padding: 0.8rem;
  }

  .modal-text {
    padding: 0.9rem;
  }
}

/* =========================================================
   13. ACCESSIBILITY: REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .achievement-card:hover,
  .achievement-card:focus-visible,
  .video-card:hover,
  .video-card:focus-visible {
    transform: none;
  }
}
