/*
 * Heyming OS — home page styles.
 *
 * Built on brand.css tokens. Nothing in this file hardcodes colors;
 * everything reads from --surface-*, --text-*, --accent-primary*, etc.
 * Changing brand.css repaints the home page automatically.
 */

/* ─── Identity strip (top) ─────────────────────────────────────────── */
.hos-identity-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-caption);
  color: var(--text-2);
}
.hos-identity-strip strong {
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.hos-identity-strip a {
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--motion-hover);
}
.hos-identity-strip a:hover {
  color: var(--accent-primary-hover);
}
.hos-identity-strip span[aria-hidden] {
  color: var(--text-3);
}

/* ─── Hero ─────────────────────────────────────────────────────────── */
.hos-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  position: relative;
}
@media (min-width: 960px) {
  .hos-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 56px;
    padding: 72px 32px 48px;
  }
}

.hos-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.hos-hero-eyebrow {
  color: var(--accent-primary-hover);
  margin: 0;
}
.hos-hero-wordmark-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 4px 0;
  /* overflow visible so the splash can peek above + right of the
     wordmark without being clipped by the wrapper bounds. */
  overflow: visible;
}
.hos-hero-wordmark {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--text-1);
  aspect-ratio: 360 / 64;
  height: auto;
}
.hos-hero-tagline {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
  max-width: 18ch;
}
@media (min-width: 960px) {
  .hos-hero-tagline {
    font-size: var(--text-display);
    line-height: 1.06;
  }
}
.hos-hero-description {
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
  max-width: 48ch;
}

.hos-presence-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  font-size: var(--text-body, 1rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-1);
  background: color-mix(in srgb, var(--accent-primary, #1a73e8) 14%, var(--surface-1, #fff));
  border: 1px solid color-mix(in srgb, var(--accent-primary, #1a73e8) 35%, var(--hairline, #e5e5e0));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-primary, #1a73e8) 12%, transparent);
  max-width: max-content;
}

.hos-presence-live[hidden] {
  display: none !important;
}

.hos-presence-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary, #1a73e8);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-primary, #1a73e8) 50%, transparent);
  animation: hos-presence-pulse 2s ease-out infinite;
  flex-shrink: 0;
}

.hos-presence-live-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.95em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-on-accent, #fff);
  background: var(--accent-primary, #1a73e8);
}

.hos-presence-live-text {
  font-weight: 600;
  color: var(--text-1);
}

@keyframes hos-presence-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-primary, #1a73e8) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hos-presence-live-dot {
    animation: none;
  }
}

.hos-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
}
.hos-cta-primary,
.hos-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: background var(--motion-hover), transform var(--motion-hover),
    box-shadow var(--motion-hover);
  border: 1px solid transparent;
}
.hos-cta-primary {
  background: var(--accent-primary-bg);
  color: var(--text-on-accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent-primary-bg) 32%, transparent);
}
.hos-cta-primary:hover {
  background: var(--accent-primary-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent-primary-bg) 42%, transparent);
}
.hos-cta-secondary {
  background: var(--surface-1);
  color: var(--text-1);
  border-color: var(--hairline-strong);
}
.hos-cta-secondary:hover {
  background: var(--surface-2);
  border-color: var(--hairline-accent);
}

/* ─── Message of the day (Minecraft-style splash) ──────────────────── *
 * Clickable Minecraft-splash homage pinned to the top-right corner of
 * the hero wordmark. Reference: Minecraft's main-menu splash is a
 * bright-yellow, italic, ~-20°-tilted line with a chunky offset drop
 * shadow that gently pulses (sin-wave scale). Reproduced here using
 * brand tokens so it tracks light/dark themes — bright `--accent-yellow`
 * fill with a near-black shadow stack for the raised-pixel look.
 *
 * The splash is absolutely positioned inside .hos-hero-wordmark-wrap.
 * On desktop it peeks above + to the right of the wordmark; on small
 * screens it slides inside the wordmark bounds so it can't push the
 * viewport horizontally. transform-origin lives at the rotation's
 * visual anchor (its left edge) so the scale-pulse doesn't drift.
 *
 * Animation gated by prefers-reduced-motion so the OS-level setting
 * still wins. */
