:root {
  --bg: #07080c;
  --bg-elev: rgba(18, 20, 28, 0.72);
  --line: rgba(255, 140, 40, 0.35);
  --accent: #ff8a1a;
  --accent-hot: #ffb347;
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.62);
  --mosaic-row: 64px;
  --mosaic-gap: 0.5rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #07080c;
}

.page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(255, 120, 20, 0.14), transparent 55%),
    radial-gradient(700px 400px at 92% 0%, rgba(255, 60, 40, 0.07), transparent 50%),
    linear-gradient(180deg, #0b0d12 0%, #07080c 40%, #0a0c11 100%);
  color: var(--text);
  font-family: "Sora", "Outfit", system-ui, sans-serif;
  padding: 1.25rem 1.25rem 4rem;
}

body.has-floating:not(.floating-overlay) .page {
  padding-right: max(1.25rem, 7.5rem);
}

body.layout-mosaic {
  --mosaic-row: 140px;
}

.mosaic,
.featured-row,
.status {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.status {
  text-align: center;
  padding: 2rem;
}

.status.error {
  color: #ff8f8f;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mosaic {
  display: flex;
  flex-direction: column;
  gap: var(--mosaic-gap);
  margin-bottom: 2rem;
}

.mosaic.is-mosaic {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 4), minmax(0, 1fr));
  grid-auto-rows: var(--mosaic-row);
}

.mosaic.is-mosaic .mosaic-tile {
  height: 100%;
}

.featured-row {
  display: flex;
  align-items: stretch;
  gap: var(--mosaic-gap);
  margin-bottom: var(--mosaic-gap);
}

.featured-row[hidden] {
  display: none;
}

.featured-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 148px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #151515;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.featured-card:hover {
  border-color: rgba(255, 138, 26, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.featured-card .mosaic-body {
  min-height: 148px;
  gap: 0.7rem;
  padding: 1.1rem 0.75rem;
}

.featured-card .mosaic-logo {
  height: 52px;
}

.featured-card .logo-img {
  max-width: 90%;
}

.featured-card .mosaic-blurb {
  font-size: 0.78rem;
  font-weight: 700;
  -webkit-line-clamp: 2;
  max-height: 2.5em;
}

.mosaic-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(160deg, rgba(255, 138, 26, 0.1), transparent 42%),
    #151515;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mosaic-tile:hover {
  border-color: rgba(255, 138, 26, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.mosaic-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
}

.mosaic-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    #151515 12%,
    rgba(21, 21, 21, 0.7) 50%,
    rgba(21, 21, 21, 0.25) 100%
  );
  pointer-events: none;
}

.mosaic-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 0.75rem;
  min-height: 0;
  overflow: hidden;
}

.mosaic-tile.is-tall .mosaic-body {
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
}

.mosaic-tile.is-compact {
  height: var(--mosaic-row);
  border-radius: 10px;
  border-color: var(--line);
  background: #151515;
  cursor: pointer;
}

.mosaic-tile.is-compact:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.mosaic-tile.is-compact .mosaic-bg,
.mosaic-tile.is-compact .mosaic-shade {
  display: none;
}

.mosaic-tile.is-compact .mosaic-body {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
}

.mosaic-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  overflow: hidden;
}

.mosaic-tile.is-compact .mosaic-logo {
  width: 7.5rem;
  height: 36px;
  justify-content: flex-start;
}

.mosaic-tile.is-compact .logo-img {
  max-width: 100%;
}

.mosaic-tile.is-tall .mosaic-logo {
  height: 52px;
}

.mosaic-tile.is-wide.is-tall .mosaic-logo {
  height: 56px;
}

.logo-img {
  display: block;
  max-width: 88%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-fallback {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 138, 26, 0.15);
  color: var(--accent-hot);
  font-weight: 700;
  font-family: "Outfit", sans-serif;
  flex: 0 0 auto;
}

