/* Open Design complete homepage rebuild.
   One page shell, one section container and one item-card language. */
body.atlas-home-v5 {
  --home-max: 1380px;
  --home-radius: 16px;
  --home-item-radius: 10px;
  --home-gap: 20px;
}

body.atlas-home-v5 > .container {
  width: 100%;
  margin: 0;
  padding: 0;
}

body.atlas-home-v5 > .container > .content {
  flex: 1 1 100%;
  width: 100%;
}

body.atlas-home-v5 > .container > .sidebar { display: none; }

.home-v5 {
  display: grid;
  width: 100%;
  margin: 26px 0 72px;
  gap: 22px;
}

.home-v5,
.home-v5 * { box-sizing: border-box; }

.home-v5 a { color: inherit; text-decoration: none; }

.home-v5-intro {
  padding: 2px 2px 4px;
}

.home-v5-intro h1 {
  margin: 7px 0 6px;
  color: var(--atlas-ink);
  font: 700 clamp(26px, 3vw, 40px)/1.12 var(--atlas-display);
  letter-spacing: -.045em;
}

.home-v5-intro p {
  margin: 0;
  color: var(--atlas-muted);
  font-size: 14px;
  line-height: 1.7;
}

.home-v5-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--atlas-line);
  border-radius: var(--home-radius);
  background: var(--atlas-surface);
  box-shadow: var(--atlas-shadow);
}

.home-v5-head {
  display: flex;
  min-height: 78px;
  padding: 17px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--atlas-line);
}

.home-v5-head > div { min-width: 0; }

.home-v5-head h2,
.home-v5-family-panel h3 {
  margin: 3px 0 0;
  color: var(--atlas-ink);
  font-family: var(--atlas-display);
  font-weight: 700;
  letter-spacing: -.035em;
}

.home-v5-head h2 { font-size: clamp(22px, 2vw, 28px); }
.home-v5-family-panel h3 { font-size: 20px; }

.home-v5-head p {
  margin: 5px 0 0;
  color: var(--atlas-muted);
  font-size: 12px;
}

.home-v5-head > a,
.home-v5-family-panel header > a {
  flex: 0 0 auto;
  color: var(--atlas-accent-strong);
  font-size: 12px;
  font-weight: 750;
}

.home-v5-head > a:hover,
.home-v5-family-panel header > a:hover { color: var(--atlas-accent); }

.home-v5-eyebrow,
.home-v5-family-panel header span,
.home-v5-watch header span {
  color: var(--atlas-accent-strong);
  font: 700 10px/1.3 var(--atlas-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.home-v5-body { padding: 16px; }

.home-v5-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--atlas-line);
  border-radius: var(--home-item-radius);
  background: var(--atlas-surface-2);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--atlas-ink) 5%, transparent);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.home-v5-item:hover {
  z-index: 1;
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--atlas-accent) 55%, var(--atlas-line));
  background: var(--atlas-surface);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--atlas-ink) 10%, transparent);
}

.home-v5-item:focus-visible,
.home-v5 a:focus-visible {
  outline: 3px solid var(--atlas-accent-soft);
  outline-offset: 2px;
}

/* Hero */
.home-v5-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(290px, .72fr);
  min-height: 410px;
}

.home-v5-hero-feature {
  position: relative;
  display: flex;
  min-height: 410px;
  padding: clamp(32px, 5vw, 68px);
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(135deg, var(--atlas-cover-a), var(--atlas-cover-b));
  color: #fff;
}

.home-v5-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-v5-hero-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 22, 35, .94) 0%, rgba(9, 22, 35, .68) 49%, rgba(9, 22, 35, .12) 100%),
    linear-gradient(180deg, transparent 52%, rgba(4, 12, 20, .45));
  pointer-events: none;
}

.home-v5-hero-copy {
  position: relative;
  z-index: 1;
  width: min(640px, 86%);
}