.hos-motd {
  position: absolute;
  /* Anchored in the gap between the wordmark and the "A desktop
     that fits in a tab" tagline, right-aligned with the wordmark
     so it lives roughly where the wordmark's "OS" sits above it.
     transform-origin: right top so the rotation pivots around the
     splash's upper-right corner — the rest of the element swings
     DOWN-AND-LEFT from there, which keeps the splash from ever
     reaching back UP into the wordmark on long multi-line picks.
     The hero-content flex column has a 14px gap between wordmark
     and tagline; the splash is small enough to sit comfortably in
     that channel, with at most a few pixels of overlap into the
     tagline on the very longest 3-line splashes (acceptable — the
     Minecraft splash overlaps the logo at its corner too). */
  top: 100%;
  right: 8px;
  z-index: 5;
  margin: 0;
  padding: 0;
  max-width: 12ch;
  font-family: var(--font-ui);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 800;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--accent-yellow);
  text-align: center;
  text-shadow: 2px 2px 0 #2a1f00, 1px 1px 0 #2a1f00, -1px 1px 0 #2a1f00, 1px -1px 0 #2a1f00,
    -1px -1px 0 #2a1f00, 0 3px 6px rgba(0, 0, 0, 0.45);
  transform-origin: center center;
  transform: translate(0, -50%) rotate(-18deg);
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  white-space: normal;
  /* Desktop animation keeps the centered translate so the splash
     stays vertically pinned to the wordmark mid-line while pulsing.
     Tablet/mobile use a separate animation (hos-motd-pulse-tilt)
     because @keyframes can't be scoped inside @media — the last
     declared rule would win for every viewport. */
  animation: hos-motd-pulse-center 1s ease-in-out infinite;
  transition: color var(--motion-hover), filter var(--motion-hover);
}
.hos-motd:hover,
.hos-motd:focus-visible {
  color: var(--warning);
  filter: brightness(1.15);
  outline: none;
}
.hos-motd:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
@keyframes hos-motd-pulse-center {
  0%,
  100% {
    transform: translate(0, -50%) rotate(-18deg) scale(1);
  }
  50% {
    transform: translate(0, -50%) rotate(-18deg) scale(1.12);
  }
}
@keyframes hos-motd-pulse-tilt {
  0%,
  100% {
    transform: rotate(-18deg) scale(1);
  }
  50% {
    transform: rotate(-18deg) scale(1.12);
  }
}
/* Tablet: the wordmark's right edge has less open space (and on
   stacked layouts there's no gap-into-hero-art at all). Pull the
   splash back inside the wrapper, anchored to the top-right corner
   so it floats above + slightly over the wordmark's right edge
   instead of floating off into nothing. `left: auto` resets the
   desktop's `left: 100%` so the absolute element collapses back to
   its content width before `right: 0` re-pins it. */
@media (max-width: 960px) {
  .hos-motd {
    left: auto;
    right: 0;
    top: -8px;
    margin: 0;
    transform-origin: right top;
    transform: rotate(-18deg);
    animation-name: hos-motd-pulse-tilt;
  }
}
/* Mobile: keep it visible but tame the size so a 60-char splash
   doesn't wrap to four lines on a 390px screen. */