.mosaic-copy {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.mosaic-tile.is-compact .mosaic-copy {
  flex: 1 1 auto;
  width: auto;
  text-align: center;
}

.mosaic-name {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.mosaic-blurb {
  margin: 0;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-height: 2.5em;
}

.mosaic-tile.is-compact .mosaic-blurb {
  font-size: 0.82rem;
  font-weight: 600;
  -webkit-line-clamp: 1;
  max-height: 1.35em;
  line-height: 1.3;
}

.mosaic-tile.is-tall .mosaic-blurb {
  font-size: 0.8rem;
  -webkit-line-clamp: 2;
  max-height: 2.4em;
}

.mosaic-blurb-fallback {
  color: var(--muted);
  font-weight: 600;
}

.mosaic-tile .cta {
  flex: 0 0 auto;
  align-self: center;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.mosaic-tile.is-compact .cta {
  border-radius: 10px;
  padding: 0.42rem 0.9rem;
  font-size: 0.72rem;
}

.cta,
.cta-small {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: #1a0d00;
  background: linear-gradient(180deg, #ffb347 0%, var(--accent) 100%);
  box-shadow: 0 6px 16px rgba(255, 120, 20, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:hover,
.cta-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255, 120, 20, 0.32);
}

.floating-stack {
  position: fixed;
  right: 0;
  top: 28%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 120px;
}

.floating-stack:empty,
.floating-stack[hidden] {
  display: none !important;
}

.floating-card {
  position: relative;
  width: 110px;
  padding: 1rem 0.65rem 0.7rem;
  border-radius: 14px 0 0 14px;
  border: 1px solid var(--line);
  border-right: none;
  background: rgba(12, 14, 20, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  box-shadow: -8px 12px 30px rgba(0, 0, 0, 0.4);
}

.floating-card .logo-img {
  max-height: 32px;
  max-width: 90%;
}

.floating-close {
  position: absolute;
  top: 4px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.cta-small {
  border-radius: 999px;
  padding: 0.4rem 0.55rem;
  font-size: 0.68rem;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .mosaic-tile:nth-child(-n + 8),
  .featured-card:nth-child(-n + 8) {
    animation: rise 0.45s ease both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  :root {
    --mosaic-row: 58px;
  }

  body.layout-mosaic {
    --mosaic-row: 96px;
    --mosaic-gap: 0.35rem;
  }

  body.layout-mosaic .mosaic-tile .mosaic-body {
    gap: 0.35rem;
    padding: 0.5rem 0.4rem;
  }

  body.layout-mosaic .mosaic-tile.is-tall .mosaic-logo,
  body.layout-mosaic .mosaic-tile .mosaic-logo {
    height: 32px;
  }

  body.layout-mosaic .mosaic-tile .mosaic-blurb {
    font-size: 0.64rem;
    -webkit-line-clamp: 1;
    max-height: 1.3em;
  }

  body.layout-mosaic .mosaic-tile .cta {
    padding: 0.28rem 0.4rem;
    font-size: 0.58rem;
  }

  .page {
    padding-right: 1.25rem;
  }

  body.has-floating:not(.floating-overlay) .page {
    padding-right: 6.25rem;
  }

  .floating-stack {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    left: auto;
    right: 0;
    top: 22%;
    bottom: auto;
    width: auto;
    max-width: 92px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
  }

  .floating-card {
    flex: none;
    width: 86px;
    min-width: 0;
    max-width: none;
    padding: 0.7rem 0.4rem 0.5rem;
    border-radius: 12px 0 0 12px;
    border-right: none;
    box-shadow: -8px 12px 30px rgba(0, 0, 0, 0.4);
  }

  .floating-card .logo-img {
    max-height: 22px;
  }

  .floating-card .cta-small {
    font-size: 0.58rem;
    padding: 0.32rem 0.3rem;
  }

  .floating-close {
    top: 2px;
    right: 4px;
    padding: 0.25rem;
  }
}

@media (max-width: 560px) {
  :root {
    --mosaic-row: 52px;
    --mosaic-gap: 0.4rem;
  }

  body.layout-mosaic {
    --mosaic-row: 72px;
    --mosaic-gap: 0.28rem;
  }

  body.layout-mosaic .mosaic-tile .mosaic-body {
    gap: 0.22rem;
    padding: 0.35rem 0.28rem;
  }

  body.layout-mosaic .mosaic-tile.is-tall .mosaic-logo,
  body.layout-mosaic .mosaic-tile .mosaic-logo {
    height: 22px;
  }

  body.layout-mosaic .mosaic-tile .cta {
    display: none;
  }

  .mosaic-tile.is-compact {
    cursor: pointer;
  }

  .mosaic-tile.is-compact .mosaic-body {
    gap: 0.55rem;
    padding: 0.25rem 0.65rem;
  }

  .mosaic-tile.is-compact .mosaic-logo {
    width: 6.25rem;
    height: 30px;
  }

  .mosaic-tile.is-compact .logo-img {
    max-width: 100%;
  }

  .mosaic-tile.is-compact .mosaic-copy {
    text-align: right;
  }

  .mosaic-tile.is-compact .mosaic-blurb {
    font-size: 0.68rem;
    font-weight: 600;
  }

  .mosaic-tile.is-compact .cta {
    display: none;
  }

  .mosaic-tile.is-tall .mosaic-logo {
    height: 44px;
  }

  .featured-card,
  .featured-card .mosaic-body {
    min-height: 96px;
  }

  .featured-card .mosaic-body {
    gap: 0.35rem;
    padding: 0.5rem 0.3rem 0.45rem;
  }

  .featured-card .mosaic-logo {
    height: 28px;
  }

  .featured-card .mosaic-blurb {
    font-size: 0.58rem;
    font-weight: 600;
    -webkit-line-clamp: 2;
    max-height: 2.4em;
  }
}