/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --color-brand: #0083FF;
  --color-bright: #f44336;
  --color-primary: #2a77ef;
  --color-success: #72CC78;
  --color-warning: #ccba73;
  --color-error: #cd5843;
  --color-bg: #181819;
  --color-bg-dark: #111113;
  --color-bg-card: #232323;
  --color-bg-tooltip: #3f3f3f;
  --color-button-grey: #383838;
  --color-text: #737373;
  --color-text-card: #939393;
  --color-text-tooltip: #737c85;
  --color-text-dark: #414141;
  --color-text-highlight: #ffffff;
  --color-border-card: #3d3d3d;
  --color-border-dark: #302f32;
  --grid-gap: 40px;
  --phone-radius: 4em;
}

/* ========================================
   BASE STYLES
   ======================================== */
html {
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", "Roboto", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 16px;
  font-style: normal;
  line-height: 1.375em;
  min-height: 100%;
  padding: 0;
  margin: 0;

  .mobile-only {
    display: none !important;
  }

  @media (max-width: 480px) {
    font-size: 12px;
    --phone-radius: 6.666em;
    --grid-gap: 20px;

    .mobile-only {
      display: block !important;
    }

    .no-mobile,
    .no-tablet,
    .no-smallres {
      display: none !important;
    }
  }

  @media (min-width: 480px) and (max-width: 800px) {
    font-size: 13px;
    --phone-radius: 3em;

    .no-tablet,
    .no-smallres {
      display: none !important;
    }
  }

  @media (min-width: 800px) and (max-width: 1024px) {
    font-size: 15px;
    --phone-radius: 4.5em;

    .no-smallres {
      display: none !important;
    }
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wrapper {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 25px;
  text-align: center;
  width: 100%;

  @media (max-width: 480px) {
    overflow-x: hidden;
  }
}

section {
  padding: 50px 0;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
.logo {
  color: #ffffff;
  font-family: "Noto Sans";
  font-size: 2.25em;
  font-weight: 400;
  text-transform: lowercase;
  text-decoration: none;
}

h1,
h2 {
  font-family: "Noto Sans";
}

h1 {
  color: var(--color-text-highlight);
  display: block;
  font-size: 2.5em;
  font-weight: 600;
  line-height: 1.125em;
  margin: 0;
  padding-bottom: 40px;
}

h2 {
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1.3em;
  margin: 0;
  padding: 0 0 30px 0;
}

h3 {
  color: var(--color-text-highlight);
  font-size: 1.625em;
  font-weight: 300;
  line-height: 1.385em;
  margin: 0;
  padding: 0;
}

p {
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1.3em;
  margin: 0;
  padding: 0;

  &.padded {
    padding: 0 0 30px 0;
  }
}

.header {
  color: var(--color-text-highlight);
  display: block;
  font-size: 1.875em;
  font-weight: 600;
  margin: 0;
  padding-bottom: 60px;

  &.crunched {
    padding-bottom: 20px;
  }
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  &[data-src] {
    filter: blur(5px);
    transform: scale(1.1);
    transition: filter 0.5s ease-out;
  }

  &.loaded {
    filter: blur(0);
    transform: scale(1);
  }
}

/* ========================================
   REUSABLE COMPONENTS
   ======================================== */

/* Card Component */
.card {
  background: var(--color-bg-card);
  border-radius: 10px;
  box-sizing: border-box;
  padding: 20px;
}

/* Button Component */
.button,
.btn-primary {
  align-items: center;
  background: var(--color-primary);
  border: none;
  border-radius: 25px;
  color: var(--color-text-highlight);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  grid-gap: 10px;
  height: 50px;
  justify-content: center;
  padding: 0 25px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: fit-content;

  &:hover {
    transform: translateY(1px);
  }

  &:active {
    transform: translateY(0);
  }

  &.disabled {
    opacity: 0.5;
  }

  @media (max-width: 480px) {
    padding: 0;
    width: 100%;
  }
}

/* Story Cover Base Component - Consolidated from 6+ duplicate definitions */
.story-cover,
#feature-story-cover {
  background: var(--color-bg-card);
  border-radius: 8px;
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;

  img {
    display: block;
    width: 100%;
    object-fit: cover;
  }

  /* Banner Badge */
  .banner {
    align-items: center;
    aspect-ratio: 1/1;
    border-radius: 5px;
    color: #ffffff;
    display: flex;
    font-size: 22px;
    height: auto;
    justify-content: center;
    left: 5px;
    margin: auto;
    position: absolute;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    top: 5px;
    z-index: 2;
  }

  /* Rating Badge */
  .rating {
    background: var(--color-bg-dark);
    border-radius: 5px;
    color: var(--color-text-highlight);
    font-size: 10px;
    font-weight: 300;
    margin: 8px;
    padding: 2px 5px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 2;
  }

  /* Story Details Overlay */
  .story-details {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9));
    border-radius: 0 0 8px 8px;
    bottom: 0;
    color: var(--color-text-highlight);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    left: 0;
    padding: 10px 5px;
    position: absolute;
    right: 0;
    text-align: center;
    z-index: 1;

    .story-logo,
    .logo {
      display: block;
      height: auto;
      margin: 0 auto;
      object-fit: contain;
      width: 94%;

      &.loaded {
        opacity: 1;
      }
    }

    .tags {
      display: block;
      font-size: 10px;
      margin-top: 5px;
      opacity: 0.8;
    }
  }
}