@media (max-width: 640px) {
  .hos-motd {
    font-size: 14px;
    max-width: 12ch;
    right: 4px;
    top: -6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hos-motd {
    animation: none;
  }
}

/* ─── Hero art (desktop screenshot) ────────────────────────────────── */
.hos-hero-art {
  position: relative;
  display: flex;
  justify-content: center;
}
.hos-hero-art-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1200 / 630;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-1);
  box-shadow: var(--shadow-modal);
  transform: rotate(-1.2deg);
  transition: transform var(--motion-slow);
  z-index: 1;
}
.hos-hero-art-frame:hover {
  transform: rotate(0deg);
}
.hos-hero-art-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide mobile menu on desktop before Tailwind CDN applies md:hidden */
#hamburger-menu {
  display: none;
}
@media (max-width: 767px) {
  #hamburger-menu {
    display: block;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
  }
}
/* Heyming-engineering brand has no gradients. The hero glow div in the
 * markup gets a flat noop so the box still occupies layout space if any
 * downstream code references it; otherwise it's invisible. */
.hos-hero-art-glow {
  display: none;
}

/* ─── Sections ─────────────────────────────────────────────────────── */
.hos-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}
@media (min-width: 960px) {
  .hos-section {
    padding: 48px 32px;
  }
}

.hos-section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  .hos-section-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}
.hos-section-blurb {
  margin: 4px 0 0;
  max-width: 60ch;
}

/* ─── Latest Posts teaser ──────────────────────────────────────────── */
.hos-posts-teaser {
  padding-top: 8px;
  padding-bottom: 8px;
}

.hos-posts-teaser[hidden] {
  display: none !important;
}

.hos-posts-teaser-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-card);
}

@media (min-width: 720px) {
  .hos-posts-teaser-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.hos-posts-teaser-copy {
  min-width: 0;
  flex: 1;
}

.hos-posts-teaser-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  color: var(--text-2);
  font-size: var(--text-caption);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hos-posts-teaser-when {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--text-2);
  font-size: var(--text-caption);
}

.hos-posts-teaser-body {
  margin: 0;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hos-posts-teaser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  flex-shrink: 0;
}

.hos-posts-teaser-primary {
  text-decoration: none;
}

/* ─── Filter input (gallery + featured) ────────────────────────────── */
.hos-filter-wrap {
  position: relative;
  min-width: 240px;
}
.hos-filter-input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 36px 10px 40px;
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  transition: border-color var(--motion-hover), box-shadow var(--motion-hover);
}
.hos-filter-input::placeholder {
  color: var(--text-3);
}
.hos-filter-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}
.hos-filter-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 14px;
}
.hos-filter-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--motion-hover), background var(--motion-hover);
}
.hos-filter-clear:hover {
  color: var(--text-1);
  background: var(--surface-2);
}
.hos-filter-clear.hidden {
  display: none;
}

/* ─── Category accent system ──────────────────────────────────────────
 * Each gallery card carries data-category="game|utility|entertainment"
 * (system tier inherits brand violet). These rules promote that data
 * attribute to a single --card-accent custom property — every other
 * chrome rule (icon-chip tint, hover border, section dot) just reads
 * from --card-accent and inherits the right color automatically.
 *
 * Color lands on chrome only — never on text, never as a card-surface
 * fill. The dark --surface-1 stays the readable canvas; color signals
 * category at a glance via the icon chip and the on-hover border. */
[data-category='game'] {
  --card-accent: var(--cat-game);
  --card-accent-soft: var(--cat-game-soft);
  --card-accent-hairline: var(--cat-game-hairline);
}
[data-category='utility'] {
  --card-accent: var(--cat-utility);
  --card-accent-soft: var(--cat-utility-soft);
  --card-accent-hairline: var(--cat-utility-hairline);
}
[data-category='entertainment'] {
  --card-accent: var(--cat-entertainment);
  --card-accent-soft: var(--cat-entertainment-soft);
  --card-accent-hairline: var(--cat-entertainment-hairline);
}
/* System tier wins over category — keeps the OS shell and its launcher
 * shortcuts identifiably brand-blue wherever they appear. */
[data-tier='system'] {
  --card-accent: var(--cat-system);
  --card-accent-soft: var(--cat-system-soft);
  --card-accent-hairline: var(--cat-system-hairline);
}

