/* The homepage hero: artwork, logo, headline, calls to action and the partner
   sites. The 404 page borrows its row of buttons. */

@layer layout {
  .hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    align-items: center;
    min-height: clamp(520px, 46vw, 680px);
    padding-block: 72px 96px;
    text-align: center;
    /* The three raid scenes blended in a 48 px copy, as the backdrop shows them
       (85% over the page color): smooth when scaled up, until one fades in. */
    background: var(--bg-primary)
      url("data:image/webp;base64,UklGRqIAAABXRUJQVlA4IJYAAACQBACdASowABAAPp0+mUgloyKhNVgIALATiWUAqPmsUdrm5FcX9/P/lRgg7zoA/vc/p1AuyKiJzgVC9+AHO0SnqZ9+lsUc0E9yYOxMnxMscA77sYdUbw836dCykyrWOoSXb1swm+Hmp9KX8Q9IIpfjHBeBycon8YMsa4s+T7IQKsj6kuCWZ6cCE/AcqQgDjFA9hssAAAA=")
      center top / cover no-repeat;
  }

  /* The raid scenes, 85% over the page color. site.js puts one in here at
     random from the template, then fades slowly to the next. */
  .hero-art {
    position: absolute;
    inset: 0;
    z-index: -3;
    opacity: 0.85;
  }

  .hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center top;
    animation: hero-art-in 900ms ease-out both;
  }

  /* site.js keeps a scene hidden until it has fully decoded, so it fades in
     whole instead of painting in bands while it downloads. */
  .hero-backdrop.is-loading {
    opacity: 0;
    animation: none;
  }

  /* The next scene, fading in slowly over the one before; site.js removes
     the old one when this ends. */
  .hero-backdrop.is-next {
    animation-duration: 3s;
    animation-timing-function: ease-in-out;
  }

  .hero::before,
  .hero::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
  }

  .hero::before {
    z-index: -2;
    background: linear-gradient(
      180deg,
      rgb(23 23 23 / 30%),
      rgb(23 23 23 / 10%) 40%,
      var(--bg-primary) 100%
    );
  }

  .hero::after {
    z-index: -1;
    background: radial-gradient(
      ellipse 42% 55% at 50% 48%,
      rgb(17 17 17 / 72%),
      transparent 100%
    );
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-logo {
    width: clamp(240px, 30vw, 400px);
    height: auto;
    aspect-ratio: 560 / 298;
    object-fit: contain;
    margin-bottom: 22px;
    filter: drop-shadow(0 10px 28px rgb(0 0 0 / 70%));
    animation: hero-reveal 900ms ease-out both;
  }

  /* The label above the row of game badges. */
  .supported-game {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 10px;
    border: 1px solid rgb(208 147 87 / 35%);
    border-radius: 16px;
    background: rgb(17 17 17 / 85%);
  }

  .supported-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* The supported games: a round badge each, its icon in the colour that
     version's dashboard uses (dashboard/css/themes.css), Forever first in
     copper. The name is the tooltip. */
  .supported-versions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .supported-versions .version-badge {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 12%, rgb(17 17 17));
    cursor: default;
    transition: border-color 150ms, background-color 150ms;
  }

  .supported-versions .version-badge:hover,
  .supported-versions .version-badge:focus-visible {
    border-color: currentColor;
    background: color-mix(in srgb, currentColor 22%, rgb(17 17 17));
  }

  .supported-versions .version-forever {
    color: var(--accent);
  }

  .supported-versions .version-classic {
    color: #e0b354;
  }

  .supported-versions .version-tbc {
    color: #8fd14f;
  }

  .supported-versions .version-wotlk {
    color: #7cc4ef;
  }

  .supported-versions .version-cata {
    color: #f4845a;
  }

  .supported-versions .version-mop {
    color: #4fc9a5;
  }

  .hero h1 {
    font-size: clamp(34px, 4.2vw, 54px);
    letter-spacing: -1.6px;
    line-height: 1.08;
    margin-top: 26px;
    text-shadow: 0 4px 24px rgb(0 0 0 / 70%);
  }

  .hero-description {
    max-width: 560px;
    font-size: 17px;
    color: #d4cfc5;
    margin-top: 22px;
    line-height: 1.65;
    text-shadow: 0 2px 10px rgb(0 0 0 / 70%);
  }

  .hero-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
  }

  /* The 404 page's buttons sit under its left-aligned text. */
  .not-found-actions {
    justify-content: flex-start;
  }

  .hero-actions .button {
    min-height: 52px;
    padding: 14px 24px;
    font-size: 14px;
  }

  .fine-print {
    color: #bcb3a4;
    font-size: 12px;
    margin-top: 16px;
  }

  @keyframes hero-reveal {
    from {
      opacity: 0;
    }

    to {
      opacity: 0.85;
    }
  }

  @keyframes hero-art-in {
    from {
      opacity: 0;
    }
  }
}

@layer components {
  /* The GuildCoreLoot addon on CurseForge, as on GuildCore's homepage. */
  .hero .addon-link {
    margin-top: 20px;
    border-color: rgb(198 170 114 / 40%);
  }

  .addon-link .ui-icon {
    color: #f16436;
    transform: translateY(-1px);
  }

  /* Partner sites: a band set apart from the calls to action, its label in
     the supported-game pill's type between copper hairlines, each partner a
     chip with the hero buttons' corners and the pill's border and fill. */
  .hero-partners {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 64px;
  }

  .hero-partners h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .hero-partners h2::before,
  .hero-partners h2::after {
    width: 36px;
    height: 1px;
    content: "";
    background: rgb(208 147 87 / 35%);
  }

  .hero-partners ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .hero-partners a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 16px 8px 12px;
    border: 1px solid rgb(208 147 87 / 35%);
    border-radius: 7px;
    background: rgb(17 17 17 / 85%);
    color: var(--text-warm);
    font-size: 13px;
    text-decoration: none;
    transition:
      background 150ms ease,
      border-color 150ms ease;
  }

  .hero-partners a:hover {
    background: #30291f;
    border-color: var(--accent-hover);
  }

  .hero-partners img {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  .hero-partner-name {
    font-weight: 600;
  }

  .hero-partner-note {
    padding-left: 10px;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
  }
}

@layer responsive {
  @media (min-width: 1600px) {
    .hero {
      padding-block: 96px 128px;
    }
  }

  /* Phones and portrait tablets: the scene is a band across the top that
     fades out under the heading. Stretched to the tall hero's height, a 3:1
     scene would be blown up several times and show a blurred sixth of
     itself. */
  @media (max-width: 900px) {
    .hero {
      background-position: 70% top;
    }

    .hero-art {
      bottom: auto;
      height: clamp(300px, 92vw, 520px);
      mask-image: linear-gradient(180deg, #000 50%, transparent);
    }

    .hero-backdrop {
      object-position: 70% top;
    }
  }

  @media (max-width: 800px) {
    .hero {
      min-height: 480px;
      padding-block: 48px 72px;
    }
  }

  @media (max-width: 520px) {
    .hero {
      padding-block: 36px 56px;
    }

    .hero-logo {
      width: 220px;
      margin-bottom: 14px;
    }

    .hero h1 {
      font-size: 34px;
    }

    .hero-description {
      font-size: 15px;
    }

    .hero-actions {
      flex-direction: column;
      align-self: stretch;
    }

    .hero-actions .button,
    .addon-link {
      width: 100%;
    }

    .hero-partners {
      margin-top: 48px;
    }
  }
}