/* Special story cover with larger border radius */
.story .story-cover,
#feature-story-cover {
  border-radius: 10px;

  .story-details {
    border-radius: 0 0 10px 10px;
  }
}


/* Circular feature component base */
.circle {
  aspect-ratio: 1/1;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90%;
  position: absolute;
  margin: auto;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;

  @media (max-width: 480px) {
    height: auto;
    width: 90%;
  }
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  border-top: 1px solid var(--color-border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-gap: 10px;
  margin-top: 40px;
  padding-top: 20px;

  a.prev,
  a.next {
    color: var(--color-text-highlight);
  }
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */
#masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50px 25px;

  @media (max-width: 480px) {
    padding: 30px 10px;
  }

  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  nav ul {
    display: flex;
    gap: 20px;

    a {
      text-decoration: none;
      color: var(--color-text-highlight);
      font-size: 1em;
      font-weight: 500;
      line-height: 1.375em;
    }
  }

  .mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 25px;
    padding: 0;
    position: relative;
    z-index: 10;
    color: var(--color-text-highlight);
    text-align: right;

    .fa-solid {
      width: auto;
    }
  }

  @media (max-width: 480px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;

    .header-top {
      width: 100%;
    }

    .mobile-menu-toggle {
      display: flex;
    }

    nav {
      display: none;
      width: 100%;
      margin-top: 20px;
      padding: 20px 0;
      position: relative;
      text-align: right;

      &:after {
        content: '';
        display: block;
        /* width: 100%; */
        height: 100%;
        background: var(--color-bg-dark);
        position: absolute;
        bottom: 0;
        left: -35px;
        right: -35px;
        z-index: -1;
      }

      ul {
        flex-direction: column;
        gap: 15px;
        width: 100%;
      }
    }

    &.menu-open {
      nav {
        display: block;
      }
    }
  }
}

#call-to-action {
  background: var(--color-bg-card);
  border-radius: 10px;
  margin: 0 20px 50px 20px;
  padding: 50px 0;

  @media (max-width: 480px) {
    margin-left: 10px;
    margin-right: 10px;
    padding: 25px;
  }

  h4 {
    color: var(--color-text-highlight);
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3em;
    margin: 0;
    padding: 0;
  }

  p {
    font-size: 1.25em;
    font-weight: 400;
    line-height: 1.3em;
    margin: 10px 0 20px 0;
    padding: 0;
  }

  .actions {
    display: flex;
    grid-gap: 10px;
    list-style: none;
    justify-content: center;
    padding: 0;

    @media (max-width: 480px) {
      flex-direction: column;
    }

    li {
      align-items: center;
      background: #000000;
      border-radius: 25px;
      color: var(--color-text-highlight);
      display: inline-flex;
      grid-gap: 10px;
      justify-content: center;

      &.discord {
        background: #7289da;
      }

      a {
        align-items: center;
        color: var(--color-text-highlight);
        display: inline-flex;
        grid-gap: 10px;
        height: 50px;
        text-decoration: none;
        padding: 0 25px;
      }
    }
  }
}