/* ─── Featured heroes ──────────────────────────────────────────────── */
/* Two oversized tiles for the apps that drive ~94% of engaged minutes
 * (Doom + Stepmania per 2026-04/05 GA4). Above-the-fold dual-column on
 * desktop; stack to single column on narrow screens. Below them sits the
 * compact Featured strip with the next 8 popular apps. */
.hos-featured-heroes {
  display: grid;
  /* min(100%, 320px) so a 320px viewport with section padding can still
   * form a single column — bare minmax(320px, 1fr) forced horizontal scroll. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  margin-top: 12px;
  margin-bottom: 20px;
}

/* CLS reservation: containers are populated by index.js after apps-registry
 * is loaded. Reserve approximate rendered height so content below this strip
 * (Featured strip, gallery, footer) doesn't shift when the cards appear.
 * The `:empty` guard releases the reservation once JS injects content, so
 * any small over-estimate doesn't leave dead whitespace.
 *
 * Grid wraps as `auto-fit minmax(320px, 1fr)`. With three heroes today
 * (Doom + Stepmania + NES, promoted 2026-06-13): wide desktop = 1 row,
 * tablet = 2 rows, narrow mobile = 3 rows. */
.hos-featured-heroes:empty {
  min-height: 320px;
}
@media (max-width: 1000px) {
  .hos-featured-heroes:empty {
    min-height: 640px;
  }
}
@media (max-width: 640px) {
  .hos-featured-heroes:empty {
    min-height: 960px;
  }
}

.hos-featured-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-1);
  min-height: 220px;
  transition: border-color var(--motion-hover), transform var(--motion-hover),
    background var(--motion-hover), box-shadow var(--motion-hover);
}
.hos-featured-hero:hover {
  background: var(--surface-2);
  border-color: var(--card-accent-hairline, var(--hairline-accent));
  transform: translateY(-2px);
  box-shadow: 0 12px 32px
    color-mix(in srgb, var(--card-accent, var(--accent-primary)) 22%, transparent);
}
.hos-featured-hero-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hos-featured-hero-presence {
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
  min-width: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-align: center;
  color: var(--card-accent, var(--accent-primary));
  background: color-mix(in srgb, var(--card-accent, var(--accent-primary)) 16%, var(--surface-1));
  border: 1px solid var(--card-accent-hairline, var(--hairline));
  cursor: help;
}
.hos-featured-hero-presence[hidden] {
  display: none !important;
}
.hos-presence-tip {
  position: fixed;
  z-index: 1000001;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: var(--radius, 4px);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  /* Fixed inverse tip — don't use --text-1 as bg (it flips light in dark mode). */
  color: #f0f3f6;
  background: #1c2128;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 80ms ease, transform 80ms ease;
}
.hos-presence-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.hos-presence-tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hos-presence-tip-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.hos-presence-tip-list .hos-presence-tip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hos-presence-tip-list .hos-presence-tip-count {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #9ecbff;
}
.hos-presence-live {
  cursor: help;
}
.hos-featured-hero .app-icon-frame {
  --icon-frame-size: 72px;
  background: color-mix(in srgb, var(--card-accent, var(--accent-primary)) 16%, var(--surface-1));
  border-color: var(--card-accent-hairline, var(--hairline));
  flex-shrink: 0;
}
.hos-featured-hero-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hos-featured-hero-title {
  font-size: var(--text-h2);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.hos-featured-hero-tags {
  font-size: var(--text-caption);
  color: var(--text-2);
  margin: 0;
}
.hos-featured-hero-blurb {
  font-size: var(--text-body);
  color: var(--text-1);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}
.hos-featured-hero-cta {
  display: inline-block;
  align-self: flex-start;
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--card-accent, var(--accent-primary));
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .hos-featured-hero {
    padding: 20px;
    min-height: 0;
  }
  .hos-featured-hero .app-icon-frame {
    --icon-frame-size: 56px;
  }
  .hos-featured-hero-title {
    font-size: var(--text-h3);
  }
}