.home-v5-hero-copy .home-v5-eyebrow { color: #75e2c4; }

.home-v5-hero-copy h2 {
  margin: 10px 0 14px;
  color: #fff;
  font: 700 clamp(38px, 4.8vw, 68px)/1.02 var(--atlas-display);
  letter-spacing: -.06em;
}

.home-v5-hero-copy p {
  display: -webkit-box;
  max-width: 580px;
  margin: 0 0 24px;
  overflow: hidden;
  color: rgba(255,255,255,.82);
  font-size: 15px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-v5-hero-copy strong {
  display: inline-flex;
  min-height: 46px;
  padding: 0 18px;
  align-items: center;
  gap: 16px;
  border-radius: 8px;
  background: var(--atlas-accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(5, 47, 41, .28);
  font-size: 14px;
}

.home-v5-watch {
  display: flex;
  min-width: 0;
  padding: 22px;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid var(--atlas-line);
  background: var(--atlas-surface);
}

.home-v5-watch header {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--atlas-line);
}

.home-v5-watch header h2 {
  margin: 3px 0 0;
  font: 700 23px var(--atlas-display);
}

.home-v5-watch-list { display: grid; gap: 10px; }

.home-v5-watch-card {
  display: grid;
  min-height: 66px;
  padding: 9px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.home-v5-watch-art,
.home-v5-family-icon {
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-surface);
  color: var(--atlas-accent-strong);
  font-weight: 800;
}

.home-v5-watch-art { width: 46px; height: 46px; border-radius: 8px; }
.home-v5-watch-art img,
.home-v5-family-icon img { width: 100%; height: 100%; object-fit: contain; }

.home-v5-watch-copy { min-width: 0; }

.home-v5-watch-copy b,
.home-v5-watch-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-v5-watch-copy b { font-size: 13px; }
.home-v5-watch-copy small { margin-top: 4px; color: var(--atlas-muted); font-size: 11px; }
.home-v5-watch-card > em { color: var(--atlas-accent); font-style: normal; }

/* Categories and gateways */
.home-v5-category-grid {
  display: grid;
  padding: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.home-v5-category-card {
  display: flex;
  min-height: 48px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--atlas-muted);
  font-size: 12px;
}

.home-v5-category-card b { color: var(--atlas-accent); }

.home-v5-gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-v5-gateway-card {
  position: relative;
  display: grid;
  min-height: 104px;
  padding: 18px 20px;
  align-content: center;
  gap: 3px;
  border-right: 1px solid var(--atlas-line);
  transition: background-color .16s ease;
}

.home-v5-gateway-card:last-child { border-right: 0; }
.home-v5-gateway-card:hover { background: var(--atlas-accent-soft); }
.home-v5-gateway-card > span { color: var(--atlas-accent-strong); font: 700 9px var(--atlas-mono); letter-spacing: .12em; }
.home-v5-gateway-card > strong { font: 700 19px var(--atlas-display); }
.home-v5-gateway-card > small { color: var(--atlas-muted); font-size: 11px; }
.home-v5-gateway-card > b { position: absolute; right: 18px; bottom: 10px; color: color-mix(in srgb, var(--atlas-accent) 25%, transparent); font: 700 30px var(--atlas-display); }

/* Insight lists */
.home-v5-insight-grid { display: grid; grid-template-columns: .94fr 1.06fr; }
.home-v5-insight-panel { min-width: 0; }
.home-v5-insight-panel + .home-v5-insight-panel { border-left: 1px solid var(--atlas-line); }
.home-v5-list { display: grid; padding: 12px; gap: 7px; }

.home-v5-rank-row,
.home-v5-guide-row {
  display: grid;
  min-height: 48px;
  padding: 0 12px;
  align-items: center;
  gap: 12px;
  box-shadow: none;
}

.home-v5-rank-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
.home-v5-guide-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
.home-v5-rank-row > b,
.home-v5-guide-row > i { color: var(--atlas-accent-strong); font: 700 10px var(--atlas-mono); }
.home-v5-guide-row > i { font-style: normal; }
.home-v5-rank-row > span,
.home-v5-guide-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.home-v5-rank-row > em,
.home-v5-guide-row > time { color: var(--atlas-muted); font: 10px var(--atlas-mono); font-style: normal; }

/* The same resource-card component is used by catalog and homepage. */
.home-v5-release-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-v5-collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* Three resource families */
.home-v5-family-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-v5-family-panel { min-width: 0; overflow: hidden; border: 1px solid var(--atlas-line); border-radius: 12px; background: var(--atlas-surface-2); }
.home-v5-family-panel header { display: flex; min-height: 68px; padding: 14px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--atlas-line); background: var(--atlas-surface); }
.home-v5-family-list { display: grid; padding: 10px; gap: 7px; }
.home-v5-family-card { display: grid; min-height: 61px; padding: 8px; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; box-shadow: none; }
.home-v5-family-icon { width: 42px; height: 42px; border-radius: 9px; }
.home-v5-family-card > span:nth-child(2) { min-width: 0; }
.home-v5-family-card > span:nth-child(2) b,
.home-v5-family-card > span:nth-child(2) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-v5-family-card > span:nth-child(2) b { font-size: 11px; }
.home-v5-family-card > span:nth-child(2) small { margin-top: 4px; color: var(--atlas-muted); font-size: 9px; }
.home-v5-family-card > em { color: var(--atlas-accent); font-style: normal; }

/* Collections */
.home-v5-collection-card { min-height: 170px; }
.home-v5-collection-art {
  position: relative;
  display: block;
  height: 102px;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--atlas-cover-a) 86%, #fff), var(--atlas-cover-b));
}
.home-v5-collection-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-v5-collection-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgb(9 31 52 / 22%));
  pointer-events: none;
}
.home-v5-collection-card > span:nth-child(2) { display: block; padding: 12px 14px 4px; }
.home-v5-collection-card > span:nth-child(2) b { display: block; font: 700 18px var(--atlas-display); }
.home-v5-collection-card > span:nth-child(2) small { display: block; margin-top: 4px; color: var(--atlas-muted); font-size: 10px; }
.home-v5-collection-card > em { display: block; padding: 0 14px 13px; color: var(--atlas-accent-strong); font-size: 10px; font-style: normal; }

