/* Universal page container. One of these wraps every portal page body.
 * Padding lives here so sections inside can be full-width or bleed. */
.page {
  width: min(100%, calc(var(--content-max-width) + 2 * var(--page-inline-padding)));
  box-sizing: border-box;
  margin: 0 auto;
  padding: var(--space-6) var(--page-inline-padding) 0;
}

/* Escape .page's max-width + padding so a child can run edge-to-edge
 * of the content-area (e.g. the screenshot gallery on detail pages). */
.page__bleed {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
}

/* Page title block. Default is centered text for index pages;
 * .page-header--with-icon flips to a row layout for detail pages. */
.page-header {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto var(--space-10);
}

.page-header__title {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: rgb(255 255 255 / 0.96);
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.18);
}

.page-header__summary {
  max-width: 42rem;
  color: rgb(255 255 255 / 0.76);
  font-size: var(--font-size-500);
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.18);
}

.page-header__url {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.page-header__url:hover {
  color: rgb(255 255 255 / 0.96);
}

/* ── Detail variant: icon on left, text column on right ────────────── */

.page-header--with-icon {
  display: flex;
  align-items: flex-start;
  justify-items: start;
  text-align: left;
  gap: var(--space-5);
  max-width: none;
  margin-bottom: var(--space-8);
}

.page-header--with-icon .page-header__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.04em;
  text-shadow: none;
}

.page-header__icon {
  display: block;
  width: var(--catalogue-icon-size);
  height: var(--catalogue-icon-size);
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
}

/* Universal (new-style) icons are square assets with no baked-in
 * roundness — we round their bounds here and scale them down so the
 * rendered squircle sits inside the layout slot. Legacy (non-universal)
 * icons already carry their own shape (rounded or not) in the source
 * art, so the base class leaves them alone. */
.page-header__icon--universal {
  border-radius: var(--launchpad-icon-radius);
  transform: scale(0.84);
}

.page-header__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.page-header__subtitle {
  font-size: var(--font-size-400);
  line-height: 1.35;
  color: rgb(255 255 255 / 0.75);
  margin: 0;
  max-width: 60ch;
}

.page-header__rating {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.08);
  color: rgb(255 255 255 / 0.85);
  text-decoration: none;
  font-size: var(--font-size-300);
}

.page-header__rating:hover {
  background: rgb(255 255 255 / 0.14);
}

.page-header__rating-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.page-header__rating-count {
  color: rgb(255 255 255 / 0.55);
}

.hero {
  display: grid;
  gap: var(--space-4);
  max-width: 48rem;
  margin-bottom: var(--space-10);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: var(--control-height-sm);
  padding-inline: var(--space-3);
  border: var(--border-width-thin) solid rgb(255 255 255 / 0.24);
  border-radius: var(--radius-round);
  background: rgb(255 255 255 / 0.24);
  color: var(--color-text-secondary);
  font-size: var(--font-size-200);
  font-weight: var(--font-weight-medium);
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: var(--color-text-strong);
  max-width: 12ch;
}

.hero__summary {
  max-width: 38rem;
  font-size: var(--font-size-400);
  color: var(--color-text-secondary);
}

/* ─── Index page: transparent full-bleed layout ─────────────────────────── */

[data-page="apps_home"] .content-area,
[data-page="games_home"] .content-area {
  padding: 0;
}

/* ── Hero variant: home/launchpad branded title block ──────────────── */

.page-header--hero {
  display: block;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  margin-top: var(--space-12);
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
  text-align: center;
}

.page-header__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: rgb(255 255 255 / 0.78);
  text-decoration: none;
  font-size: var(--font-size-200);
  font-weight: var(--font-weight-medium);
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.2);
  width: 100%;
  margin-bottom: 1rem;
}

.page-header__logo {
  display: block;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto var(--space-3);
  pointer-events: none;
  user-select: none;
}

.page-header__logo text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 56px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.04em;
}

.page-header__tagline {
  font-size: var(--font-size-500);
  color: rgb(255 255 255 / 0.72);
  position: relative;
  top: -2rem;
}

.section {
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-12));
}

.section__label {
  font-size: var(--font-size-200);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.55);
  margin-bottom: var(--space-4);
}