/* ─── Featured grid ────────────────────────────────────────────────── */
.hos-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* CLS reservation. 8 cards in 4-5 cols on desktop = 2 rows of ~180px. On
 * narrow screens cards stack into more rows; reserve enough to cover the
 * stacked case so the gallery and footer below don't jump. Released via
 * :empty once JS injects the strip. */
.hos-featured-grid:empty {
  min-height: 380px;
}
@media (max-width: 768px) {
  .hos-featured-grid:empty {
    min-height: 1500px;
  }
}

.hos-featured-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-1);
  transition: border-color var(--motion-hover), transform var(--motion-hover),
    background var(--motion-hover), box-shadow var(--motion-hover);
}
.hos-featured-card:hover {
  background: var(--surface-2);
  border-color: var(--card-accent-hairline, var(--hairline-accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px
    color-mix(in srgb, var(--card-accent, var(--accent-primary)) 18%, transparent);
}
/* Tinted icon chip — the category accent rides on the squircle, not on
 * the whole card. Single biggest "this is a game / tool / experience"
 * cue without any color landing on the text. */
.hos-featured-card .app-icon-frame {
  --icon-frame-size: 56px;
  background: color-mix(in srgb, var(--card-accent, var(--accent-primary)) 14%, var(--surface-1));
  border-color: var(--card-accent-hairline, var(--hairline));
}
.hos-featured-card-title {
  font-size: var(--text-h3);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
}
.hos-featured-card-blurb {
  font-size: var(--text-caption);
  color: var(--text-2);
  margin: 0;
  line-height: 1.45;
}

/* ─── Gallery (tier-aware) ─────────────────────────────────────────── */
#app-gallery {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* CLS reservation for the full 59-app gallery (3 category sections). The
 * gallery is below the fold for most viewports, but its eventual height
 * still pushes the footer and SEO copy down, which counts as a layout shift
 * if it happens after first paint. Released via :empty once index.js
 * renders the sections. */
#app-gallery:empty {
  min-height: 3000px;
}
@media (max-width: 768px) {
  #app-gallery:empty {
    min-height: 6000px;
  }
}

.hos-gallery-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hos-gallery-section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hos-gallery-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--text-1);
}
.hos-gallery-section-title .hos-gallery-section-icon {
  font-size: 24px;
  line-height: 1;
}
/* Section heading accent pip — the legend for the category palette. A
 * 10px solid dot in the section's category color, paired with the
 * existing emoji so color reinforces rather than carries the meaning
 * (a11y: color is never the sole signal). Section ids map to the
 * registry category their filter selects on. */
.hos-gallery-section[data-section='games'] .hos-gallery-section-title::before,
.hos-gallery-section[data-section='music'] .hos-gallery-section-title::before,
.hos-gallery-section[data-section='tools'] .hos-gallery-section-title::before,
.hos-gallery-section[data-section='fun'] .hos-gallery-section-title::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--section-accent, var(--accent-primary));
  flex-shrink: 0;
}
.hos-gallery-section[data-section='games'] {
  --section-accent: var(--cat-game);
}
.hos-gallery-section[data-section='music'] {
  --section-accent: var(--cat-entertainment);
}
.hos-gallery-section[data-section='tools'] {
  --section-accent: var(--cat-utility);
}
.hos-gallery-section[data-section='fun'] {
  --section-accent: var(--cat-entertainment);
}
.hos-gallery-section-blurb {
  margin: 0;
  color: var(--text-2);
  font-size: var(--text-caption);
}

.hos-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.hos-app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-1);
  transition: border-color var(--motion-hover), transform var(--motion-hover),
    background var(--motion-hover), box-shadow var(--motion-hover);
}
.hos-app-card:hover {
  background: var(--surface-2);
  border-color: var(--card-accent-hairline, var(--hairline-accent));
  transform: translateY(-2px);
  /* Tinted hover halo — the same color the icon chip carries, dropped
   * as a soft outer glow so the card "lights up in its own color" on
   * hover. Adds variety as the cursor moves across the grid. */
  box-shadow: 0 8px 24px
    color-mix(in srgb, var(--card-accent, var(--accent-primary)) 18%, transparent);
}
/* Tinted icon chip — same recipe as the featured card. The square card
 * carries the category color so every card reads its meaning at a
 * glance without text or color contrast trade-offs. */