.home-v5-empty { grid-column: 1 / -1; margin: 0; padding: 24px; color: var(--atlas-muted); text-align: center; font-size: 12px; }

@media (max-width: 1120px) {
  .home-v5-hero-grid { grid-template-columns: 1.5fr .8fr; }
  .home-v5-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-v5-release-grid,
  .home-v5-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .home-v5 { margin-top: 16px; }
  .home-v5-hero-grid,
  .home-v5-insight-grid { grid-template-columns: 1fr; }
  .home-v5-watch { border-top: 1px solid var(--atlas-line); border-left: 0; }
  .home-v5-watch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-v5-insight-panel + .home-v5-insight-panel { border-top: 1px solid var(--atlas-line); border-left: 0; }
  .home-v5-category-grid,
  .home-v5-release-grid,
  .home-v5-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-v5-family-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .home-v5 { margin: 12px 0 48px; gap: 14px; }
  .home-v5-section { border-radius: 13px; }
  .home-v5-head { min-height: 68px; padding: 14px; }
  .home-v5-head h2 { font-size: 22px; }
  .home-v5-head p { display: none; }
  .home-v5-hero-feature { min-height: 370px; padding: 28px 22px; }
  .home-v5-hero-copy { width: 100%; }
  .home-v5-hero-copy h2 { font-size: 38px; }
  .home-v5-watch { padding: 14px; }
  .home-v5-watch-list { grid-template-columns: 1fr; }
  .home-v5-category-grid,
  .home-v5-release-grid,
  .home-v5-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-v5-gateway-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-v5-gateway-card:nth-child(2) { border-right: 0; }
  .home-v5-gateway-card:nth-child(-n+2) { border-bottom: 1px solid var(--atlas-line); }
  .home-v5-body { padding: 10px; }
}

@media (max-width: 390px) {
  .home-v5-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-v5-collection-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .home-v5-item { transition: none; }
}
