/*
 * 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;
  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);
}
@media (max-width: 767px) {
  .hos-identity-strip {
    justify-content: flex-start;
    padding-right: 88px;
    overflow: hidden;
  }

  .hos-identity-strip a,
  .hos-identity-strip span[aria-hidden] {
    display: none;
  }
}

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

.hos-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.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: 4px 0 0;
  max-width: 48ch;
}

.hos-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.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 20px 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;
}

.nyx-hero-console {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(rgba(0, 255, 224, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 224, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(0, 255, 224, 0.22), transparent 30%),
    radial-gradient(circle at 78% 86%, rgba(255, 43, 242, 0.18), transparent 34%),
    #05020d;
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

.nyx-hero-topbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nyx-hero-topbar span {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-primary);
  box-shadow: 0 0 16px rgba(0, 255, 224, 0.5);
}

.nyx-hero-topbar span:nth-child(2) {
  background: var(--accent-red);
  box-shadow: 0 0 16px rgba(255, 49, 90, 0.45);
}

.nyx-hero-topbar span:nth-child(3) {
  background: var(--accent-yellow);
  box-shadow: 0 0 16px rgba(255, 233, 92, 0.45);
}

.nyx-hero-mark {
  width: min(68%, 340px);
  height: auto;
  object-fit: contain;
  align-self: center;
  margin-top: 4px;
  filter: drop-shadow(0 0 18px rgba(0, 255, 224, 0.28));
}

.nyx-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nyx-hero-card {
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 224, 0.28);
  border-radius: var(--radius);
  background: rgba(9, 9, 26, 0.74);
  box-shadow: inset 0 0 24px rgba(0, 255, 224, 0.04);
}

.nyx-hero-card strong {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0;
}

.nyx-hero-card span,
.nyx-hero-console-lines span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0;
}

.nyx-hero-console-lines {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.nyx-hero-console-lines span::before {
  content: '$ ';
  color: var(--accent-primary);
}

@media (max-width: 640px) {
  .nyx-hero-console {
    padding: 18px;
    gap: 14px;
  }

  .nyx-hero-card {
    min-height: 72px;
    padding: 12px;
  }
}

/* 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: 56px 24px;
}
@media (min-width: 960px) {
  .hos-section {
    padding: 72px 32px;
  }
}

.hos-section-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
@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;
}

/* ─── 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;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 28px;
}

/* 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 .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;
}
.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: 10px;
  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;
  align-items: 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) {
  #hamburger-panel {
    width: 90vw;
    right: -45vw;
    max-width: none;
  }
  #hamburger-panel.show {
    right: -5vw;
  }
  #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;
}