.hos-app-card .app-icon-frame {
  background: color-mix(in srgb, var(--card-accent, var(--accent-primary)) 14%, var(--surface-1));
  border-color: var(--card-accent-hairline, var(--hairline));
}

.hos-app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hos-app-card-title {
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.hos-app-card-presence {
  flex-shrink: 0;
  min-width: 1.35rem;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-align: center;
  color: var(--card-accent, var(--accent-primary));
  background: color-mix(in srgb, var(--card-accent, var(--accent-primary)) 14%, var(--surface-1));
  border: 1px solid var(--card-accent-hairline, var(--hairline));
  cursor: help;
}
.hos-app-card-presence[hidden] {
  display: none !important;
}
.hos-app-card-blurb {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--text-2);
  line-height: 1.45;
  flex: 1;
}

/* Tier signaling — shape + typography, NOT color alone (a11y). */
.hos-app-card-tier {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
}
.hos-app-card[data-tier='system'] {
  border-color: var(--hairline-accent);
}
.hos-app-card[data-tier='system'] .hos-app-card-tier {
  color: var(--accent-primary-hover);
  border-color: var(--hairline-accent);
}
.hos-app-card[data-tier='experience'] .hos-app-card-tier {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
}

/* ─── Novelty treatment ────────────────────────────────────────────────
 * Apps with sub-35s average engagement (per 2026-04/05 GA4) stay in the
 * catalog but step back visually so the eye lands on apps that retain.
 * The card keeps its hit area; we mute the surface, dim the body copy,
 * and shrink the icon a notch. Hover restores normal contrast so the
 * affordance is preserved for anyone who actually wants the novelty. */
.hos-app-card[data-engagement='novelty'] {
  opacity: 0.78;
}
.hos-app-card[data-engagement='novelty'] .app-icon-frame {
  --icon-frame-size: 40px;
}
.hos-app-card[data-engagement='novelty'] .hos-app-card-blurb {
  color: var(--text-3);
}
.hos-app-card[data-engagement='novelty']:hover {
  opacity: 1;
}

/* ─── No-results state ─────────────────────────────────────────────── */
.hos-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
  font-size: var(--text-caption);
  background: var(--surface-1);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-lg);
}

/* ─── Theme switcher (footer segmented control) ─────────────────────
 * Three-way Auto/Light/Dark. The active option carries
 * `aria-checked="true"` from theme.js; the visual selection rides
 * on that attribute so screen readers and the painted UI agree.
 *
 * Color reads from brand tokens — the switcher itself dark-modes
 * along with everything else on the home page. */
.hos-theme-switch {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 2px;
  gap: 0;
}
.hos-theme-option {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--motion-hover), color var(--motion-hover),
    box-shadow var(--motion-hover);
  letter-spacing: 0.01em;
}
.hos-theme-option:hover:not([aria-checked='true']) {
  color: var(--text-1);
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}
.hos-theme-option[aria-checked='true'] {
  background: var(--surface-1);
  color: var(--text-1);
  box-shadow: var(--shadow-soft);
}
.hos-theme-option:focus-visible {
  outline-offset: -1px;
}