#footer {
  background: var(--color-bg-dark);
  margin-top: auto;
  padding: 50px 0 20px 0;

  .wrapper {
    display: flex;
    justify-content: space-between;

    &.main {
      @media (max-width: 480px) {
        flex-direction: column;
        grid-gap: 20px;
      }
    }

    &.legal {
      border-top: 1px solid var(--color-bg);
      justify-content: center;
      grid-gap: 20px;
      margin-top: 20px;
      padding-top: 20px;

      @media (max-width: 480px) {
        flex-direction: column;
      }

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

    .footer-content {
      display: flex;
      flex-direction: column;
      grid-gap: 20px;
      max-width: 40%;
      text-align: left;

      @media (max-width: 480px) {
        max-width: 100%;
      }

      p {
        font-size: 1em;
      }
    }

    .nav-columns {
      display: flex;
      grid-gap: 60px;
      text-align: left;

      @media (max-width: 480px) {
        flex-direction: column;
        margin-top: 20px;

        li {
          width: 100%;
        }
      }

      .nav-title {
        color: var(--color-text-card);
        display: block;
        font-size: 1em;
        text-transform: uppercase;
        padding-bottom: 20px;
      }

      .nav-links {
        display: flex;
        flex-direction: column;
        grid-gap: 10px;

        a {
          color: var(--color-text-highlight);
          text-decoration: none;
          font-size: 1em;
          font-weight: 500;
          line-height: 1.375em;
        }
      }
    }
  }
}




/* ========================================
   BLOG & CONTENT PAGES - Shared Styles
   ======================================== */
.blog,
.page,
.changelog,
.roadmap {
  padding: 0 25px 50px 25px;
  text-align: left;

  @media (max-width: 480px) {
    padding: 0 10px 50px 10px;
  }

  section {
    padding: 0;
  }

  .header-meta {
    color: var(--color-text-card);
    display: block;
    font-size: 0.8em;
    margin: 0 0 5px 0;
    padding: 0;
  }

  h1 {
    padding-bottom: 30px;

    @media (max-width: 480px) {
      text-align: left;
    }
  }

  h2 {
    color: var(--color-text-highlight);
    font-size: 1.8em;
    margin-top: 30px;
    padding: 0;
  }

  p,
  li,
  dd,
  a {
    color: var(--color-text-card);
    font-size: 1em;
    line-height: 1.7em;
  }

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

    &:hover {
      opacity: 0.8;
    }
  }

  p {
    margin: 15px 0;
  }

  dl {
    dt {
      color: var(--color-text-highlight);
      line-height: 1.7em;
    }

    dd {
      margin: 0 0 15px 0;
    }
  }
}

/* Blog specific styles */
.blog {
  &.article {
    margin: 0 auto;
    width: 70%;

    @media (max-width: 480px) {
      width: auto;
    }
  }

  /* Content lists (in article text) get bullets */
  ul,
  ol {
    margin: 15px 0 15px 30px;

    li {
      position: relative;

      &::before {
        content: "•";
        font-size: 1.6em;
        position: absolute;
        left: -22px;
        top: 0;
      }
    }
  }

  /* But structural lists don't get bullets */
  .post-grid,
  .related-stories-list {
    margin: 0;

    li::before {
      content: '' !important;
    }
  }

  h1 {
    font-size: 2.5em;
    line-height: 1.125em;
    padding-bottom: 20px;

    @media (max-width: 480px) {
      padding-bottom: 10px;
    }
  }

  .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    h2 {
      margin: 0;
    }
  }

  .post-grid {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
    margin: 0;
    padding: 0;

    @media (max-width: 480px) {
      grid-template-columns: repeat(1, 1fr);
    }

    li {
      text-align: left;

      &::before {
        content: '';
      }

      .post-image {
        align-items: center;
        aspect-ratio: 16/9;
        background: var(--color-bg-card);
        border-radius: 6px;
        font-size: 1.2em;
        font-weight: 200;
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
        overflow: hidden;
        width: 100%;

        img {
          display: block;
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }

      .post-body {

        h3 {
          font-size: 1.2em;
        }

        a {
          color: var(--color-text-highlight);
          line-height: 1.1em;

          &.category-tag {
            color: var(--color-text-card);
          }
        }

        time {
          font-size: 0.8em;
        }
      }

      .post-meta {
        display: flex;
        align-items: center;
        font-size: 0.8em;
        grid-gap: 10px;
      }
    }
  }
}

/* Page specific - minimal additional styles needed */
.page {
  h1 {
    text-transform: capitalize;
  }
}