/* ─── Footer ───────────────────────────────────────────────────────── */
.hos-footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  padding: 48px 24px 64px;
  background: var(--surface-1);
  border-top: 1px solid var(--hairline);
}
.hos-footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hos-footer-brand p {
  margin: 0;
}
.hos-footer-social {
  display: flex;
  gap: 8px;
}
.hos-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--motion-hover), background var(--motion-hover),
    border-color var(--motion-hover);
}
.hos-social-link:hover {
  color: var(--text-1);
  background: var(--surface-1);
  border-color: var(--hairline-accent);
}
.hos-social-link svg {
  width: 20px;
  height: 20px;
}
.hos-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--text-caption);
  color: var(--text-3);
}
.hos-footer-legal a {
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--motion-hover);
}
.hos-footer-legal a:hover {
  color: var(--text-1);
}
.hos-footer-legal span[aria-hidden] {
  color: var(--hairline-strong);
}

/* ─── Hamburger menu (mobile) ──────────────────────────────────────── *
 * Retuned to brand tokens. Behavior preserved (animation, slide-in,
 * staggered link reveal) but the palette is now Heyming OS, not green.
 */
.hamburger-line {
  transform-origin: center;
}
#hamburger-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(2px, 2px);
}
#hamburger-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
#hamburger-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(2px, -2px);
}

#hamburger-panel.show {
  transform: translateX(0);
  opacity: 1;
}

.hamburger-app-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-1);
  transition: transform var(--motion-hover), background var(--motion-hover);
}
.hamburger-app-link:hover {
  background: var(--surface-2);
  transform: translateX(-2px);
}
.hamburger-app-link:active {
  transform: translateX(0) scale(0.98);
}

@keyframes hos-fade-up {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
#hamburger-panel.show .hamburger-app-link {
  animation: hos-fade-up 0.25s ease-out forwards;
  opacity: 0;
}
#hamburger-panel.show .hamburger-app-link:nth-child(1) {
  animation-delay: 0.04s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(2) {
  animation-delay: 0.08s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(3) {
  animation-delay: 0.12s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(4) {
  animation-delay: 0.16s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(5) {
  animation-delay: 0.2s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(6) {
  animation-delay: 0.24s;
}
#hamburger-panel.show .hamburger-app-link:nth-child(n + 7) {
  animation-delay: 0.28s;
}

@media (max-width: 640px) {
  /* Keep the closed panel off-screen via transform only. Negative `right`
   * values expand document scrollWidth and fail Yandex's 320px check. */
  #hamburger-panel {
    position: fixed;
    top: 64px;
    right: 12px;
    width: min(90vw, 20rem);
    max-width: none;
  }
  #hamburger-toggle {
    min-height: 56px;
    min-width: 56px;
  }
}

@media (max-width: 768px) {
  #hamburger-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--scrim);
    z-index: -1;
  }
}

/* ─── SEO intro (visually hidden but in DOM for crawlers) ──────────── */
.seo-intro {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Vivid granite tiles theme ───────────────────────────────────── */
:root {
  --granite-bg-top: #140d0a;
  --granite-bg-bottom: #2b2019;
  --granite-panel: rgba(58, 43, 34, 0.9);
  --granite-panel-strong: rgba(78, 58, 45, 0.96);
  --granite-edge: #7b5d45;
  --granite-edge-strong: #a87954;
  --granite-accent: #ffb468;
  --granite-accent-strong: #ff8e36;
  --granite-text: #f7efe3;
  --granite-muted: #d1baa2;
  --granite-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

html[data-theme='light'] {
  --granite-bg-top: #f2e4d4;
  --granite-bg-bottom: #c8ab8b;
  --granite-panel: rgba(255, 248, 240, 0.92);
  --granite-panel-strong: rgba(247, 235, 220, 0.98);
  --granite-edge: #8f684c;
  --granite-edge-strong: #6f4d33;
  --granite-accent: #c96f1d;
  --granite-accent-strong: #a74f0d;
  --granite-text: #2a1c12;
  --granite-muted: #6b4d34;
  --granite-shadow: 0 18px 45px rgba(96, 58, 24, 0.18);
}

body.hos-page {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 180, 104, 0.2), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(123, 93, 69, 0.3), transparent 32%),
    linear-gradient(135deg, var(--granite-bg-top), var(--granite-bg-bottom));
  color: var(--granite-text);
  position: relative;
}

body.hos-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 94%);
}

.hos-identity-strip {
  background: rgba(25, 18, 14, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.hos-hero {
  position: relative;
  margin: 24px auto 18px;
  padding: 32px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(145deg, rgba(91, 71, 56, 0.95), rgba(34, 25, 19, 0.95));
  box-shadow: var(--granite-shadow);
  overflow: hidden;
}

.hos-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hos-hero-eyebrow {
  color: var(--granite-accent);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hos-hero-tagline,
.hos-hero-description,
.hos-section h2,
.hos-section h3,
.hos-filter-wrap input,
.hos-footer a,
.hos-footer p,
.hos-posts-teaser-card {
  color: var(--granite-text);
}

.hos-hero-description {
  color: var(--granite-muted);
}

.hos-cta-primary,
.hos-cta-secondary,
.hos-posts-teaser-primary,
.hos-theme-option,
.hos-filter-clear {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hos-cta-primary {
  background: linear-gradient(135deg, var(--granite-accent), var(--granite-accent-strong));
  color: #23160d;
  font-weight: 800;
}

.hos-cta-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--granite-text);
}

.hos-hero-art-frame,
.hos-posts-teaser-card,
.hos-featured-hero,
.hos-featured-card,
.hos-app-card,
.hos-gallery-section,
.hos-footer,
.hos-filter-wrap,
.hos-filter-input {
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--granite-shadow);
}

.hos-hero-art-frame {
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(66, 46, 34, 0.95), rgba(22, 16, 12, 0.96));
}

.hos-section {
  position: relative;
  padding: 28px 24px;
  margin: 22px auto;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(58, 43, 34, 0.86), rgba(31, 22, 18, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--granite-shadow);
}

.hos-posts-teaser-card {
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(73, 54, 43, 0.95), rgba(39, 28, 22, 0.95));
}

.hos-featured-hero,
.hos-featured-card,
.hos-app-card {
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(72, 54, 42, 0.95), rgba(36, 26, 20, 0.97));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hos-featured-hero:hover,
.hos-featured-card:hover,
.hos-app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 180, 104, 0.45);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34);
}

.hos-app-card {
  position: relative;
  overflow: hidden;
}

.hos-app-card::before,
.hos-featured-card::before,
.hos-featured-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%);
  pointer-events: none;
}

.hos-gallery-section {
  border-radius: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.hos-gallery-section-title,
.hos-gallery-section-blurb {
  color: var(--granite-text);
}

.hos-gallery-section-blurb {
  color: var(--granite-muted);
}

.hos-filter-wrap {
  border-radius: 999px;
  padding: 6px 10px 6px 14px;
  background: rgba(255, 255, 255, 0.06);
}

.hos-filter-input {
  background: transparent;
  color: var(--granite-text);
  border: 0;
}

.hos-filter-input::placeholder {
  color: var(--granite-muted);
}

.hos-filter-clear {
  background: rgba(255, 255, 255, 0.08);
  color: var(--granite-text);
}

.hos-footer {
  margin: 24px auto 0;
  padding: 28px 24px;
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(40, 31, 25, 0.95), rgba(21, 15, 11, 0.98));
  box-shadow: var(--granite-shadow);
}

.hos-theme-option {
  background: rgba(255, 255, 255, 0.06);
  color: var(--granite-text);
}

.hos-theme-option[aria-checked='true'] {
  background: linear-gradient(135deg, var(--granite-accent), var(--granite-accent-strong));
  color: #26160c;
}

.hos-footer a,
.hos-footer-legal a {
  color: var(--granite-muted);
}

.hos-footer a:hover,
.hos-footer-legal a:hover {
  color: var(--granite-accent);
}

@media (max-width: 768px) {
  .hos-hero {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .hos-section,
  .hos-footer {
    border-radius: 22px;
    padding: 22px 16px;
  }

  .hos-filter-wrap {
    width: 100%;
    margin-top: 10px;
  }
}
